Fix dump test (#1625)

Fix dump test

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1625
This commit is contained in:
Lunny Xiao 2020-03-24 02:51:37 +00:00
parent 9dca7f0703
commit 6132eea08c
1 changed files with 4 additions and 3 deletions

View File

@ -85,7 +85,7 @@ func TestDump(t *testing.T) {
{Name: "5'\n"}, {Name: "5'\n"},
}) })
fp := testEngine.Dialect().URI().DBName + ".sql" fp := fmt.Sprintf("%v.sql", testEngine.Dialect().URI().DBType)
os.Remove(fp) os.Remove(fp)
assert.NoError(t, testEngine.DumpAllToFile(fp)) assert.NoError(t, testEngine.DumpAllToFile(fp))
@ -99,8 +99,9 @@ func TestDump(t *testing.T) {
assert.NoError(t, sess.Commit()) assert.NoError(t, sess.Commit())
for _, tp := range []schemas.DBType{schemas.SQLITE, schemas.MYSQL, schemas.POSTGRES, schemas.MSSQL} { for _, tp := range []schemas.DBType{schemas.SQLITE, schemas.MYSQL, schemas.POSTGRES, schemas.MSSQL} {
t.Run(fmt.Sprintf("dump_%v", tp), func(t *testing.T) { name := fmt.Sprintf("dump_%v.sql", tp)
assert.NoError(t, testEngine.DumpAllToFile(fp, tp)) t.Run(name, func(t *testing.T) {
assert.NoError(t, testEngine.DumpAllToFile(name, tp))
}) })
} }
} }