- Sort Score
- Result 10 results
- Languages All
Results 11 - 20 of 30 for AssertEqual (0.07 sec)
-
utils/utils_test.go
{"driver.Valuer equal (ptr to nil ptr)", (*ModifyAt)(nil), &ModifyAt{}, false}, } for _, test := range assertEqualTests { t.Run(test.name, func(t *testing.T) { if out := AssertEqual(test.src, test.dst); test.out != out { t.Errorf("AssertEqual(%v, %v) want: %t, got: %t", test.src, test.dst, test.out, out) } }) } } func TestToString(t *testing.T) { tests := []struct { name string
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Aug 22 11:03:42 UTC 2024 - 4.9K bytes - Viewed (0) -
tests/prepared_stmt_test.go
tx.First(&result) wg.Done() }() } wg.Wait() conn, ok := tx.ConnPool.(*gorm.PreparedStmtDB) AssertEqual(t, ok, true) AssertEqual(t, len(conn.Stmts), 2) for _, stmt := range conn.Stmts { if stmt == nil { t.Fatalf("stmt cannot bee nil") } } AssertEqual(t, sqlDB.Stats().InUse, 0) } func TestPreparedStmtInTransaction(t *testing.T) { user := User{Name: "jinzhu"}
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Aug 22 11:02:05 UTC 2024 - 8.5K bytes - Viewed (0) -
tests/upsert_test.go
} else { AssertEqual(t, result, lang) } lang.Name += "_new" if err := DB.Save(&lang).Error; err != nil { t.Errorf("Failed to create, got error %v", err) } var result2 Language if err := DB.First(&result2, "code = ?", lang.Code).Error; err != nil { t.Errorf("Failed to query lang, got error %v", err) } else { AssertEqual(t, result2, lang) } }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Sep 05 07:39:19 UTC 2022 - 11.4K bytes - Viewed (0) -
tests/distinct_test.go
var names []string DB.Table("users").Where("name like ?", "distinct%").Order("name").Pluck("name", &names) AssertEqual(t, names, []string{"distinct", "distinct", "distinct", "distinct-2", "distinct-3"}) var names1 []string DB.Model(&User{}).Where("name like ?", "distinct%").Distinct().Order("name").Pluck("Name", &names1) AssertEqual(t, names1, []string{"distinct", "distinct-2", "distinct-3"}) var names2 []string
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Jan 06 07:02:53 UTC 2022 - 2.5K bytes - Viewed (0) -
tests/count_test.go
} expects := []User{{Name: "main"}, {Name: "other"}, {Name: "other"}} sort.SliceStable(users, func(i, j int) bool { return strings.Compare(users[i].Name, users[j].Name) < 0 }) AssertEqual(t, users, expects) var count7 int64 if err := DB.Model(&User{}).Where("name in ?", []string{user1.Name, user2.Name, user3.Name}).Select( "(CASE WHEN name=? THEN ? ELSE ? END) as name, age", "count-1", "main", "other",
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Oct 30 09:15:49 UTC 2023 - 6.9K bytes - Viewed (0) -
tests/update_has_one_test.go
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Thu Jul 14 06:55:54 UTC 2022 - 3.6K bytes - Viewed (0) -
tests/associations_belongs_to_test.go
tx.Config.DisableForeignKeyConstraintWhenMigrating = true AssertEqual(t, DB.Config.DisableForeignKeyConstraintWhenMigrating, false) tx.Migrator().DropTable(&BelongsToUser{}, &Org{}) tx.AutoMigrate(&BelongsToUser{}, &Org{}) user := &BelongsToUser{ Org: Org{ ID: "BelongsToUser_Org_1", }, } err := DB.Create(&user).Error AssertEqual(t, err, nil) }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Oct 30 09:15:49 UTC 2023 - 9.3K bytes - Viewed (0) -
tests/embedded_struct_test.go
Name string } DB.Migrator().DropTable(&EmbeddedTag{}) err := DB.Migrator().AutoMigrate(&EmbeddedTag{}) AssertEqual(t, err, nil) t1 := EmbeddedTag{Name: "embedded_tag"} err = DB.Save(&t1).Error AssertEqual(t, err, nil) if t1.Tag1.Id == 0 { t.Errorf("embedded struct's primary field should be rewritten") }
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Wed May 08 04:07:58 UTC 2024 - 7.3K bytes - Viewed (0) -
tensorflow/c/c_api_function_test.cc
ASSERT_EQ(TF_OK, TF_GetCode(s_)) << TF_Message(s_); if (GetName(funcs[0]) == GetName(func0)) { AssertEqual(func0, funcs[0]); AssertEqual(func1, funcs[1]); } else { AssertEqual(func0, funcs[1]); AssertEqual(func1, funcs[0]); } TF_DeleteFunction(funcs[0]); TF_DeleteFunction(funcs[1]); TF_DeleteFunction(func0);
Registered: Tue Nov 05 12:39:12 UTC 2024 - Last Modified: Thu Jul 20 22:08:54 UTC 2023 - 63.6K bytes - Viewed (0) -
tests/update_test.go
} var result Language DB.First(&result, "code = ?", "save") AssertEqual(t, result, lang) lang.Name = "save name2" if result := DB.Save(&lang); result.RowsAffected != 1 { t.Errorf("should update language") } var result2 Language DB.First(&result2, "code = ?", "save") AssertEqual(t, result2, lang) DB.Table("langs").Migrator().DropTable(&Language{})
Registered: Sun Nov 03 09:35:10 UTC 2024 - Last Modified: Mon Dec 04 03:50:58 UTC 2023 - 30.3K bytes - Viewed (0)