- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 13 for AssertObjEqual (0.07 sec)
-
tests/helper_test.go
t.Fatalf("errors happened when query: %v", err) } else { AssertObjEqual(t, newPet, pet, "ID", "CreatedAt", "UpdatedAt", "DeletedAt", "UserID", "Name") AssertObjEqual(t, newPet, expect, "ID", "CreatedAt", "UpdatedAt", "DeletedAt", "UserID", "Name") } } AssertObjEqual(t, pet, expect, "ID", "CreatedAt", "UpdatedAt", "DeletedAt", "UserID", "Name")
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Tue Mar 19 03:50:28 UTC 2024 - 8K bytes - Viewed (0) -
schema/constraint_test.go
}, } for k, result := range results { v, ok := constraints[k] if !ok { t.Errorf("Failed to found unique constraint %v from parsed constraints %+v", k, constraints) } tests.AssertObjEqual(t, result, v, "Name") tests.AssertObjEqual(t, result.Field, v.Field, "Name", "Unique", "UniqueIndex") }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Sun Feb 04 07:49:19 UTC 2024 - 2.2K bytes - Viewed (0) -
tests/scanner_valuer_test.go
} if result.ExampleStruct.Val != "value1" { t.Errorf(`ExampleStruct.Val should equal to "value1", but got %#v`, result.ExampleStruct) } AssertObjEqual(t, data, result, "Name", "Gender", "Age", "Male", "Height", "Birthday", "Password", "Bytes", "Num", "Strings", "Structs") } func TestScannerValuerWithFirstOrCreate(t *testing.T) {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Jun 07 07:02:07 UTC 2023 - 10.6K bytes - Viewed (0) -
schema/index_test.go
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Sun Feb 04 07:49:19 UTC 2024 - 8K bytes - Viewed (0) -
tests/update_test.go
return result2.Toys[i].ID < result2.Toys[j].ID }) AssertObjEqual(t, result2, result, "Name", "Account", "Toys", "Manager", "ManagerID", "Languages") DB.Model(&result).Select("Name", "Age").Updates(User{Name: "update_with_select"}) if result.Age != 0 || result.Name != "update_with_select" { t.Fatalf("Failed to update struct with select, got %+v", result) } AssertObjEqual(t, result, user, "UpdatedAt") var result3 User
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Dec 04 03:50:58 UTC 2023 - 30.3K bytes - Viewed (0) -
schema/schema_helper_test.go
"gorm.io/gorm/schema" "gorm.io/gorm/utils/tests" ) func checkSchema(t *testing.T, s *schema.Schema, v schema.Schema, primaryFields []string) { t.Run("CheckSchema/"+s.Name, func(t *testing.T) { tests.AssertObjEqual(t, s, v, "Name", "Table") for idx, field := range primaryFields { var found bool for _, f := range s.PrimaryFields { if f.Name == field { found = true } } if idx == 0 {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Dec 15 08:31:23 UTC 2023 - 7.5K bytes - Viewed (0) -
tests/associations_test.go
parent.FavChildID = child.ID parent.FavChild = &child DB.Save(&parent) var parent1 Parent DB.First(&parent1, parent.ID) AssertObjEqual(t, parent, parent1, "ID", "FavChildID") // Save and Updates is the same DB.Updates(&parent) DB.First(&parent1, parent.ID) AssertObjEqual(t, parent, parent1, "ID", "FavChildID") } func TestSaveHasManyCircularReference(t *testing.T) { parent := Parent{}
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed Feb 08 08:29:09 UTC 2023 - 10.9K bytes - Viewed (0) -
tests/distinct_test.go
{Name: "distinct-3", Age: 18}, } if len(results) != 4 { t.Fatalf("invalid results length found, expects: %v, got %v", len(expects), len(results)) } for idx, expect := range expects { AssertObjEqual(t, results[idx], expect, "Name", "Age") } var count int64 if err := DB.Model(&User{}).Where("name like ?", "distinct%").Count(&count).Error; err != nil || count != 5 {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Jan 06 07:02:53 UTC 2022 - 2.5K bytes - Viewed (0) -
utils/tests/utils.go
package tests import ( "database/sql/driver" "fmt" "go/ast" "reflect" "testing" "time" "gorm.io/gorm/utils" ) func AssertObjEqual(t *testing.T, r, e interface{}, names ...string) { for _, name := range names { rv := reflect.Indirect(reflect.ValueOf(r)) ev := reflect.Indirect(reflect.ValueOf(e)) if rv.IsValid() != ev.IsValid() { t.Errorf("%v: expect: %+v, got %+v", utils.FileWithLineNum(), r, e) return
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Mar 10 09:21:56 UTC 2023 - 3.9K bytes - Viewed (0) -
tests/customize_field_test.go
FieldIgnore: name + "_allow_ignore", } } create := generateStruct("create") DB.Create(&create) var result CustomizeFieldStruct DB.Find(&result, "name = ?", "create") AssertObjEqual(t, result, create, "Name", "FieldAllowCreate", "FieldAllowSave", "FieldAllowSave2") if result.FieldAllowUpdate != "" || result.FieldReadonly != "" || result.FieldIgnore != "" || result.FieldAllowSave3 != "" {
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Fri Sep 11 09:33:31 UTC 2020 - 6.9K bytes - Viewed (0)