Skip to content

Commit

Permalink
fix compare node (#5816)
Browse files Browse the repository at this point in the history
* fix compare node

* remove @Skip mark
  • Loading branch information
Salieri-004 authored Feb 2, 2024
1 parent fc34170 commit c471388
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 11 deletions.
9 changes: 4 additions & 5 deletions tests/common/comparator.py
Original file line number Diff line number Diff line change
Expand Up @@ -295,21 +295,20 @@ def compare_vid(self, lid: Value, rid: Value) -> bool:
return False

def compare_node(self, lhs: Vertex, rhs: Vertex):
rtags = []
rtags = [] if rhs.tags is None else rhs.tags
if self._strict:
assert rhs.vid is not None
if not self.compare_vid(lhs.vid, rhs.vid):
return False
if rhs.tags is None or len(lhs.tags) != len(rhs.tags):
if len(lhs.tags) != len(rtags):
return False
rtags = rhs.tags
else:
if rhs.vid is not None:
if not self.compare_vid(lhs.vid, rhs.vid):
return False
if rhs.tags is not None and len(lhs.tags) < len(rhs.tags):
if len(lhs.tags) < len(rtags):
return False
rtags = [] if rhs.tags is None else rhs.tags

for tag in rtags:
ltag = [
[lt.name, lt.props] for lt in lhs.tags if self.bstr(tag.name) == lt.name
Expand Down
7 changes: 1 addition & 6 deletions tests/tck/features/path/NoLoop.feature
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,6 @@ Feature: NoLoop Path
| [[:like "LaMarcus Aldridge"->"Tim Duncan" @0 {}], [:like "Tony Parker"->"LaMarcus Aldridge" @0 {}]] |
| [[:like "Manu Ginobili"->"Tim Duncan" @0 {}], [:like "Tony Parker"->"Manu Ginobili" @0 {}]] |

@skip
Scenario: Query with NO LOOP on a node without self-loop
When executing query:
"""
Expand All @@ -261,25 +260,22 @@ Feature: NoLoop Path
"""
CREATE TAG Person(name string);
"""
And wait 1 seconds
Then the execution should be successful
When executing query:
"""
CREATE EDGE Link();
"""
And wait 1 seconds
Then the execution should be successful
And wait 6 seconds
When executing query:
"""
INSERT VERTEX Person(name) VALUES "nodea":("Node A");
"""
And wait 1 seconds
Then the execution should be successful
When executing query:
"""
INSERT EDGE Link() VALUES "nodea" -> "nodea":();
"""
And wait 1 seconds
Then the execution should be successful
When executing query:
"""
Expand All @@ -298,5 +294,4 @@ Feature: NoLoop Path
"""
DROP SPACE TestNoLoopSpace
"""
And wait 1 seconds
Then the execution should be successful

0 comments on commit c471388

Please sign in to comment.