@@ -18,6 +18,7 @@ import (
1818 "github.com/ncruces/go-sqlite3/vfs"
1919 _ "github.com/ncruces/go-sqlite3/vfs/adiantum"
2020 "github.com/ncruces/go-sqlite3/vfs/memdb"
21+ "github.com/ncruces/go-sqlite3/vfs/mvcc"
2122 _ "github.com/ncruces/go-sqlite3/vfs/xts"
2223)
2324
@@ -98,6 +99,22 @@ func Test_memdb(t *testing.T) {
9899 testIntegrity (t , name )
99100}
100101
102+ func Test_mvcc (t * testing.T ) {
103+ var iter int
104+ if testing .Short () {
105+ iter = 1000
106+ } else {
107+ iter = 5000
108+ }
109+
110+ mvcc .Create ("test.db" , "" )
111+ name := "file:/test.db?vfs=mvcc" +
112+ "&_pragma=busy_timeout(10000)"
113+ createDB (t , name )
114+ testParallel (t , name , iter )
115+ testIntegrity (t , name )
116+ }
117+
101118func Test_adiantum (t * testing.T ) {
102119 if ! vfs .SupportsFileLocking {
103120 t .Skip ("skipping without locks" )
@@ -312,6 +329,16 @@ func Benchmark_memdb(b *testing.B) {
312329 testParallel (b , name , b .N )
313330}
314331
332+ func Benchmark_mvcc (b * testing.B ) {
333+ mvcc .Create ("test.db" , "" )
334+ name := "file:/test.db?vfs=mvcc" +
335+ "&_pragma=busy_timeout(10000)"
336+ createDB (b , name )
337+
338+ b .ResetTimer ()
339+ testParallel (b , name , b .N )
340+ }
341+
315342func createDB (t testing.TB , name string ) {
316343 db , err := sqlite3 .Open (name )
317344 if err != nil {
0 commit comments