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:
parent
00ee06fdd5
commit
e1422f183c
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue