Skip to content

Commit

Permalink
address comment
Browse files Browse the repository at this point in the history
  • Loading branch information
nevermore3 committed Apr 4, 2023
1 parent 3e62eb2 commit f2b3215
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/graph/validator/MatchValidator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Status MatchValidator::buildPathExpr(const MatchPath *path,
auto min = range->min();
if (min != 0 && min != 1) {
return Status::SemanticError(
"`shortestPath(...)' does not support a minimal length different from 0 or 1");
"The minimal number of steps for shortestPath() must be either 0 or 1.");
}
}
pathInfo.pathType = static_cast<Path::PathType>(pathType);
Expand Down
18 changes: 18 additions & 0 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: shortest path invalid step
When executing query:
"""
WITH ["Tim Duncan","Tony Parker"] as list1
MATCH allShortestPaths((v1:player)-[e*2]-(v2:player))
WHERE id(v1) in list1 AND id(v2) in list1
RETURN e
"""
Then a SemanticError should be raised at runtime: The minimal number of steps for shortestPath() must be either 0 or 1.
When executing query:
"""
WITH ["Tim Duncan","Tony Parker"] as list1
MATCH allShortestPaths((v1:player)-[e*2..4]-(v2:player))
WHERE id(v1) in list1 AND id(v2) in list1
RETURN e
"""
Then a SemanticError should be raised at runtime: The minimal number of steps for shortestPath() must be either 0 or 1.

Scenario: zero step shortest path
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: shortest path invalid step
When executing query:
"""
WITH ["Tim Duncan","Tony Parker"] as list1
MATCH shortestPath((v1:player)-[e*2]-(v2:player))
WHERE id(v1) in list1 AND id(v2) in list1
RETURN e
"""
Then a SemanticError should be raised at runtime: The minimal number of steps for shortestPath() must be either 0 or 1.
When executing query:
"""
WITH ["Tim Duncan","Tony Parker"] as list1
MATCH shortestPaths((v1:player)-[e*2..4]-(v2:player))
WHERE id(v1) in list1 AND id(v2) in list1
RETURN e
"""
Then a SemanticError should be raised at runtime: The minimal number of steps for shortestPath() must be either 0 or 1.

Scenario: zero step shortestpath
When executing query:
"""
Expand Down

0 comments on commit f2b3215

Please sign in to comment.