1
0
mirror of https://github.com/astaxie/beego.git synced 2024-11-22 21:10:55 +00:00

fix test case that calls All()

Signed-off-by: Penghui Liao <liaoishere@gmail.com>
This commit is contained in:
Penghui Liao 2018-07-20 16:51:36 +08:00
parent 1a3f1d66c1
commit 30bbc81a2e

View File

@ -1011,13 +1011,13 @@ func TestAll(t *testing.T) {
qs = dORM.QueryTable("user") qs = dORM.QueryTable("user")
num, err = qs.Filter("user_name", "nothing").All(&users) num, err = qs.Filter("user_name", "nothing").All(&users)
throwFailNow(t, err) throwFail(t, AssertIs(err, ErrNoRows))
throwFailNow(t, AssertIs(num, 0)) throwFailNow(t, AssertIs(num, 0))
var users3 []*User var users3 []*User
qs = dORM.QueryTable("user") qs = dORM.QueryTable("user")
num, err = qs.Filter("user_name", "nothing").All(&users3) num, err = qs.Filter("user_name", "nothing").All(&users3)
throwFailNow(t, err) throwFail(t, AssertIs(err, ErrNoRows))
throwFailNow(t, AssertIs(num, 0)) throwFailNow(t, AssertIs(num, 0))
throwFailNow(t, AssertIs(users3 == nil, false)) throwFailNow(t, AssertIs(users3 == nil, false))
} }