Skip to content
Snippets Groups Projects
Unverified Commit 552454a0 authored by kyle.cao's avatar kyle.cao Committed by GitHub
Browse files

Add tck case (#960)

parent 2ef4753b
Branches
No related tags found
No related merge requests found
...@@ -95,3 +95,14 @@ Feature: ListComprehension ...@@ -95,3 +95,14 @@ Feature: ListComprehension
Then the result should be, in any order: Then the result should be, in any order:
| a | | a |
| NULL | | 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] |
...@@ -101,28 +101,28 @@ Feature: Predicate ...@@ -101,28 +101,28 @@ Feature: Predicate
Given a graph with space named "nba" Given a graph with space named "nba"
When executing query: 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: Then the result should be, in any order:
| myboo | | myboo |
| true | | true |
When executing query: 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: Then the result should be, in any order:
| myboo | | myboo |
| false | | false |
When executing query: 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: Then the result should be, in any order:
| myboo | | myboo |
| false | | false |
When executing query: 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: Then the result should be, in any order:
| myboo | | myboo |
......
...@@ -94,3 +94,14 @@ Feature: Reduce ...@@ -94,3 +94,14 @@ Feature: Reduce
Then the result should be, in any order: Then the result should be, in any order:
| r | | r |
| NULL | | 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 |
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment