Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typo "Upadte" -> "Update" #2906

Merged
merged 1 commit into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion contrib/drivers/mssql/mssql_z_basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ func Test_DB_Insert_KeyFieldNameMapping(t *testing.T) {
})
}

func Test_DB_Upadte_KeyFieldNameMapping(t *testing.T) {
func Test_DB_Update_KeyFieldNameMapping(t *testing.T) {
table := createInitTable()
defer dropTable(table)

Expand Down
2 changes: 1 addition & 1 deletion contrib/drivers/mysql/mysql_core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ func Test_DB_Insert_NilGjson(t *testing.T) {
})
}

func Test_DB_Upadte_KeyFieldNameMapping(t *testing.T) {
func Test_DB_Update_KeyFieldNameMapping(t *testing.T) {
table := createInitTable()
defer dropTable(table)

Expand Down
2 changes: 1 addition & 1 deletion contrib/drivers/sqlite/sqlite_core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func Test_DB_Insert_KeyFieldNameMapping(t *testing.T) {
})
}

func Test_DB_Upadte_KeyFieldNameMapping(t *testing.T) {
func Test_DB_Update_KeyFieldNameMapping(t *testing.T) {
table := createInitTable()
defer dropTable(table)

Expand Down
89 changes: 0 additions & 89 deletions contrib/drivers/sqlite/sqlite_model_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2787,34 +2787,6 @@ func Test_Model_Fields_Struct(t *testing.T) {
})
}

// func Test_Model_NullField(t *testing.T) {
// table := createTable()
// defer dropTable(table)

// gtest.C(t, func(t *gtest.T) {
// type User struct {
// Id int
// Passport *string
// }
// data := g.Map{
// "id": 1,
// "passport": nil,
// }
// result, err := db.Model(table).Data(data).Insert()
// t.AssertNil(err)
// n, _ := result.RowsAffected()
// t.Assert(n, 1)
// one, err := db.Model(table).WherePri(1).One()
// t.AssertNil(err)

// var user *User
// err = one.Struct(&user)
// t.AssertNil(err)
// t.Assert(user.Id, data["id"])
// t.Assert(user.Passport, data["passport"])
// })
// }

func Test_Model_Empty_Slice_Argument(t *testing.T) {
table := createInitTable()
defer dropTable(table)
Expand Down Expand Up @@ -3222,17 +3194,6 @@ func Test_Model_WhereNotNull(t *testing.T) {
})
}

// func Test_Model_WhereOrNull(t *testing.T) {
// table := createInitTable()
// defer dropTable(table)

// gtest.C(t, func(t *gtest.T) {
// result, err := db.Model(table).WhereOrNull("nickname").WhereOrNull("passport").OrderAsc("id").OrderRandom().All()
// t.AssertNil(err)
// t.Assert(len(result), 0)
// })
// }

func Test_Model_WhereOrNotNull(t *testing.T) {
table := createInitTable()
defer dropTable(table)
Expand Down Expand Up @@ -3950,56 +3911,6 @@ func Test_Model_WherePrefixLike(t *testing.T) {
})
}

// TODO
// https://github.com/gogf/gf/issues/1700
// func Test_Model_Issue1700(t *testing.T) {
// table := "user_" + gtime.Now().TimestampNanoStr()
// if _, err := db.Exec(ctx, fmt.Sprintf(`
// CREATE TABLE IF NOT EXISTS %s (
// id INTEGER PRIMARY KEY AUTOINCREMENT
// UNIQUE
// NOT NULL,
// user_id int(10) NOT NULL,
// UserId int(10) NOT NULL
// );
// `, table,
// )); err != nil {
// gtest.AssertNil(err)
// }
// defer dropTable(table)

// gtest.C(t, func(t *gtest.T) {
// type User struct {
// Id int `orm:"id"`
// Userid int `orm:"user_id"`
// UserId int `orm:"UserId"`
// }
// _, err := db.Model(table).Data(User{
// Id: 1,
// Userid: 2,
// UserId: 3,
// }).Insert()
// t.AssertNil(err)

// one, err := db.Model(table).One()
// t.AssertNil(err)
// t.Assert(one, g.Map{
// "id": 1,
// "user_id": 2,
// "UserId": 3,
// })

// for i := 0; i < 1000; i++ {
// var user *User
// err = db.Model(table).Scan(&user)
// t.AssertNil(err)
// t.Assert(user.Id, 1)
// t.Assert(user.Userid, 2)
// t.Assert(user.UserId, 3)
// }
// })
// }

// https://github.com/gogf/gf/issues/1159
func Test_ScanList_NoRecreate_PtrAttribute(t *testing.T) {
gtest.C(t, func(t *gtest.T) {
Expand Down
2 changes: 1 addition & 1 deletion contrib/drivers/sqlitecgo/sqlite_core_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func Test_DB_Insert_KeyFieldNameMapping(t *testing.T) {
})
}

func Test_DB_Upadte_KeyFieldNameMapping(t *testing.T) {
func Test_DB_Update_KeyFieldNameMapping(t *testing.T) {
table := createInitTable()
defer dropTable(table)

Expand Down
2 changes: 1 addition & 1 deletion util/gvalid/internal/builtin/builtin_enums.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (r RuleEnums) Run(in RunInput) error {
if tagEnums == "" {
return gerror.NewCodef(
gcode.CodeInvalidOperation,
`no enums found for type "%s"`,
`no enums found for type "%s", missing using command "gf gen enums"?`,
typeId,
)
}
Expand Down