diff --git a/tests/tck/features/expression/ListComprehension.feature b/tests/tck/features/expression/ListComprehension.feature index 2a08998d7ca3467d24c3992899c12d65c3addca0..b12c3051b0f6fdff98debd9852ee73b3951fba4a 100644 --- a/tests/tck/features/expression/ListComprehension.feature +++ b/tests/tck/features/expression/ListComprehension.feature @@ -95,3 +95,14 @@ Feature: ListComprehension Then the result should be, in any order: | a | | NULL | + + Scenario: aggregate function in collection + Given a graph with space named "nba" + When executing query: + """ + UNWIND [1, 2, 3, 4, 5] AS a RETURN a * 2 AS x + | RETURN [n in collect($-.x) WHERE n > 5 | n + 1] AS list + """ + Then the result should be, in any order: + | list | + | [7, 9, 11] | diff --git a/tests/tck/features/expression/Predicate.feature b/tests/tck/features/expression/Predicate.feature index 00da640611f6d2c5ab70e0c559841c13aa392a5d..360e848190cb6a6127d8c8cb8dcfc61cf6411ca3 100644 --- a/tests/tck/features/expression/Predicate.feature +++ b/tests/tck/features/expression/Predicate.feature @@ -101,28 +101,28 @@ Feature: Predicate Given a graph with space named "nba" When executing query: """ - unwind [1, 2, 3, 4, 5] as a return a * 2 as x | return any(n in collect($-.x) where n > 5) as myboo + UNWIND [1, 2, 3, 4, 5] AS a RETURN a * 2 AS x | RETURN any(n in collect($-.x) WHERE n > 5) AS myboo """ Then the result should be, in any order: | myboo | | true | When executing query: """ - unwind [1, 2, 3, 4, 5] as a return a * 2 as x | return All(n in collect($-.x) where n > 5) as myboo + UNWIND [1, 2, 3, 4, 5] AS a RETURN a * 2 AS x | RETURN All(n in collect($-.x) WHERE n > 5) AS myboo """ Then the result should be, in any order: | myboo | | false | When executing query: """ - unwind [1, 2, 3, 4, 5] as a return a * 2 as x | return single(n in collect($-.x) where n > 5) as myboo + UNWIND [1, 2, 3, 4, 5] AS a RETURN a * 2 AS x | RETURN single(n in collect($-.x) WHERE n > 5) AS myboo """ Then the result should be, in any order: | myboo | | false | When executing query: """ - unwind [1, 2, 3, 4, 5] as a return a * 2 as x | return None(n in collect($-.x) where n > 5) as myboo + UNWIND [1, 2, 3, 4, 5] AS a RETURN a * 2 AS x | RETURN None(n in collect($-.x) WHERE n > 5) AS myboo """ Then the result should be, in any order: | myboo | diff --git a/tests/tck/features/expression/Reduce.feature b/tests/tck/features/expression/Reduce.feature index 6110cc45b3b9b182a4a75443355903373cfd6e1f..0357c3ed9d6e386f9ff968290e96e3048957eeac 100644 --- a/tests/tck/features/expression/Reduce.feature +++ b/tests/tck/features/expression/Reduce.feature @@ -94,3 +94,14 @@ Feature: Reduce Then the result should be, in any order: | r | | NULL | + + Scenario: aggregate function in collection + Given a graph with space named "nba" + When executing query: + """ + UNWIND [1, 2, 3, 4, 5] AS a RETURN a * 2 AS x + | RETURN reduce(totalNum = 10, n in collect($-.x) | totalNum + n * 2) AS total + """ + Then the result should be, in any order: + | total | + | 70 |