sdk/hints: sqlite backend and tests.
This commit is contained in:
28
sdk/hints/test/mattnsqlite_test.go
Normal file
28
sdk/hints/test/mattnsqlite_test.go
Normal file
@@ -0,0 +1,28 @@
|
||||
//go:build sqlite_math_functions
|
||||
|
||||
package test
|
||||
|
||||
import (
|
||||
"os"
|
||||
"testing"
|
||||
|
||||
"github.com/jmoiron/sqlx"
|
||||
_ "github.com/mattn/go-sqlite3"
|
||||
"github.com/nbd-wtf/go-nostr/sdk/hints/sqlite"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func TestSQLiteHintsMattn(t *testing.T) {
|
||||
path := "/tmp/tmpsdkhintssqlite"
|
||||
os.RemoveAll(path)
|
||||
|
||||
db, err := sqlx.Connect("sqlite3", path)
|
||||
|
||||
require.NoError(t, err, "failed to create sqlitehints db")
|
||||
db.SetMaxOpenConns(1)
|
||||
|
||||
sh, err := sqlite.NewSQLiteHints(db)
|
||||
require.NoError(t, err, "failed to setup sqlitehints db")
|
||||
|
||||
runTestWith(t, sh)
|
||||
}
|
||||
Reference in New Issue
Block a user