From 5557d0b06b88d6d7dd6735ee81f2041abd9a5c3e Mon Sep 17 00:00:00 2001 From: hishope Date: Thu, 7 Mar 2024 14:18:31 +0800 Subject: [PATCH] fix some typos in tests Signed-off-by: hishope --- tests/create_test.go | 22 +++++++++++----------- tests/migrate_test.go | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/tests/create_test.go b/tests/create_test.go index d9b54b7f6e..acb4b8b132 100644 --- a/tests/create_test.go +++ b/tests/create_test.go @@ -582,7 +582,7 @@ func TestCreateWithAutoIncrementCompositeKey(t *testing.T) { } func TestCreateOnConflictWithDefaultNull(t *testing.T) { - type OnConfilctUser struct { + type OnConflictUser struct { ID string Name string `gorm:"default:null"` Email string @@ -594,17 +594,17 @@ func TestCreateOnConflictWithDefaultNull(t *testing.T) { err = DB.AutoMigrate(&OnConfilctUser{}) AssertEqual(t, err, nil) - u := OnConfilctUser{ - ID: "on-confilct-user-id", - Name: "on-confilct-user-name", - Email: "on-confilct-user-email", - Mobile: "on-confilct-user-mobile", + u := OnConflictUser{ + ID: "on-conflict-user-id", + Name: "on-conflict-user-name", + Email: "on-conflict-user-email", + Mobile: "on-conflict-user-mobile", } err = DB.Create(&u).Error AssertEqual(t, err, nil) - u.Name = "on-confilct-user-name-2" - u.Email = "on-confilct-user-email-2" + u.Name = "on-conflict-user-name-2" + u.Email = "on-conflict-user-email-2" u.Mobile = "" err = DB.Clauses(clause.OnConflict{UpdateAll: true}).Create(&u).Error AssertEqual(t, err, nil) @@ -612,14 +612,14 @@ func TestCreateOnConflictWithDefaultNull(t *testing.T) { var u2 OnConfilctUser err = DB.Where("id = ?", u.ID).First(&u2).Error AssertEqual(t, err, nil) - AssertEqual(t, u2.Name, "on-confilct-user-name-2") - AssertEqual(t, u2.Email, "on-confilct-user-email-2") + AssertEqual(t, u2.Name, "on-conflict-user-name-2") + AssertEqual(t, u2.Email, "on-conflict-user-email-2") AssertEqual(t, u2.Mobile, "133xxxx") } func TestCreateFromMapWithoutPK(t *testing.T) { if !isMysql() { - t.Skipf("This test case skipped, because of only supportting for mysql") + t.Skipf("This test case skipped, because of only supporting for mysql") } // case 1: one record, create from map[string]interface{} diff --git a/tests/migrate_test.go b/tests/migrate_test.go index 837d92c1b4..b25b9da64a 100644 --- a/tests/migrate_test.go +++ b/tests/migrate_test.go @@ -1413,10 +1413,10 @@ func TestMigrateSameEmbeddedFieldName(t *testing.T) { err = DB.Table("game_users").AutoMigrate(&GameUser1{}) AssertEqual(t, nil, err) - _, err = findColumnType(&GameUser{}, "stat_ab_ground_destory_count") + _, err = findColumnType(&GameUser{}, "stat_ab_ground_destroy_count") AssertEqual(t, nil, err) - _, err = findColumnType(&GameUser{}, "rate_ground_rb_ground_destory_count") + _, err = findColumnType(&GameUser{}, "rate_ground_rb_ground_destroy_count") AssertEqual(t, nil, err) }