integ: add sqlite to json tests (#686)

This commit is contained in:
Ariel Mashraki
2020-08-23 20:51:19 +03:00
committed by GitHub
parent ae7ba0b43c
commit c907c8bbbc
2 changed files with 19 additions and 3 deletions

View File

@@ -22,6 +22,7 @@ import (
"github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
_ "github.com/mattn/go-sqlite3"
"github.com/stretchr/testify/require"
)
@@ -83,6 +84,21 @@ func TestPostgres(t *testing.T) {
}
}
func TestSQLite(t *testing.T) {
client, err := ent.Open("sqlite3", "file:ent?mode=memory&cache=shared&_fk=1")
require.NoError(t, err)
defer client.Close()
ctx := context.Background()
require.NoError(t, client.Schema.Create(ctx, migrate.WithGlobalUniqueID(true)))
URL(t, client)
Dirs(t, client)
Ints(t, client)
Floats(t, client)
Strings(t, client)
RawMessage(t, client)
}
func Ints(t *testing.T, client *ent.Client) {
ctx := context.Background()
ints := []int{1, 2, 3}