From 8e257b7f010380e64fdcbe37659a70bd7ccab2e2 Mon Sep 17 00:00:00 2001 From: jimingquan Date: Wed, 13 Oct 2021 17:16:32 +0800 Subject: [PATCH] add test case --- .../tck/features/go/GoYieldVertexEdge.feature | 20 +++++++++++++++---- tests/tck/features/match/Base.feature | 15 ++++++++++++++ 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/tests/tck/features/go/GoYieldVertexEdge.feature b/tests/tck/features/go/GoYieldVertexEdge.feature index b38ebc7f876..8fc991f65f1 100644 --- a/tests/tck/features/go/GoYieldVertexEdge.feature +++ b/tests/tck/features/go/GoYieldVertexEdge.feature @@ -226,9 +226,7 @@ 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 hash hash 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 | @@ -236,7 +234,21 @@ Feature: Go Yield Vertex And Edge Sentence 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: diff --git a/tests/tck/features/match/Base.feature b/tests/tck/features/match/Base.feature index 98705f6b212..bd4cf155d02 100644 --- a/tests/tck/features/match/Base.feature +++ b/tests/tck/features/match/Base.feature @@ -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: