Skip to content

Commit

Permalink
skip strictexact operator test for db drivers other than mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
CadenGuo committed Aug 31, 2020
1 parent 60bb057 commit ff53e12
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions orm/orm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -822,13 +822,16 @@ func TestOperators(t *testing.T) {
throwFail(t, err)
throwFail(t, AssertIs(num, 1))

num, err = qs.Filter("user_name__strictexact", "Slene").Count()
throwFail(t, err)
throwFail(t, AssertIs(num, 0))
if dORM.Driver().Name() == "mysql" {
// Now only mysql support `strictexact`
num, err = qs.Filter("user_name__strictexact", "Slene").Count()
throwFail(t, err)
throwFail(t, AssertIs(num, 0))

num, err = qs.Filter("user_name__strictexact", "slene").Count()
throwFail(t, err)
throwFail(t, AssertIs(num, 1))
num, err = qs.Filter("user_name__strictexact", "slene").Count()
throwFail(t, err)
throwFail(t, AssertIs(num, 1))
}

num, err = qs.Filter("user_name__contains", "e").Count()
throwFail(t, err)
Expand Down

0 comments on commit ff53e12

Please sign in to comment.