2
0

Remove mustPrepare from tests

Now that Query/QueryRow always prepares statements when given SQL
text there is no need to test raw SQL and prepared statements of
the same query.
This commit is contained in:
Jack Christensen
2015-09-03 13:39:28 -05:00
parent e69d2bba26
commit f672dd2732
3 changed files with 20 additions and 71 deletions
+6 -12
View File
@@ -488,19 +488,13 @@ func TestQueryRowNoResults(t *testing.T) {
conn := mustConnect(t, *defaultConnConfig)
defer closeConn(t, conn)
sql := "select 1 where 1=0"
psName := "selectNothing"
mustPrepare(t, conn, psName, sql)
for _, sql := range []string{sql, psName} {
var n int32
err := conn.QueryRow(sql).Scan(&n)
if err != pgx.ErrNoRows {
t.Errorf("Expected pgx.ErrNoRows, got %v", err)
}
ensureConnValid(t, conn)
var n int32
err := conn.QueryRow("select 1 where 1=0").Scan(&n)
if err != pgx.ErrNoRows {
t.Errorf("Expected pgx.ErrNoRows, got %v", err)
}
ensureConnValid(t, conn)
}
func TestQueryRowCoreInt16Slice(t *testing.T) {