* fix: typo

* fix: covered
This commit is contained in:
hakusai22 2024-05-08 12:07:58 +08:00 committed by GitHub
parent 9d370bcb3e
commit 5e599a07ec
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 6 additions and 6 deletions

View File

@ -244,7 +244,7 @@ func Scan(rows Rows, db *DB, mode ScanMode) {
rel = rel.FieldSchema.Relationships.Relations[name]
relFields = append(relFields, rel.Field)
}
// lastest name is raw dbname
// latest name is raw dbname
dbName := names[subNameCount-1]
if field := rel.FieldSchema.LookUpField(dbName); field != nil && field.Readable {
fields[idx] = field

View File

@ -279,6 +279,6 @@ func TestEmbeddedTagSetting(t *testing.T) {
err = DB.Save(&t1).Error
AssertEqual(t, err, nil)
if t1.Tag1.Id == 0 {
t.Errorf("embedded struct's primary field should be rewrited")
t.Errorf("embedded struct's primary field should be rewritten")
}
}

View File

@ -37,7 +37,7 @@ func TestNonStdPrimaryKeyAndDefaultValues(t *testing.T) {
}
animal = Animal{From: "somewhere"} // No name fields, should be filled with the default value (galeone)
DB.Save(&animal).Update("From", "a nice place") // The name field shoul be untouched
DB.Save(&animal).Update("From", "a nice place") // The name field should be untouched
DB.First(&animal, animal.Counter)
if animal.Name != "galeone" {
t.Errorf("Name fields shouldn't be changed if untouched, but got %v", animal.Name)

View File

@ -1337,7 +1337,7 @@ func TestQueryResetNullValue(t *testing.T) {
Number1 int64 `gorm:"default:NULL"`
Number2 uint64 `gorm:"default:NULL"`
Number3 float64 `gorm:"default:NULL"`
Now *time.Time `gorm:"defalut:NULL"`
Now *time.Time `gorm:"default:NULL"`
Item1Id string
Item1 *QueryResetItem `gorm:"references:ID"`
Item2Id string
@ -1427,7 +1427,7 @@ func TestQueryScanToArray(t *testing.T) {
t.Fatal(err)
}
if users[0] == nil || users[0].Name != "testname1" {
t.Error("users[0] not covere")
t.Error("users[0] not covered")
}
if users[1] != nil {
t.Error("users[1] should be empty")

View File

@ -67,7 +67,7 @@ func TestTransaction(t *testing.T) {
return tx5.First(&User{}, "name = ?", "transaction-2").Error
})
}); err != nil {
t.Fatalf("prepare statement and nested transcation coexist" + err.Error())
t.Fatalf("prepare statement and nested transaction coexist" + err.Error())
}
})
}