From d8f315ab8365c93960cb8ae4c7b66b0b24a5fd4c Mon Sep 17 00:00:00 2001 From: mattn Date: Mon, 9 Sep 2013 13:45:51 +0900 Subject: [PATCH] Fixes test --- sqlite3_test.go | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/sqlite3_test.go b/sqlite3_test.go index 8a95314..5b4a05f 100644 --- a/sqlite3_test.go +++ b/sqlite3_test.go @@ -591,10 +591,10 @@ func TestExecer(t *testing.T) { _, err = db.Exec(` create table foo (id integer); - insert into foo(id) values(1); - insert into foo(id) values(2); - insert into foo(id) values(3); - `) + insert into foo(id) values(?); + insert into foo(id) values(?); + insert into foo(id) values(?); + `, 1, 2, 3) if err != nil { t.Error("Failed to call db.Exec:", err) } @@ -612,8 +612,14 @@ func TestQueryer(t *testing.T) { defer os.Remove(tempFilename) defer db.Close() - rows, err := db.Query(` + _, err = db.Exec(` create table foo (id integer); + `) + if err != nil { + t.Error("Failed to call db.Query:", err) + } + + rows, err := db.Query(` insert into foo(id) values(?); insert into foo(id) values(?); insert into foo(id) values(?);