Skip to content

Commit

Permalink
add test case
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Sep 15, 2021
1 parent 8502ce6 commit 35aa298
Show file tree
Hide file tree
Showing 2 changed files with 106 additions and 1 deletion.
53 changes: 53 additions & 0 deletions tests/tck/features/fetch/FetchVertices.intVid.feature
Original file line number Diff line number Diff line change
Expand Up @@ -334,3 +334,56 @@ Feature: Fetch Int Vid Vertices
GO FROM hash('NON EXIST VERTEX ID') OVER serve | FETCH PROP ON team $-
"""
Then a SyntaxError should be raised at runtime:

Scenario: format yield
When executing query:
"""
FETCH PROP ON * hash('Boris Diaw') YIELD id(vertex)
"""
Then the result should be, in any order, and the columns 0 should be hashed:
| VertexID | id(VERTEX) |
| "Boris Diaw" | "Boris Diaw" |
When executing query:
"""
FETCH PROP ON * hash('Boris Diaw') YIELD id(vertex), player.age
"""
Then the result should be, in any order, and the columns 0 should be hashed:
| VertexID | id(VERTEX) | player.age |
| "Boris Diaw" | "Boris Diaw" | 36 |
When executing query:
"""
FETCH PROP ON * hash('Boris Diaw') YIELD id(vertex), player.age, vertex
"""
Then the result should be, in any order, and the columns 0 should be hashed:
| id(VERTEX) | player.age | VERTEX |
| "Boris Diaw" | 36 | ("Boris Diaw":player{name:"Boris Diaw", age:36}) |
When executing query:
"""
FETCH PROP ON * hash('Boris Diaw') YIELD vertex
"""
Then the result should be, in any order:
| VERTEX |
| ("Boris Diaw":player{name:"Boris Diaw", age:36}) |
When executing query:
"""
FETCH PROP ON * hash("Tim Duncan") YIELD player.name, player.age, team.name, bachelor.name, bachelor.speciality, vertex
"""
Then the result should be, in any order:
| player.name | player.age | team.name | bachelor.name | bachelor.speciality | VERTEX |
| "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) |
When executing query:
"""
GO FROM hash("Tim Duncan") OVER like YIELD like._dst as id |
FETCH PROP ON * $-.id YIELD VERTEX
"""
Then the result should be, in any order:
| VERTEX |
| ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) |
| ("Tony Parker" :player{age: 36, name: "Tony Parker"}) |
When executing query:
"""
FETCH PROP ON * hash('NON EXIST VERTEX ID'), hash('Boris Diaw') yield player.name, id(vertex)
"""
Then the result should be, in any order, and the columns 0 should be hashed:
| VertexID | player.name | id(VERTEX) |
| "Boris Diaw" | "Boris Diaw" | "Boris Diaw" |
54 changes: 53 additions & 1 deletion tests/tck/features/fetch/FetchVertices.strVid.feature
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
@jmq
Feature: Fetch String Vertices

Background:
Expand Down Expand Up @@ -446,3 +445,56 @@ Feature: Fetch String Vertices
GO FROM 'NON EXIST VERTEX ID' OVER serve | FETCH PROP ON team $-
"""
Then a SyntaxError should be raised at runtime:

Scenario: format yield
When executing query:
"""
FETCH PROP ON * 'Boris Diaw' YIELD id(vertex)
"""
Then the result should be, in any order:
| VertexID | id(VERTEX) |
| "Boris Diaw" | "Boris Diaw" |
When executing query:
"""
FETCH PROP ON * 'Boris Diaw' YIELD id(vertex), player.age
"""
Then the result should be, in any order:
| VertexID | id(VERTEX) | player.age |
| "Boris Diaw" | "Boris Diaw" | 36 |
When executing query:
"""
FETCH PROP ON * 'Boris Diaw' YIELD id(vertex), player.age, vertex
"""
Then the result should be, in any order:
| id(VERTEX) | player.age | VERTEX |
| "Boris Diaw" | 36 | ("Boris Diaw":player{name:"Boris Diaw", age:36}) |
When executing query:
"""
FETCH PROP ON * 'Boris Diaw' YIELD vertex
"""
Then the result should be, in any order:
| VERTEX |
| ("Boris Diaw":player{name:"Boris Diaw", age:36}) |
When executing query:
"""
FETCH PROP ON * "Tim Duncan" YIELD player.name, player.age, team.name, bachelor.name, bachelor.speciality, vertex
"""
Then the result should be, in any order:
| player.name | player.age | team.name | bachelor.name | bachelor.speciality | VERTEX |
| "Tim Duncan" | 42 | EMPTY | "Tim Duncan" | "psychology" | ("Tim Duncan" :bachelor{name: "Tim Duncan", speciality: "psychology"} :player{age: 42, name: "Tim Duncan"}) |
When executing query:
"""
GO FROM "Tim Duncan" OVER like YIELD like._dst as id |
FETCH PROP ON * $-.id YIELD VERTEX
"""
Then the result should be, in any order:
| VERTEX |
| ("Manu Ginobili" :player{age: 41, name: "Manu Ginobili"}) |
| ("Tony Parker" :player{age: 36, name: "Tony Parker"}) |
When executing query:
"""
FETCH PROP ON * 'NON EXIST VERTEX ID', 'Boris Diaw' yield player.name, id(vertex)
"""
Then the result should be, in any order:
| VertexID | player.name | id(VERTEX) |
| "Boris Diaw" | "Boris Diaw" | "Boris Diaw" |

0 comments on commit 35aa298

Please sign in to comment.