diff --git a/tests/embedded_struct_test.go b/tests/embedded_struct_test.go index 4314f88c..69031b89 100644 --- a/tests/embedded_struct_test.go +++ b/tests/embedded_struct_test.go @@ -241,7 +241,9 @@ func TestEmbeddedRelations(t *testing.T) { Advanced bool } - DB.Migrator().DropTable(&AdvancedUser{}) + if err := DB.Migrator().DropTable(&AdvancedUser{}); err != nil { + t.Fatal(err) + } if err := DB.AutoMigrate(&AdvancedUser{}); err != nil { if DB.Dialector.Name() != "sqlite" { diff --git a/tests/upsert_test.go b/tests/upsert_test.go index 389d013a..e656e722 100644 --- a/tests/upsert_test.go +++ b/tests/upsert_test.go @@ -62,7 +62,7 @@ func TestUpsert(t *testing.T) { } r := DB.Session(&gorm.Session{DryRun: true}).Clauses(clause.OnConflict{UpdateAll: true}).Create(&RestrictedLanguage{Code: "upsert_code", Name: "upsert_name", Lang: "upsert_lang"}) - if !regexp.MustCompile(`INTO .restricted_languages. .*\(.code.,.name.,.lang.\) .* (SET|UPDATE) .name. = .*.name.\W*$`).MatchString(r.Statement.SQL.String()) { + if !regexp.MustCompile(`INTO .restricted_languages. .*\(.code.,.name.,.lang.\) .* (SET|UPDATE) .name.*=.*.name.\W*$`).MatchString(r.Statement.SQL.String()) { t.Errorf("Table with escape character, got %v", r.Statement.SQL.String()) } }