Add test to confirm #1247 resolved (#1951)

Reviewed-on: https://gitea.com/xorm/xorm/pulls/1951
Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
Co-committed-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
Lunny Xiao 2021-06-12 20:35:22 +08:00
parent 00ee06fdd5
commit e1422f183c
1 changed files with 5 additions and 0 deletions

View File

@ -472,6 +472,11 @@ func TestUpdateIncrDecr(t *testing.T) {
cnt, err = testEngine.ID(col1.Id).Cols(colName).Incr(colName).Update(col1) cnt, err = testEngine.ID(col1.Id).Cols(colName).Incr(colName).Update(col1)
assert.NoError(t, err) assert.NoError(t, err)
assert.EqualValues(t, 1, cnt) assert.EqualValues(t, 1, cnt)
testEngine.SetColumnMapper(testEngine.GetColumnMapper())
cnt, err = testEngine.Cols(colName).Decr(colName, 2).ID(col1.Id).Update(new(UpdateIncr))
assert.NoError(t, err)
assert.EqualValues(t, 1, cnt)
} }
type UpdatedUpdate struct { type UpdatedUpdate struct {