Index: src/pkg/exp/sql/sql_test.go |
=================================================================== |
--- a/src/pkg/exp/sql/sql_test.go |
+++ b/src/pkg/exp/sql/sql_test.go |
@@ -10,8 +10,10 @@ |
"testing" |
) |
+const fakeDBName = "foo" |
+ |
func newTestDB(t *testing.T, name string) *DB { |
- db, err := Open("test", "foo") |
+ db, err := Open("test", fakeDBName) |
if err != nil { |
t.Fatalf("Open: %v", err) |
} |
@@ -73,6 +75,12 @@ |
if !reflect.DeepEqual(got, want) { |
t.Logf(" got: %#v\nwant: %#v", got, want) |
} |
+ |
+ // And verify that the final rows.Next() call, which hit EOF, |
+ // also closed the rows connection. |
+ if n := len(db.freeConn); n != 1 { |
+ t.Errorf("free conns after query hitting EOF = %d; want 1", n) |
+ } |
} |
func TestRowsColumns(t *testing.T) { |