go-ssb-room/roomdb/sqlite/new_test.go

27 lines
487 B
Go

package sqlite
import (
"os"
"path/filepath"
"testing"
_ "github.com/mattn/go-sqlite3"
"github.com/stretchr/testify/require"
"github.com/ssb-ngi-pointer/go-ssb-room/internal/repo"
)
// verify the database opens and migrates successfully from zero state
func TestSchema(t *testing.T) {
testRepo := filepath.Join("testrun", t.Name())
os.RemoveAll(testRepo)
tr := repo.New(testRepo)
db, err := Open(tr)
require.NoError(t, err)
err = db.Close()
require.NoError(t, err)
}