aboutsummaryrefslogtreecommitdiff
path: root/sqlite3_test.go
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2016-11-04 15:17:21 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2016-11-04 15:17:21 +0900
commit57eaf4c0709539478ef65348d27518327283c840 (patch)
tree8b893ca791939e310bd0eb741efbc55654ac9c50 /sqlite3_test.go
parentadd BeginContext (diff)
downloadgolite-57eaf4c0709539478ef65348d27518327283c840.tar.gz
golite-57eaf4c0709539478ef65348d27518327283c840.tar.xz
separate test
Diffstat (limited to 'sqlite3_test.go')
-rw-r--r--sqlite3_test.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/sqlite3_test.go b/sqlite3_test.go
index b126bbd..e578404 100644
--- a/sqlite3_test.go
+++ b/sqlite3_test.go
@@ -993,42 +993,6 @@ func TestVersion(t *testing.T) {
}
}
-func TestNamedParams(t *testing.T) {
- tempFilename := TempFilename(t)
- defer os.Remove(tempFilename)
- db, err := sql.Open("sqlite3", tempFilename)
- if err != nil {
- t.Fatal("Failed to open database:", err)
- }
- defer db.Close()
-
- _, err = db.Exec(`
- create table foo (id integer, name text, extra text);
- `)
- if err != nil {
- t.Error("Failed to call db.Query:", err)
- }
-
- _, err = db.Exec(`insert into foo(id, name, extra) values(:id, :name, :name)`, sql.Param(":name", "foo"), sql.Param(":id", 1))
- if err != nil {
- t.Error("Failed to call db.Exec:", err)
- }
-
- row := db.QueryRow(`select id, extra from foo where id = :id and extra = :extra`, sql.Param(":id", 1), sql.Param(":extra", "foo"))
- if row == nil {
- t.Error("Failed to call db.QueryRow")
- }
- var id int
- var extra string
- err = row.Scan(&id, &extra)
- if err != nil {
- t.Error("Failed to db.Scan:", err)
- }
- if id != 1 || extra != "foo" {
- t.Error("Failed to db.QueryRow: not matched results")
- }
-}
-
func TestStringContainingZero(t *testing.T) {
tempFilename := TempFilename(t)
defer os.Remove(tempFilename)