Browse Source

Fix dump test (#1625)

Fix dump test

Reviewed-on: #1625
tags/v1.0.1
Lunny Xiao 1 week ago
parent
commit
6132eea08c
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      engine_test.go

+ 4
- 3
engine_test.go View File

@@ -85,7 +85,7 @@ func TestDump(t *testing.T) {
{Name: "5'\n"},
})

fp := testEngine.Dialect().URI().DBName + ".sql"
fp := fmt.Sprintf("%v.sql", testEngine.Dialect().URI().DBType)
os.Remove(fp)
assert.NoError(t, testEngine.DumpAllToFile(fp))

@@ -99,8 +99,9 @@ func TestDump(t *testing.T) {
assert.NoError(t, sess.Commit())

for _, tp := range []schemas.DBType{schemas.SQLITE, schemas.MYSQL, schemas.POSTGRES, schemas.MSSQL} {
t.Run(fmt.Sprintf("dump_%v", tp), func(t *testing.T) {
assert.NoError(t, testEngine.DumpAllToFile(fp, tp))
name := fmt.Sprintf("dump_%v.sql", tp)
t.Run(name, func(t *testing.T) {
assert.NoError(t, testEngine.DumpAllToFile(name, tp))
})
}
}


Loading…
Cancel
Save