From e319615ca192925031867e4ca024b38b19a718c5 Mon Sep 17 00:00:00 2001 From: Shylock Hg <33566796+Shylock-Hg@users.noreply.github.com> Date: Thu, 2 Dec 2021 17:14:26 +0800 Subject: [PATCH] Enable the skip go sample test cases. (#3086) * Enable the skip go sample test cases. * Format. --- tests/tck/features/go/GO.IntVid.feature | 94 +++++++++++++++++++++++++ tests/tck/features/go/GO.feature | 61 ++++++++++++++-- 2 files changed, 149 insertions(+), 6 deletions(-) diff --git a/tests/tck/features/go/GO.IntVid.feature b/tests/tck/features/go/GO.IntVid.feature index 2dd3b6d20f3..01da5b09d03 100644 --- a/tests/tck/features/go/GO.IntVid.feature +++ b/tests/tck/features/go/GO.IntVid.feature @@ -1714,6 +1714,100 @@ Feature: IntegerVid Go Sentence Then the result should be, in any order: | serve._dst | + Scenario: go step limit + When executing query: + """ + GO FROM hash("Tim Duncan") OVER like YIELD like._dst LIMIT [10,10]; + """ + Then a SemanticError should be raised at runtime: + When executing query: + """ + GO FROM hash("Tim Duncan") OVER like YIELD like._dst LIMIT ["10"]; + """ + Then a SemanticError should be raised at runtime: + When executing query: + """ + GO FROM hash("Tim Duncan") OVER like YIELD like._dst LIMIT [a]; + """ + Then a SemanticError should be raised at runtime: + When executing query: + """ + GO FROM hash("Tim Duncan") OVER like YIELD like._dst LIMIT [1]; + """ + Then the result should be, in any order, with relax comparison: + | like._dst | + | /[+-]?\d+/ | + When executing query: + """ + GO 3 STEPS FROM hash("Tim Duncan") OVER like YIELD like._dst LIMIT [1, 2, 2]; + """ + Then the result should be, in any order, with relax comparison: + | like._dst | + | /[+-]?\d+/ | + | /[+-]?\d+/ | + + @skip + Scenario: go step filter & step limit + When executing query: + """ + GO FROM hash("Tim Duncan") OVER like WHERE [like._dst == "Tony Parker"] LIMIT [1]; + """ + Then the result should be, in any order, with relax comparison: + | like._dst | + When executing query: + """ + GO 3 STEPS FROM hash("Tim Duncan") OVER like WHERE [like._dst == "Tony Parker", $$.player.age>20, $$.player.age>22] LIMIT [1, 2, 2]; + """ + Then the result should be, in any order, with relax comparison: + | like._dst | + + Scenario: go step sample + When executing query: + """ + GO FROM hash("Tim Duncan") OVER like YIELD like._dst SAMPLE [10,10]; + """ + Then a SemanticError should be raised at runtime: + When executing query: + """ + GO FROM hash("Tim Duncan") OVER like YIELD like._dst SAMPLE ["10"]; + """ + Then a SemanticError should be raised at runtime: + When executing query: + """ + GO FROM hash("Tim Duncan") OVER like YIELD like._dst SAMPLE [a]; + """ + Then a SemanticError should be raised at runtime: + When executing query: + """ + GO FROM hash("Tim Duncan") OVER like YIELD like._dst SAMPLE [1]; + """ + Then the result should be, in any order, with relax comparison: + | like._dst | + | /[+-]?\d+/ | + When executing query: + """ + GO 3 STEPS FROM hash("Tim Duncan") OVER like YIELD like._dst SAMPLE [1, 3, 2]; + """ + Then the result should be, in any order, with relax comparison: + | like._dst | + | /[+-]?\d+/ | + | /[+-]?\d+/ | + + @skip + Scenario: go step filter & step sample + When executing query: + """ + GO FROM hash("Tim Duncan") OVER like WHERE [like._dst == "Tony Parker"] SAMPLE [1]; + """ + Then the result should be, in any order, with relax comparison: + | like._dst | + When executing query: + """ + GO 3 STEPS FROM hash("Tim Duncan") OVER like WHERE [like._dst == "Tony Parker", $$.player.age>20, $$.player.age>22] SAMPLE [1, 2, 2]; + """ + Then the result should be, in any order, with relax comparison: + | like._dst | + Scenario: go from vertices looked up by index When executing query: """ diff --git a/tests/tck/features/go/GO.feature b/tests/tck/features/go/GO.feature index e48ead1ab2b..3ed44e7a4a2 100644 --- a/tests/tck/features/go/GO.feature +++ b/tests/tck/features/go/GO.feature @@ -1771,35 +1771,37 @@ Feature: Go Sentence Then the result should be, in any order: | serve._dst | - @skip Scenario: go step limit When executing query: """ - GO FROM "Tim Duncan" OVER like LIMIT [10,10] YIELD like._dst; + GO FROM "Tim Duncan" OVER like YIELD like._dst LIMIT [10,10]; """ Then a SemanticError should be raised at runtime: When executing query: """ - GO FROM "Tim Duncan" OVER like LIMIT ["10"] YIELD like._dst; + GO FROM "Tim Duncan" OVER like YIELD like._dst LIMIT ["10"]; """ Then a SemanticError should be raised at runtime: When executing query: """ - GO FROM "Tim Duncan" OVER like LIMIT [a] YIELD like._dst; + GO FROM "Tim Duncan" OVER like YIELD like._dst LIMIT [a]; """ Then a SemanticError should be raised at runtime: When executing query: """ - GO FROM "Tim Duncan" OVER like LIMIT [1] YIELD like._dst; + GO FROM "Tim Duncan" OVER like YIELD like._dst LIMIT [1]; """ Then the result should be, in any order, with relax comparison: | like._dst | + | /[\s\w]+/ | When executing query: """ - GO 3 STEPS FROM "Tim Duncan" OVER like LIMIT [1, 2, 2] YIELD like._dst; + GO 3 STEPS FROM "Tim Duncan" OVER like YIELD like._dst LIMIT [1, 2, 2]; """ Then the result should be, in any order, with relax comparison: | like._dst | + | /[\s\w]+/ | + | /[\s\w]+/ | @skip Scenario: go step filter & step limit @@ -1816,6 +1818,53 @@ Feature: Go Sentence Then the result should be, in any order, with relax comparison: | like._dst | + Scenario: go step sample + When executing query: + """ + GO FROM "Tim Duncan" OVER like YIELD like._dst SAMPLE [10,10]; + """ + Then a SemanticError should be raised at runtime: + When executing query: + """ + GO FROM "Tim Duncan" OVER like YIELD like._dst SAMPLE ["10"]; + """ + Then a SemanticError should be raised at runtime: + When executing query: + """ + GO FROM "Tim Duncan" OVER like YIELD like._dst SAMPLE [a]; + """ + Then a SemanticError should be raised at runtime: + When executing query: + """ + GO FROM "Tim Duncan" OVER like YIELD like._dst SAMPLE [1]; + """ + Then the result should be, in any order, with relax comparison: + | like._dst | + | /[\s\w]+/ | + When executing query: + """ + GO 3 STEPS FROM "Tim Duncan" OVER like YIELD like._dst SAMPLE [1, 3, 2]; + """ + Then the result should be, in any order, with relax comparison: + | like._dst | + | /[\s\w]+/ | + | /[\s\w]+/ | + + @skip + Scenario: go step filter & step sample + When executing query: + """ + GO FROM "Tim Duncan" OVER like WHERE [like._dst == "Tony Parker"] SAMPLE [1]; + """ + Then the result should be, in any order, with relax comparison: + | like._dst | + When executing query: + """ + GO 3 STEPS FROM "Tim Duncan" OVER like WHERE [like._dst == "Tony Parker", $$.player.age>20, $$.player.age>22] SAMPLE [1, 2, 2]; + """ + Then the result should be, in any order, with relax comparison: + | like._dst | + Scenario: with no existed tag When executing query: """