Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Jul 23, 2022
1 parent 796131c commit 786b2e9
Showing 1 changed file with 41 additions and 1 deletion.
42 changes: 41 additions & 1 deletion tests/tck/features/match/Unwind.feature
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,46 @@ Feature: Unwind clause
| min | max |
| false | true |

Scenario: unwind pipe ngql
When executing query:
"""
YIELD ['Tim Duncan', 'Tony Parker'] AS a
| UNWIND $-.a AS b
| GO FROM $-.b OVER like YIELD edge AS e
"""
Then the result should be, in any order:
| e |
| [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
| [:like "Tony Parker"->"LaMarcus Aldridge" @0 {likeness: 90}] |
| [:like "Tony Parker"->"Manu Ginobili" @0 {likeness: 95}] |
| [:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}] |
When executing query:
"""
YIELD {a:1, b:['Tim Duncan', 'Tony Parker'], c:'Tim Duncan'} AS a
| YIELD $-.a.b AS b
| UNWIND $-.b AS c
| GO FROM $-.c OVER like YIELD edge AS e
"""
Then the result should be, in any order:
| e |
| [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
| [:like "Tony Parker"->"LaMarcus Aldridge" @0 {likeness: 90}] |
| [:like "Tony Parker"->"Manu Ginobili" @0 {likeness: 95}] |
| [:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}] |
When executing query:
"""
YIELD {a:1, b:['Tim Duncan', 'Tony Parker'], c:'Tim Duncan'} AS a
| YIELD $-.a.c AS b
| UNWIND $-.b AS c
| GO FROM $-.c OVER like YIELD edge AS e
"""
Then the result should be, in any order:
| e |
| [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |

Scenario: unwind match with
When executing query:
"""
Expand Down Expand Up @@ -146,7 +186,7 @@ Feature: Unwind clause
WITH DISTINCT vid
RETURN collect(vid) as vids
"""
Then a SyntaxError should be raised at runtime: syntax error near `UNWIND'
Then a SyntaxError should be raised at runtime: syntax error near `WITH'
When executing query:
"""
MATCH (a:player {name:"Tim Duncan"}) - [e:like] -> (b)
Expand Down

0 comments on commit 786b2e9

Please sign in to comment.