Skip to content

Commit

Permalink
fix zero step
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Apr 4, 2023
1 parent 7635951 commit 841a118
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 10 deletions.
38 changes: 28 additions & 10 deletions tests/tck/features/match/AllShortestPaths.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ Feature: allShortestPaths
Background:
Given a graph with space named "nba"

Scenario: zero step shortest path
When executing query:
"""
WITH ["Tim Duncan","Tony Parker"] as list1
MATCH allShortestPaths((v1:player)-[e*0]-(v2:player))
WHERE id(v1) in list1 AND id(v2) in list1
RETURN e
"""
Then the result should be, in any order, with relax comparison:
| e |
When executing query:
"""
MATCH allShortestPaths((v1:player{name:"Tim Duncan"})-[e*0]-(v2:player{name:"Tony Parker"}))
RETURN e
"""
Then the result should be, in any order, with relax comparison:
| e |

Scenario: one step shortest path
When executing query:
"""
Expand Down Expand Up @@ -41,22 +59,22 @@ Feature: allShortestPaths
RETURN e
"""
Then the result should be, in any order, with relax comparison:
| e |
| [:teammate "Tony Parker"->"Tim Duncan" @0 {end_year: 2016, start_year: 2001}] |
| [:teammate "Tim Duncan"->"Tony Parker" @0 {end_year: 2016, start_year: 2001}] |
| [:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}] |
| [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
| e |
| [[:teammate "Tony Parker"->"Tim Duncan" @0 {end_year: 2016, start_year: 2001}]] |
| [[:teammate "Tim Duncan"->"Tony Parker" @0 {end_year: 2016, start_year: 2001}]] |
| [[:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}]] |
| [[:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}]] |
When executing query:
"""
MATCH allShortestPaths((v1:player{name:"Tim Duncan"})-[e*1..1]-(v2:player{name:"Tony Parker"}))
RETURN e
"""
Then the result should be, in any order, with relax comparison:
| e |
| [:teammate "Tony Parker"->"Tim Duncan" @0 {end_year: 2016, start_year: 2001}] |
| [:teammate "Tim Duncan"->"Tony Parker" @0 {end_year: 2016, start_year: 2001}] |
| [:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}] |
| [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
| e |
| [[:teammate "Tony Parker"->"Tim Duncan" @0 {end_year: 2016, start_year: 2001}]] |
| [[:teammate "Tim Duncan"->"Tony Parker" @0 {end_year: 2016, start_year: 2001}]] |
| [[:like "Tony Parker"->"Tim Duncan" @0 {likeness: 95}]] |
| [[:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}]] |

Scenario: allShortestPaths1
When executing query:
Expand Down
18 changes: 18 additions & 0 deletions tests/tck/features/match/SingleShorestPath.feature
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,24 @@ Feature: single shortestPath
Background:
Given a graph with space named "nba"

Scenario: zero step shortestpath
When executing query:
"""
WITH ["Tim Duncan","Tony Parker"] as list1
MATCH shortestPath((v1:player)-[e*0]-(v2:player))
WHERE id(v1) in list1 AND id(v2) in list1
RETURN e
"""
Then the result should be, in any order, with relax comparison:
| e |
When executing query:
"""
MATCH shortestPath((v1:player{name:"Tim Duncan"})-[e*0]-(v2:player{name:"Tony Parker"}))
RETURN e
"""
Then the result should be, in any order, with relax comparison:
| e |

Scenario: single shortestPath1
When executing query:
"""
Expand Down

0 comments on commit 841a118

Please sign in to comment.