forked from mirror/gorm
28 lines
470 B
Go
28 lines
470 B
Go
package sqlite_test
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"path/filepath"
|
|
"testing"
|
|
|
|
"github.com/jinzhu/gorm"
|
|
"github.com/jinzhu/gorm/dialects/sqlite"
|
|
"github.com/jinzhu/gorm/tests"
|
|
)
|
|
|
|
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))
|
|
}
|
|
}
|
|
|
|
func TestSqlite(t *testing.T) {
|
|
tests.RunTestsSuit(t, DB)
|
|
}
|