From a859a0624b4432d839ba7f9b3e08b4872c38f4f1 Mon Sep 17 00:00:00 2001 From: yixinglu <2520865+yixinglu@users.noreply.github.com> Date: Fri, 6 Jan 2023 16:49:39 +0800 Subject: [PATCH] variable pattern in where clause --- .../match/VariableLengthPattern.feature | 66 +++++++++++++++++-- 1 file changed, 62 insertions(+), 4 deletions(-) diff --git a/tests/tck/features/match/VariableLengthPattern.feature b/tests/tck/features/match/VariableLengthPattern.feature index 56eb3764c59..4a3b4ec4ab3 100644 --- a/tests/tck/features/match/VariableLengthPattern.feature +++ b/tests/tck/features/match/VariableLengthPattern.feature @@ -385,7 +385,7 @@ Feature: Variable length Pattern match (m to n) """ Then the result should be, in any order: | cnt | - | 1 | + | 1 | When executing query: """ MATCH (v)-[e:like*0..2]-(v) @@ -394,7 +394,7 @@ Feature: Variable length Pattern match (m to n) """ Then the result should be, in any order: | cnt | - | 5 | + | 5 | When executing query: """ MATCH (v)-[e:like*2..3]-(v) @@ -412,7 +412,7 @@ Feature: Variable length Pattern match (m to n) """ Then the result should be, in any order: | cnt | - | 4 | + | 4 | When executing query: """ MATCH (v)-[e:like*0..]->(v) @@ -421,4 +421,62 @@ Feature: Variable length Pattern match (m to n) """ Then the result should be, in any order: | cnt | - | 13 | + | 13 | + + Scenario: variable length pattern and list expression + # When executing query: + # """ + # MATCH (v:player{name: 'Tim Duncan'})-[e:like*0..2]-(v2) + # WHERE size([i in e WHERE (v)-[i]-(v2) | i])>1 + # RETURN count(*) AS cnt + # """ + # Then the result should be, in any order: + # | cnt | + # | 18 | + When executing query: + """ + MATCH (v:player{name: 'Tim Duncan'})-[e:like*0..2]-(v2) + WHERE size([i in e WHERE i.likeness>90 | i])>1 + RETURN count(*) AS cnt + """ + Then the result should be, in any order: + | cnt | + | 18 | + + Scenario: variable pattern in where clause + When executing query: + """ + MATCH (v:player{name: 'Tim Duncan'})-[e*0..2]-(v2) + WHERE NOT (v)-[:like*0..1]-(v2) + RETURN count(*) AS cnt + """ + Then the result should be, in any order: + | cnt | + | 182 | + When executing query: + """ + MATCH (v:player{name: 'Tim Duncan'})-[e*0..2]-(v2) + WHERE NOT (v)-[:like*1..2]-(v2) + RETURN count(*) AS cnt + """ + Then the result should be, in any order: + | cnt | + | 182 | + When executing query: + """ + MATCH (v:player{name: 'Tim Duncan'})-[e:like*0..2]-(v2) + WHERE NOT (v)-[:like*0..1]-(v2) + RETURN count(*) AS cnt + """ + Then the result should be, in any order: + | cnt | + | 56 | + When executing query: + """ + MATCH (v:player{name: 'Tim Duncan'})-[e:like*0..2]-(v2) + WHERE NOT (v)-[:like*1..2]-(v2) + RETURN count(*) AS cnt + """ + Then the result should be, in any order: + | cnt | + | 56 |