mirror of
https://github.com/ncruces/go-sqlite3.git
synced 2026-01-12 05:59:14 +00:00
Stricter test.
This commit is contained in:
@@ -1,7 +1,9 @@
|
|||||||
package tests
|
package tests
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"errors"
|
||||||
"io"
|
"io"
|
||||||
|
"log"
|
||||||
"net/url"
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"os/exec"
|
"os/exec"
|
||||||
@@ -19,6 +21,20 @@ import (
|
|||||||
"github.com/ncruces/go-sqlite3/vfs/memdb"
|
"github.com/ncruces/go-sqlite3/vfs/memdb"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func TestMain(m *testing.M) {
|
||||||
|
sqlite3.AutoExtension(func(c *sqlite3.Conn) error {
|
||||||
|
return c.ConfigLog(func(code sqlite3.ExtendedErrorCode, msg string) {
|
||||||
|
// Having to do journal recovery is unexpected.
|
||||||
|
if errors.Is(code, sqlite3.NOTICE) {
|
||||||
|
log.Panicf("%v (%d): %s", code, code, msg)
|
||||||
|
} else {
|
||||||
|
log.Printf("%v (%d): %s", code, code, msg)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
m.Run()
|
||||||
|
}
|
||||||
|
|
||||||
func Test_parallel(t *testing.T) {
|
func Test_parallel(t *testing.T) {
|
||||||
if !vfs.SupportsFileLocking {
|
if !vfs.SupportsFileLocking {
|
||||||
t.Skip("skipping without locks")
|
t.Skip("skipping without locks")
|
||||||
|
|||||||
Reference in New Issue
Block a user