From 1bfe3141f64564e9b72009174647bbcc7a22eb32 Mon Sep 17 00:00:00 2001 From: molon <3739161+molon@users.noreply.github.com> Date: Mon, 17 Feb 2025 00:02:34 +0800 Subject: [PATCH] fix NotConditions related tests --- tests/query_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/query_test.go b/tests/query_test.go index 566763c5..24510b78 100644 --- a/tests/query_test.go +++ b/tests/query_test.go @@ -551,7 +551,7 @@ func TestNot(t *testing.T) { } result = dryDB.Not(User{Name: "jinzhu", Age: 18}).First(&User{}) - if !regexp.MustCompile("SELECT \\* FROM .*users.* WHERE .*users.*..*name.* <> .+ AND .*users.*..*age.* <> .+").MatchString(result.Statement.SQL.String()) { + if !regexp.MustCompile("SELECT \\* FROM .*users.* WHERE .*users.*..*name.* <> .+ OR .*users.*..*age.* <> .+").MatchString(result.Statement.SQL.String()) { t.Fatalf("Build NOT condition, but got %v", result.Statement.SQL.String()) } @@ -608,7 +608,7 @@ func TestNotWithAllFields(t *testing.T) { } result = dryDB.Not(User{Name: "jinzhu", Age: 18}).First(&User{}) - if !regexp.MustCompile(userQuery + "WHERE .*users.*..*name.* <> .+ AND .*users.*..*age.* <> .+").MatchString(result.Statement.SQL.String()) { + if !regexp.MustCompile(userQuery + "WHERE .*users.*..*name.* <> .+ OR .*users.*..*age.* <> .+").MatchString(result.Statement.SQL.String()) { t.Fatalf("Build NOT condition, but got %v", result.Statement.SQL.String()) } }