Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
24 lines (20 sloc) 587 Bytes
package sqlite3
import "testing"
func TestSession(t *testing.T) {
Session("test.db", func(db *Database) {
FOO.Drop(db)
FOO.Create(db)
db.runQuery(t, "INSERT INTO foo values (1, 'this is a test')")
db.runQuery(t, "INSERT INTO foo values (?, ?)", 2, "holy moly")
db.stepThroughRows(t, FOO)
})
}
func TestTransientSession(t *testing.T) {
TransientSession(func(db *Database) {
FOO.Drop(db)
FOO.Create(db)
db.runQuery(t, "INSERT INTO foo values (1, 'this is a test')")
db.runQuery(t, "INSERT INTO foo values (?, ?)", 2, "holy moly")
db.stepThroughRows(t, FOO)
})
}