Skip to content

Commit

Permalink
add some tests for predicate expr
Browse files Browse the repository at this point in the history
  • Loading branch information
jievince committed Dec 15, 2022
1 parent c3866b3 commit cd257c0
Showing 1 changed file with 93 additions and 1 deletion.
94 changes: 93 additions & 1 deletion tests/tck/features/expression/Predicate.feature
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# This source code is licensed under Apache 2.0 License.
Feature: Predicate

Scenario: yield a predicate
Scenario: basic
Given a graph with space named "nba"
When executing query:
"""
Expand Down Expand Up @@ -33,6 +33,98 @@ Feature: Predicate
Then the result should be, in any order:
| r |
| True |
When executing query:
"""
YIELD ALL(n in null WHERE TRUE) AS a, ANY(n in null WHERE TRUE) AS b, SINGLE(n in null WHERE TRUE) AS c, NONE(n in null WHERE TRUE) AS d
"""
Then the result should be, in any order:
| a | b | c | d |
| NULL | NULL | NULL | NULL |
When executing query:
"""
WITH 1 AS a
RETURN ALL(a IN [2, 3] WHERE a > 1) AS r
"""
Then the result should be, in any order:
| r |
| True |
When executing query:
"""
RETURN ALL(a IN [2, 3] WHERE a > 2) AS r
"""
Then the result should be, in any order:
| r |
| False |
When executing query:
"""
RETURN Any(a IN [2, 3] WHERE a > 1) AS r
"""
Then the result should be, in any order:
| r |
| True |
When executing query:
"""
RETURN Any(a IN [2, 3] WHERE a > 3) AS r
"""
Then the result should be, in any order:
| r |
| False |
When executing query:
"""
RETURN Any(a IN [2, 3, NULL] WHERE a > 3) AS r
"""
Then the result should be, in any order:
| r |
| NULL |
When executing query:
"""
RETURN Single(a IN [2, 3] WHERE a > 4) AS r
"""
Then the result should be, in any order:
| r |
| False |
When executing query:
"""
RETURN Single(a IN [2, 3, 4] WHERE a >= 2) AS r
"""
Then the result should be, in any order:
| r |
| False |
When executing query:
"""
RETURN Single(a IN [2, 3, 4] WHERE a == 3) AS r
"""
Then the result should be, in any order:
| r |
| True |
When executing query:
"""
RETURN Single(a IN [2, 3, NULL] WHERE a == 3) AS r
"""
Then the result should be, in any order:
| r |
| NULL |
When executing query:
"""
RETURN None(a IN [2, 3, NULL] WHERE a > 1) AS r
"""
Then the result should be, in any order:
| r |
| False |
When executing query:
"""
RETURN None(a IN [2, 3, 4] WHERE a > 100) AS r
"""
Then the result should be, in any order:
| r |
| True |
When executing query:
"""
RETURN None(a IN [2, 3, NULL] WHERE a > 3) AS r
"""
Then the result should be, in any order:
| r |
| NULL |

Scenario: use a predicate in GO
Given a graph with space named "nba"
Expand Down

0 comments on commit cd257c0

Please sign in to comment.