Skip to content

Commit 2e03a84

Browse files
authored
Merge pull request #14 from trheyi/main
test: Enhance assertions for temporary table creation in table_test.go
2 parents 72164f8 + 09c3f0f commit 2e03a84

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

dbal/schema/table_test.go

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,18 @@ func TestTableCreateTemporary(t *testing.T) {
4444

4545
has, err := builder.HasTable("table_test_table_temp")
4646
assert.Nil(t, err, "the table should be created")
47-
assert.True(t, has, "the table should be created")
4847

49-
// Driver is mysql
50-
if unit.DriverIs("mysql") {
51-
_, err := builder.GetTable("table_test_table_temp")
48+
// Get the table on mysql or sqlite3, PostgreSQL not supported, currently
49+
if unit.DriverIs("mysql") || unit.DriverIs("sqlite3") {
50+
table, err := builder.GetTable("table_test_table_temp")
5251
assert.Nil(t, err, "the table should be created")
52+
assert.Equal(t, "table_test_table_temp", table.GetName(), "the table name should be table_test_table_temp")
53+
}
54+
55+
// Driver is mysql or sqlite3, PostgreSQL will return false
56+
// fully supported in the future
57+
if unit.DriverIs("mysql") || unit.DriverIs("sqlite3") {
58+
assert.True(t, has, "the table should be created")
5359
}
5460

5561
// Use temporary table

0 commit comments

Comments
 (0)