Add bug reproduction test. Updates #11.

modified:   all_test.go
This commit is contained in:
Jan Mercl
2017-05-22 14:58:44 +02:00
parent a884a7b74b
commit 1a3b0a731a

View File

@@ -464,3 +464,31 @@ func BenchmarkNextMemory(b *testing.B) {
d := time.Since(t0) d := time.Since(t0)
profile(b, d, os.Stderr, "==== BenchmarkNextMemory b.N %v\n", b.N) profile(b, d, os.Stderr, "==== BenchmarkNextMemory b.N %v\n", b.N)
} }
// https://github.com/cznic/sqlite/issues/11
func TestIssue11(t *testing.T) {
const N = 6570
dir, db := tempDB(t)
defer func() {
db.Close()
os.RemoveAll(dir)
}()
if _, err := db.Exec(`
CREATE TABLE t1 (t INT);
BEGIN;
`,
); err != nil {
panic(err)
}
for i := 0; i < N; i++ {
if _, err := db.Exec("INSERT INTO t1 (t) VALUES (?)", i); err != nil {
t.Fatalf("#%v: %v", i, err)
}
}
if _, err := db.Exec("COMMIT;"); err != nil {
t.Fatal(err)
}
}