aboutsummaryrefslogtreecommitdiff
path: root/all_test.go
diff options
context:
space:
mode:
authorJan Mercl <0xjnml@gmail.com>2017-05-22 14:58:44 +0200
committerJan Mercl <0xjnml@gmail.com>2017-05-22 14:58:44 +0200
commit1a3b0a731a9d2b66fb058caef95c004634b17307 (patch)
tree7d1ab4a44af5839ee9a4badacec82a44a8718e70 /all_test.go
parenta884a7b74b8900b0b2871b9e658292c145e38c05 (diff)
Add bug reproduction test. Updates #11.
modified: all_test.go
Diffstat (limited to 'all_test.go')
-rw-r--r--all_test.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/all_test.go b/all_test.go
index 6a060eb..34f5349 100644
--- a/all_test.go
+++ b/all_test.go
@@ -464,3 +464,31 @@ func BenchmarkNextMemory(b *testing.B) {
d := time.Since(t0)
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)
+ }
+}