From a7b672ebbfeb94933d902763083edcfd35e45525 Mon Sep 17 00:00:00 2001 From: jseljan Date: Wed, 24 Jun 2020 15:16:21 +0200 Subject: [PATCH] Add TCK tests relating predicate functions Summary: Implement TCK regression-like tests relating 'any', 'all', and 'none' predicate functions Reviewers: mferencevic Reviewed By: mferencevic Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D2791 --- .../memgraph_V1/features/functions.feature | 53 ++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/tests/qa/tests/memgraph_V1/features/functions.feature b/tests/qa/tests/memgraph_V1/features/functions.feature index d2f0029f8..6df7e2e0c 100644 --- a/tests/qa/tests/memgraph_V1/features/functions.feature +++ b/tests/qa/tests/memgraph_V1/features/functions.feature @@ -956,7 +956,7 @@ Feature: Functions | a | | null | - Scenario: None test 08: + Scenario: None test 08: When executing query: """ RETURN none(x IN ["a", "b", "c"] WHERE x = Null) AS a @@ -965,6 +965,57 @@ Feature: Functions | a | | null | + Scenario: PredicateFunctions test 01: + When executing query: + """ + WITH [1, 2, 3] as lst + RETURN ALL(x IN lst WHERE x > 0) as all, + SINGLE(x IN lst WHERE x > 0) AS single, + ANY(x IN lst WHERE x > 0) AS any, + NONE(x IN lst WHERE x > 0) AS none + """ + Then the result should be: + | all | single | any | none | + | true | false | true | false | + + Scenario: PredicateFunctions test 02: + When executing query: + """ + WITH [1, 2, 3] as lst + RETURN ALL(x IN lst WHERE x > 1) as all, + SINGLE(x IN lst WHERE x > 1) AS single, + ANY(x IN lst WHERE x > 1) AS any, + NONE(x IN lst WHERE x > 1) AS none + """ + Then the result should be: + | all | single | any | none | + | false | false | true | false | + + Scenario: PredicateFunctions test 03: + When executing query: + """ + WITH [1, 2, 3] as lst + RETURN ALL(x IN lst WHERE x > 2) as all, + SINGLE(x IN lst WHERE x > 2) AS single, + ANY(x IN lst WHERE x > 2) AS any, + NONE(x IN lst WHERE x > 2) AS none + """ + Then the result should be: + | all | single | any | none | + | false | true | true | false | + + Scenario: PredicateFunctions test 04: + When executing query: + """ + WITH [1, 2, 3] as lst + RETURN ALL(x IN lst WHERE x > 3) as all, + SINGLE(x IN lst WHERE x > 3) AS single, + ANY(x IN lst WHERE x > 3) AS any, + NONE(x IN lst WHERE x > 3) AS none + """ + Then the result should be: + | all | single | any | none | + | false | false | false | true | Scenario: Reduce test 01: When executing query: