diff options
author | Matthew Lemon <lemon@matthewlemon.com> | 2020-07-19 15:04:41 +0100 |
---|---|---|
committer | Matthew Lemon <lemon@matthewlemon.com> | 2020-07-19 15:04:41 +0100 |
commit | bd587a070753c3f95ff921c83939bdec3a1284b9 (patch) | |
tree | 391ba3c7ec71b648212a7c2e5ada77d79a39b161 /db/setup_test.go | |
parent | 1db96177350b8d785be2728f3d44907c8998d7b0 (diff) |
restructure
Diffstat (limited to 'db/setup_test.go')
-rw-r--r-- | db/setup_test.go | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/db/setup_test.go b/db/setup_test.go deleted file mode 100644 index e256f9c..0000000 --- a/db/setup_test.go +++ /dev/null @@ -1,29 +0,0 @@ -package db - -import "testing" - -func TestOpenSQLiteFile(t *testing.T) { - // db, err := sql.Open("sqlite3", "testdata/test.db") - db, err := SetupDB("./testdata/test.db") - defer db.Close() - if err != nil { - t.Fatal("Expected to be able to set up the database.") - } - stmt := `insert into datamap(id, name) values(1,'cock')` - _, err = db.Exec(stmt) - if err != nil { - t.Errorf("Cannot add record to db") - } - rows, err := db.Query("select name from datamap") - if err != nil { - t.Errorf("Cannot run select statement") - } - defer rows.Close() - for rows.Next() { - var name string - err = rows.Scan(&name) - if err != nil { - t.Errorf("Cannot scan resulting row") - } - } -} |