mirror of
https://github.com/astaxie/beego.git
synced 2024-11-25 19:00:55 +00:00
update go test
This commit is contained in:
parent
a134cb8d17
commit
dc70e9fc47
@ -1973,40 +1973,10 @@ func TestUpdate(t *testing.T) {
|
|||||||
throwFail(t, err)
|
throwFail(t, err)
|
||||||
throwFail(t, AssertIs(num, 1))
|
throwFail(t, AssertIs(num, 1))
|
||||||
|
|
||||||
num, err = qs.Filter("user_name", "slene").Update(Params{
|
|
||||||
"Nums": ColValue(ColBitAnd, 1),
|
|
||||||
})
|
|
||||||
throwFail(t, err)
|
|
||||||
throwFail(t, AssertIs(num, 1))
|
|
||||||
|
|
||||||
num, err = qs.Filter("user_name", "slene").Update(Params{
|
|
||||||
"Nums": ColValue(ColBitRShift, 1),
|
|
||||||
})
|
|
||||||
throwFail(t, err)
|
|
||||||
throwFail(t, AssertIs(num, 0))
|
|
||||||
|
|
||||||
num, err = qs.Filter("user_name", "slene").Update(Params{
|
|
||||||
"Nums": ColValue(ColBitLShift, 1),
|
|
||||||
})
|
|
||||||
throwFail(t, err)
|
|
||||||
throwFail(t, AssertIs(num, 0))
|
|
||||||
|
|
||||||
num, err = qs.Filter("user_name", "slene").Update(Params{
|
|
||||||
"Nums": ColValue(ColBitXOR, 1),
|
|
||||||
})
|
|
||||||
throwFail(t, err)
|
|
||||||
throwFail(t, AssertIs(num, 1))
|
|
||||||
|
|
||||||
num, err = qs.Filter("user_name", "slene").Update(Params{
|
|
||||||
"Nums": ColValue(ColBitOr, 1),
|
|
||||||
})
|
|
||||||
throwFail(t, err)
|
|
||||||
throwFail(t, AssertIs(num, 0))
|
|
||||||
|
|
||||||
user := User{UserName: "slene"}
|
user := User{UserName: "slene"}
|
||||||
err = dORM.Read(&user, "UserName")
|
err = dORM.Read(&user, "UserName")
|
||||||
throwFail(t, err)
|
throwFail(t, err)
|
||||||
throwFail(t, AssertIs(user.Nums, 1))
|
throwFail(t, AssertIs(user.Nums, 30))
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestDelete(t *testing.T) {
|
func TestDelete(t *testing.T) {
|
||||||
|
Loading…
Reference in New Issue
Block a user