- Sort Score
- Result 10 results
- Languages All
Results 1 - 10 of 15 for DeepEqual (0.21 sec)
-
tests/scanner_valuer_test.go
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Wed Jun 07 07:02:07 GMT 2023 - 10.6K bytes - Viewed (0) -
utils/utils.go
} func Contains(elems []string, elem string) bool { for _, e := range elems { if elem == e { return true } } return false } func AssertEqual(x, y interface{}) bool { if reflect.DeepEqual(x, y) { return true } if x == nil || y == nil { return false } xval := reflect.ValueOf(x) yval := reflect.ValueOf(y) if xval.Kind() == reflect.Ptr && xval.IsNil() ||
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Apr 22 06:43:02 GMT 2024 - 3.8K bytes - Viewed (0) -
tests/scan_test.go
} results = append(results, result) } sort.Slice(results, func(i, j int) bool { return strings.Compare(results[i].Name, results[j].Name) <= -1 }) if !reflect.DeepEqual(results, []Result{{Name: "ScanRowsUser2", Age: 10}, {Name: "ScanRowsUser3", Age: 20}}) { t.Errorf("Should find expected results") } var ages int
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Sat May 28 14:18:07 GMT 2022 - 8.2K bytes - Viewed (0) -
tests/hooks_test.go
DB.AutoMigrate(&Product{}) p := Product{Code: "unique_code", Price: 100} DB.Save(&p) if !reflect.DeepEqual(p.GetCallTimes(), []int64{1, 1, 0, 1, 1, 0, 0, 0, 0}) { t.Fatalf("Callbacks should be invoked successfully, %v", p.GetCallTimes()) } DB.Where("Code = ?", "unique_code").First(&p) if !reflect.DeepEqual(p.GetCallTimes(), []int64{1, 1, 0, 1, 0, 0, 0, 0, 1}) {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Sat Feb 18 01:20:29 GMT 2023 - 15.9K bytes - Viewed (0) -
callbacks/create_test.go
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Mon Mar 18 05:48:42 GMT 2024 - 1.4K bytes - Viewed (0) -
statement_test.go
s1 := s.clone() s1.AddClause(clause.Where{ Exprs: s.BuildCondition("FINAL1"), }) s2 := s.clone() s2.AddClause(clause.Where{ Exprs: s.BuildCondition("FINAL2"), }) if reflect.DeepEqual(s1.Clauses["WHERE"], s2.Clauses["WHERE"]) { t.Errorf("Where conditions should be different") } }) } } func TestNilCondition(t *testing.T) { s := new(Statement)
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Sat Dec 23 13:19:41 GMT 2023 - 1.9K bytes - Viewed (0) -
tests/callbacks_test.go
} func TestCallbacksGet(t *testing.T) { db, _ := gorm.Open(nil, nil) createCallback := db.Callback().Create() createCallback.Before("*").Register("c1", c1) if cb := createCallback.Get("c1"); reflect.DeepEqual(cb, c1) { t.Errorf("callbacks tests failed, got: %p, want: %p", cb, c1) } createCallback.Remove("c1") if cb := createCallback.Get("c2"); cb != nil { t.Errorf("callbacks test failed. got: %p, want: nil", cb)
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Tue Mar 26 03:33:36 GMT 2024 - 7.2K bytes - Viewed (0) -
tests/multi_primary_keys_test.go
var tagContents []string for _, tag := range tags { tagContents = append(tagContents, tag.Value) } sort.Strings(tagContents) sort.Strings(contents) return reflect.DeepEqual(tagContents, contents) } func TestManyToManyWithMultiPrimaryKeys(t *testing.T) { if name := DB.Dialector.Name(); name == "sqlite" || name == "sqlserver" {
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Thu Jan 06 07:02:53 GMT 2022 - 12.8K bytes - Viewed (0) -
callbacks/helper_test.go
Values: [][]interface{}{{true}}, }, }, } for _, tc := range testCase { t.Run(tc.name, func(t *testing.T) { actual := ConvertMapToValuesForCreate(&gorm.Statement{}, tc.input) if !reflect.DeepEqual(actual, tc.expect) { t.Errorf("expect %v got %v", tc.expect, actual) } }) } } func TestConvertSliceOfMapToValuesForCreate(t *testing.T) { testCase := []struct { name string
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Tue Mar 05 02:22:57 GMT 2024 - 3.4K bytes - Viewed (0) -
tests/preload_suits_test.go
} if len(got) != 2 { t.Errorf("got %v items, expected 2", len(got)) } if !reflect.DeepEqual(got[0], want) && !reflect.DeepEqual(got[1], want) { t.Fatalf("got %s; want array containing %s", toJSONString(got), toJSONString(want)) } if !reflect.DeepEqual(got[0], want2) && !reflect.DeepEqual(got[1], want2) { t.Errorf("got %s; want array containing %s", toJSONString(got), toJSONString(want2)) } }
Go - Registered: Sun Apr 28 09:35:09 GMT 2024 - Last Modified: Fri Mar 18 05:38:46 GMT 2022 - 30.3K bytes - Viewed (0)