mirror of https://github.com/go-gorm/gorm.git
Fix HasTable tests
This commit is contained in:
parent
471eda5a12
commit
e9ecf9c1aa
|
@ -134,13 +134,13 @@ func TestHasTable(t *testing.T) {
|
||||||
Stuff string
|
Stuff string
|
||||||
}
|
}
|
||||||
DB.DropTable(&Foo{})
|
DB.DropTable(&Foo{})
|
||||||
if table_ok := DB.HasTable(&Foo{}); table_ok {
|
if ok := DB.HasTable(&Foo{}); ok {
|
||||||
t.Errorf("Table should not exist, but does")
|
t.Errorf("Table should not exist, but does")
|
||||||
}
|
}
|
||||||
if err := DB.CreateTable(&Foo{}).Error; err != nil {
|
if err := DB.CreateTable(&Foo{}).Error; err != nil {
|
||||||
t.Errorf("Table should be created")
|
t.Errorf("Table should be created")
|
||||||
}
|
}
|
||||||
if table_ok := DB.HasTable(&Foo{}); !table_ok {
|
if ok := DB.HasTable(&Foo{}); !ok {
|
||||||
t.Errorf("Table should exist, but HasTable informs it does not")
|
t.Errorf("Table should exist, but HasTable informs it does not")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue