Skip to content

Commit 1bfe314

Browse files
committed
fix NotConditions related tests
1 parent 1cf491c commit 1bfe314

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tests/query_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ func TestNot(t *testing.T) {
551551
}
552552

553553
result = dryDB.Not(User{Name: "jinzhu", Age: 18}).First(&User{})
554-
if !regexp.MustCompile("SELECT \\* FROM .*users.* WHERE .*users.*..*name.* <> .+ AND .*users.*..*age.* <> .+").MatchString(result.Statement.SQL.String()) {
554+
if !regexp.MustCompile("SELECT \\* FROM .*users.* WHERE .*users.*..*name.* <> .+ OR .*users.*..*age.* <> .+").MatchString(result.Statement.SQL.String()) {
555555
t.Fatalf("Build NOT condition, but got %v", result.Statement.SQL.String())
556556
}
557557

@@ -608,7 +608,7 @@ func TestNotWithAllFields(t *testing.T) {
608608
}
609609

610610
result = dryDB.Not(User{Name: "jinzhu", Age: 18}).First(&User{})
611-
if !regexp.MustCompile(userQuery + "WHERE .*users.*..*name.* <> .+ AND .*users.*..*age.* <> .+").MatchString(result.Statement.SQL.String()) {
611+
if !regexp.MustCompile(userQuery + "WHERE .*users.*..*name.* <> .+ OR .*users.*..*age.* <> .+").MatchString(result.Statement.SQL.String()) {
612612
t.Fatalf("Build NOT condition, but got %v", result.Statement.SQL.String())
613613
}
614614
}

0 commit comments

Comments
 (0)