Skip to content

Commit

Permalink
resumed some tcks.
Browse files Browse the repository at this point in the history
  • Loading branch information
xtcyclist committed Jan 10, 2023
1 parent 1c40e8b commit 61d8209
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 114 deletions.
5 changes: 2 additions & 3 deletions tests/tck/features/expression/ListComprehension.feature
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ Feature: ListComprehension
When executing query:
"""
MATCH p = (n:player{name:"LeBron James"})<-[:like]-(m)
RETURN [n IN nodes(p) WHERE n.player.name
NOT STARTS WITH "LeBron" | n.player.age + 100] AS r
RETURN [n IN nodes(p) WHERE n.name NOT STARTS WITH "LeBron" | n.age + 100] AS r
"""
Then the result should be, in any order:
| r |
Expand All @@ -67,7 +66,7 @@ Feature: ListComprehension
When executing query:
"""
MATCH p = (n:player{name:"LeBron James"})-[:like]->(m)
RETURN [n IN nodes(p) | n.player.age + 100] AS r
RETURN [n IN nodes(p) | n.age + 100] AS r
"""
Then the result should be, in any order:
| r |
Expand Down
109 changes: 4 additions & 105 deletions 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: basic
Scenario: yield a predicate
Given a graph with space named "nba"
When executing query:
"""
Expand Down Expand Up @@ -33,105 +33,6 @@ 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 ALL(a IN [2, 3, NULL] WHERE a > 0) AS r
"""
Then the result should be, in any order:
| r |
| NULL |
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 Expand Up @@ -284,10 +185,8 @@ Feature: Predicate
When executing query:
"""
MATCH p = (n:player{name:"LeBron James"})<-[:like]-(m)
RETURN
nodes(p)[0].player.name AS n1,
nodes(p)[1].player.name AS n2,
all(n IN nodes(p) WHERE n.player.name NOT STARTS WITH "D") AS b
RETURN nodes(p)[0].name AS n1, nodes(p)[1].name AS n2,
all(n IN nodes(p) WHERE n.name NOT STARTS WITH "D") AS b
"""
Then the result should be, in any order:
| n1 | n2 | b |
Expand All @@ -300,7 +199,7 @@ Feature: Predicate
When executing query:
"""
MATCH p = (n:player{name:"LeBron James"})-[:like]->(m)
RETURN single(n IN nodes(p) WHERE n.player.age > 40) AS b
RETURN single(n IN nodes(p) WHERE n.age > 40) AS b
"""
Then the result should be, in any order:
| b |
Expand Down
12 changes: 6 additions & 6 deletions tests/tck/features/expression/Reduce.feature
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Feature: Reduce
"""
MATCH p = (n:player{name:"LeBron James"})<-[:like]-(m)
RETURN
nodes(p)[0].player.age AS age1,
nodes(p)[1].player.age AS age2,
reduce(totalAge = 100, n IN nodes(p) | totalAge + n.player.age) AS r
nodes(p)[0].age AS age1,
nodes(p)[1].age AS age2,
reduce(totalAge = 100, n IN nodes(p) | totalAge + n.age) AS r
"""
Then the result should be, in any order:
| age1 | age2 | r |
Expand All @@ -55,9 +55,9 @@ Feature: Reduce
When executing query:
"""
MATCH p = (n:player{name:"LeBron James"})-[:like]->(m)
RETURN nodes(p)[0].player.age AS age1,
nodes(p)[1].player.age AS age2,
reduce(x = 10, n IN nodes(p) | n.player.age - x) AS x
RETURN nodes(p)[0].age AS age1,
nodes(p)[1].age AS age2,
reduce(x = 10, n IN nodes(p) | n.age - x) AS x
"""
Then the result should be, in any order:
| age1 | age2 | x |
Expand Down

0 comments on commit 61d8209

Please sign in to comment.