add test, updates #65

This commit is contained in:
Jan Mercl
2021-09-17 12:38:44 +02:00
parent e3be4b029c
commit fa683c81c6
2 changed files with 147 additions and 2 deletions

View File

@@ -2,14 +2,15 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build cgo && cgobench
// +build cgo,cgobench
//go:build (cgo && cgobench) || ignore || (cgo && cgotest)
// +build cgo,cgobench ignore cgo,cgotest
package sqlite // import "modernc.org/sqlite"
import (
"database/sql"
"fmt"
"io/ioutil"
"os"
"path/filepath"
"testing"
@@ -201,3 +202,22 @@ func BenchmarkInsertComparative(b *testing.B) {
}
}
}
// https://gitlab.com/cznic/sqlite/-/issues/65
func TestIssue65CGo(t *testing.T) {
tempDir, err := ioutil.TempDir("", "")
if err != nil {
t.Fatal(err)
}
defer func() {
os.RemoveAll(tempDir)
}()
db, err := sql.Open("sqlite3", filepath.Join(tempDir, "testissue65.sqlite"))
if err != nil {
t.Fatalf("Failed to open database: %v", err)
}
testIssue65(t, db, false)
}