Преглед изворни кода

Added behavioral test to validate whether *queryInfo should indeed include a non-empty return value args

Ben Hood пре 11 година
родитељ
комит
0e07643a92
1 измењених фајлова са 17 додато и 0 уклоњено
  1. 17 0
      cassandra_test.go

+ 17 - 0
cassandra_test.go

@@ -604,6 +604,23 @@ func TestReprepareBatch(t *testing.T) {
 
 }
 
+func TestQueryInfo(t *testing.T) {
+	session := createSession(t)
+	defer session.Close()
+
+	conn := session.Pool.Pick(nil)
+	info, err := conn.prepareStatement("SELECT release_version, host_id FROM system.local WHERE key = ?", nil)
+
+	if err != nil {
+		t.Fatalf("Failed to execute query for preparing statement: %v", err)
+	}
+
+	if len(info.rval) == 0 {
+		t.Fatal("Was not expecting to get an empty return value as part of the query info")
+	}
+
+}
+
 //TestPreparedCacheEviction will make sure that the cache size is maintained
 func TestPreparedCacheEviction(t *testing.T) {
 	session := createSession(t)