Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Oct 13, 2021
1 parent 3922ef1 commit 8e257b7
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 4 deletions.
20 changes: 16 additions & 4 deletions tests/tck/features/go/GoYieldVertexEdge.feature
Original file line number Diff line number Diff line change
Expand Up @@ -226,17 +226,29 @@ Feature: Go Yield Vertex And Edge Sentence
"""
Then a SyntaxError should be raised at runtime: syntax error near `OVER'

@skip
# reason we not support hash<Map> hash<set> hash<DataSet> from now on. line 67 in Value.cpp
Scenario: distinct map
Scenario: distinct map and set
When executing query:
"""
GO FROM "Boris Diaw" OVER like YIELD dst(edge) as id |
GO FROM $-.id OVER like YIELD dst(edge) as id |
GO FROM $-.id OVER serve YIELD DISTINCT dst(edge) as dst, edge as e, properties(edge) as props
"""
Then the result should be, in any order, with relax comparison:
| dst | e | props |
| dst | e | props |
| "Spurs" | [:serve "Manu Ginobili"->"Spurs" @0 {end_year: 2018, start_year: 2002}] | {end_year: 2018, start_year: 2002} |
| "Spurs" | [:serve "Tim Duncan"->"Spurs" @0 {end_year: 2016, start_year: 1997}] | {end_year: 2016, start_year: 1997} |
| "Hornets" | [:serve "Tony Parker"->"Hornets" @0 {end_year: 2019, start_year: 2018}] | {end_year: 2019, start_year: 2018} |
| "Spurs" | [:serve "Tony Parker"->"Spurs" @0 {end_year: 2018, start_year: 1999}] | {end_year: 2018, start_year: 1999} |
| "Spurs" | [:serve "LaMarcus Aldridge"->"Spurs" @0 {end_year: 2019, start_year: 2015}] | {end_year: 2019, start_year: 2015} |
| "Trail Blazers" | [:serve "LaMarcus Aldridge"->"Trail Blazers" @0 {end_year: 2015, start_year: 2006}] | {end_year: 2015, start_year: 2006} |
When executing query:
"""
GO 2 STEPS FROM "Tim Duncan" OVER like YIELD dst(edge) as id |
YIELD DISTINCT collect($-.id) as a, collect_set($-.id) as b
"""
Then the result should be, in any order, with relax comparison:
| a | b |
| ["Tony Parker", "Tim Duncan", "LaMarcus Aldridge", "Manu Ginobili", "Tim Duncan"] | ["Manu Ginobili", "LaMarcus Aldridge", "Tony Parker", "Tim Duncan"] |

Scenario: distinct
When executing query:
Expand Down
15 changes: 15 additions & 0 deletions tests/tck/features/match/Base.feature
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,21 @@ Feature: Basic match
| ("Paul Gasol" :player{age: 38, name: "Paul Gasol"}) | [:like "Paul Gasol"->"Marc Gasol" @0 {likeness: 99}] | ("Marc Gasol" :player{age: 34, name: "Marc Gasol"}) |
| ("Yao Ming" :player{age: 38, name: "Yao Ming"}) | [:like "Yao Ming"->"Shaquile O'Neal" @0 {likeness: 90}] | ("Shaquile O'Neal" :player{age: 47, name: "Shaquile O'Neal"}) |
| ("Yao Ming" :player{age: 38, name: "Yao Ming"}) | [:like "Yao Ming"->"Tracy McGrady" @0 {likeness: 90}] | ("Tracy McGrady" :player{age: 39, name: "Tracy McGrady"}) |
When executing query:
"""
MATCH (v:player)-[e:like]-(v2) where id(v) == "Tim Duncan" RETURN DISTINCT properties(e) as props, e
"""
Then the result should be, in any order, with relax comparison:
| props | e |
| {likeness: 95} | [:like "Tim Duncan"->"Manu Ginobili" @0 {likeness: 95}] |
| {likeness: 95} | [:like "Tim Duncan"->"Tony Parker" @0 {likeness: 95}] |
When executing query:
"""
MATCH (v:player)-[e:like]-(v2) where id(v) == "Tim Duncan" RETURN DISTINCT properties(e) as props
"""
Then the result should be, in any order, with relax comparison:
| props |
| {likeness: 95} |

Scenario: two steps
When executing query:
Expand Down

0 comments on commit 8e257b7

Please sign in to comment.