gorm/dialects/sqlite/sqlite_test.go

28 lines
470 B
Go
Raw Normal View History

2020-02-02 03:35:01 +03:00
package sqlite_test
import (
2020-02-02 09:40:44 +03:00
"fmt"
2020-02-02 03:35:01 +03:00
"os"
"path/filepath"
"testing"
"github.com/jinzhu/gorm"
2020-02-02 09:40:44 +03:00
"github.com/jinzhu/gorm/dialects/sqlite"
"github.com/jinzhu/gorm/tests"
2020-02-02 03:35:01 +03:00
)
2020-02-02 09:40:44 +03:00
var (
DB *gorm.DB
err error
)
func init() {
if DB, err = gorm.Open(sqlite.Open(filepath.Join(os.TempDir(), "gorm.db")), &gorm.Config{}); err != nil {
panic(fmt.Sprintf("failed to initialize database, got error %v", err))
}
}
2020-02-02 03:35:01 +03:00
2020-02-02 09:40:44 +03:00
func TestSqlite(t *testing.T) {
tests.RunTestsSuit(t, DB)
2020-02-02 03:35:01 +03:00
}