diff --git a/internal/server/token.go b/internal/server/token.go index a02a884c..8d1afa1d 100644 --- a/internal/server/token.go +++ b/internal/server/token.go @@ -743,7 +743,7 @@ loop: } vsout = nvs case tokenNOT: - negate = true + negate = !negate needObj = true vsout = nvs case tokenAND: diff --git a/tests/testcmd_test.go b/tests/testcmd_test.go index 82d6a4c6..51c55da2 100644 --- a/tests/testcmd_test.go +++ b/tests/testcmd_test.go @@ -172,6 +172,10 @@ func testcmd_expression_test(mc *mockServer) error { {"SET", "mykey", "line3", "OBJECT", `{"type":"LineString","coordinates":[[-122.4408378,37.7341129],[-122.4408378,37.733]]}`}, {"OK"}, {"SET", "mykey", "poly8", "OBJECT", poly8}, {"OK"}, + {"TEST", "OBJECT", poly9, "INTERSECTS", "NOT", "OBJECT", poly}, {"0"}, + {"TEST", "OBJECT", poly9, "INTERSECTS", "NOT", "NOT", "OBJECT", poly}, {"1"}, + {"TEST", "OBJECT", poly9, "INTERSECTS", "NOT", "NOT", "NOT", "OBJECT", poly}, {"0"}, + {"TEST", "OBJECT", poly9, "INTERSECTS", "OBJECT", poly8, "OR", "OBJECT", poly}, {"1"}, {"TEST", "OBJECT", poly9, "INTERSECTS", "OBJECT", poly8, "AND", "OBJECT", poly}, {"1"}, {"TEST", "OBJECT", poly9, "INTERSECTS", "GET", "mykey", "poly8", "OR", "OBJECT", poly}, {"1"},