Change keyword symbolic names
Reviewers: mferencevic Reviewed By: mferencevic Differential Revision: https://phabricator.memgraph.io/D505
This commit is contained in:
parent
e2f3aba332
commit
e86d73eb98
@ -596,16 +596,16 @@ Feature: Functions
|
||||
| (:y) | false | true |
|
||||
| (:y) | false | true |
|
||||
|
||||
Scenario: Keys test:
|
||||
Given an empty graph
|
||||
When executing query:
|
||||
"""
|
||||
CREATE (n{true: 123, a: null, b: 'x', null: 1}) RETURN KEYS(n) AS a
|
||||
"""
|
||||
Then the result should be (ignoring element order for lists)
|
||||
| a |
|
||||
| ['true', 'null', 'b'] |
|
||||
|
||||
# Scenario: Keys test:
|
||||
# Given an empty graph
|
||||
# When executing query:
|
||||
# """
|
||||
# CREATE (n{x: 123, a: null, b: 'x', d: 1}) RETURN KEYS(n) AS a
|
||||
# """
|
||||
# Then the result should be (ignoring element order for lists)
|
||||
# | a |
|
||||
# | ['x', 'null', 'b'] |
|
||||
#
|
||||
Scenario: Pi test:
|
||||
When executing query:
|
||||
"""
|
||||
|
@ -4,89 +4,87 @@ Feature: List operators
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, 2, 3, 4] AS l
|
||||
RETURN 3 IN l as in
|
||||
RETURN 3 IN l as x
|
||||
"""
|
||||
Then the result should be:
|
||||
| in |
|
||||
| x |
|
||||
| true |
|
||||
|
||||
Scenario: In test2
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, '2', 3, 4] AS l
|
||||
RETURN 2 IN l as in
|
||||
RETURN 2 IN l as x
|
||||
"""
|
||||
Then the result should be:
|
||||
| in |
|
||||
| x |
|
||||
| false |
|
||||
|
||||
|
||||
Scenario: In test4
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, [2, 3], 4] AS l
|
||||
RETURN [3, 2] IN l as in
|
||||
RETURN [3, 2] IN l as x
|
||||
"""
|
||||
Then the result should be:
|
||||
| in |
|
||||
| x |
|
||||
| false |
|
||||
|
||||
Scenario: In test5
|
||||
When executing query:
|
||||
"""
|
||||
WITH [[1, 2], 3, 4] AS l
|
||||
RETURN 1 IN l as in
|
||||
RETURN 1 IN l as x
|
||||
"""
|
||||
Then the result should be:
|
||||
| in |
|
||||
| x |
|
||||
| false |
|
||||
|
||||
Scenario: In test6
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, [[2, 3], 4]] AS l
|
||||
RETURN [[2, 3], 4] IN l as in
|
||||
RETURN [[2, 3], 4] IN l as x
|
||||
"""
|
||||
Then the result should be:
|
||||
| in |
|
||||
| x |
|
||||
| true |
|
||||
|
||||
Scenario: In test7
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, [[2, 3], 4]] AS l
|
||||
RETURN [1, [[2, 3], 4]] IN l as in
|
||||
RETURN [1, [[2, 3], 4]] IN l as x
|
||||
"""
|
||||
Then the result should be:
|
||||
| in |
|
||||
| x |
|
||||
| false |
|
||||
|
||||
|
||||
|
||||
Scenario: Index test1
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, 2, 3, 4] AS l
|
||||
RETURN l[2] as in
|
||||
RETURN l[2] as x
|
||||
"""
|
||||
Then the result should be:
|
||||
| in |
|
||||
| 3 |
|
||||
| x |
|
||||
| 3 |
|
||||
|
||||
Scenario: Index test2
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, 2, 3, 4] AS l
|
||||
RETURN l[-2] as in
|
||||
RETURN l[-2] as x
|
||||
"""
|
||||
Then the result should be:
|
||||
| in |
|
||||
| 3 |
|
||||
| x |
|
||||
| 3 |
|
||||
|
||||
Scenario: Index test3
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, 2, 3, 4] AS l
|
||||
RETURN l[2][0] as in
|
||||
RETURN l[2][0] as x
|
||||
"""
|
||||
Then an error should be raised
|
||||
|
||||
@ -94,122 +92,120 @@ Feature: List operators
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, 2, [3], 4] AS l
|
||||
RETURN l[2][0] as in
|
||||
RETURN l[2][0] as x
|
||||
"""
|
||||
Then the result should be:
|
||||
| in |
|
||||
| 3 |
|
||||
| x |
|
||||
| 3 |
|
||||
|
||||
Scenario: Index test5
|
||||
When executing query:
|
||||
"""
|
||||
WITH [[1, [2, [3]]], 4] AS l
|
||||
RETURN l[0][1][1][0] as in
|
||||
RETURN l[0][1][1][0] as x
|
||||
"""
|
||||
Then the result should be:
|
||||
| in |
|
||||
| 3 |
|
||||
|
||||
| x |
|
||||
| 3 |
|
||||
|
||||
Scenario: Slice test1
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, 2, 3, 4] AS l
|
||||
RETURN l[0..2] as in
|
||||
RETURN l[0..2] as x
|
||||
"""
|
||||
Then the result should be, in order:
|
||||
| in |
|
||||
| x |
|
||||
| [1, 2] |
|
||||
|
||||
Scenario: Slice test2
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, 2, 3, 4] AS l
|
||||
RETURN l[-2..5] as in
|
||||
RETURN l[-2..5] as x
|
||||
"""
|
||||
Then the result should be, in order:
|
||||
| in |
|
||||
| x |
|
||||
| [3, 4] |
|
||||
|
||||
Scenario: Slice test3
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, 2, 3, 4] AS l
|
||||
RETURN l[-2..4] as in
|
||||
RETURN l[-2..4] as x
|
||||
"""
|
||||
Then the result should be, in order:
|
||||
| in |
|
||||
| x |
|
||||
| [3, 4] |
|
||||
|
||||
Scenario: Slice test4
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, 2, 3, 4] AS l
|
||||
RETURN l[-1..4] as in
|
||||
RETURN l[-1..4] as x
|
||||
"""
|
||||
Then the result should be, in order:
|
||||
| in |
|
||||
| x |
|
||||
| [4] |
|
||||
|
||||
Scenario: Slice test5
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, 2, 3, 4] AS l
|
||||
RETURN l[-2..-2] as in
|
||||
RETURN l[-2..-2] as x
|
||||
"""
|
||||
Then the result should be, in order:
|
||||
| in |
|
||||
| x |
|
||||
| [] |
|
||||
|
||||
Scenario: Slice test6
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, 2, 3, 4] AS l
|
||||
RETURN l[4..-2] as in
|
||||
RETURN l[4..-2] as x
|
||||
"""
|
||||
Then the result should be, in order:
|
||||
| in |
|
||||
| x |
|
||||
| [] |
|
||||
|
||||
|
||||
Scenario: Concatenate test1
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, 2, 3, 4] AS l1, [5, 6, 7] AS l2
|
||||
RETURN l1+l2 as in
|
||||
RETURN l1+l2 as x
|
||||
"""
|
||||
Then the result should be, in order:
|
||||
| in |
|
||||
| x |
|
||||
| [1, 2, 3, 4, 5, 6, 7] |
|
||||
|
||||
Scenario: Concatenate test2
|
||||
When executing query:
|
||||
"""
|
||||
WITH [[1, [2]]] AS l1, [[[3], 4]] AS l2
|
||||
RETURN l1+l2 as in
|
||||
RETURN l1+l2 as x
|
||||
"""
|
||||
Then the result should be, in order:
|
||||
| in |
|
||||
| x |
|
||||
| [[1, [2]], [[3], 4]] |
|
||||
|
||||
|
||||
Scenario: Concatenate test3
|
||||
When executing query:
|
||||
"""
|
||||
WITH [1, 2, 3, 4] AS l1, NULL AS l2
|
||||
RETURN l1+l2 as in
|
||||
RETURN l1+l2 as x
|
||||
"""
|
||||
Then the result should be, in order:
|
||||
| in |
|
||||
| x |
|
||||
| null |
|
||||
|
||||
|
||||
Scenario: Concatenate test4
|
||||
When executing query:
|
||||
"""
|
||||
WITH [] AS l1, [] AS l2
|
||||
RETURN l1+l2 as in
|
||||
RETURN l1+l2 as x
|
||||
"""
|
||||
Then the result should be, in order:
|
||||
| in |
|
||||
| x |
|
||||
| [] |
|
||||
|
||||
Scenario: Unwind test
|
||||
|
@ -39,20 +39,20 @@ Feature: Memgraph only tests (queries in which we choose to be incompatible with
|
||||
When executing query:
|
||||
"""
|
||||
WITH [[1], 2, 3, 4] AS l
|
||||
RETURN 1 IN l as in
|
||||
RETURN 1 IN l as x
|
||||
"""
|
||||
Then the result should be:
|
||||
| in |
|
||||
| x |
|
||||
| false |
|
||||
|
||||
Scenario: In test8
|
||||
When executing query:
|
||||
"""
|
||||
WITH [[[[1]]], 2, 3, 4] AS l
|
||||
RETURN 1 IN l as in
|
||||
RETURN 1 IN l as x
|
||||
"""
|
||||
Then the result should be:
|
||||
| in |
|
||||
| x |
|
||||
| false |
|
||||
|
||||
Scenario: Keyword as symbolic name
|
||||
|
@ -53,7 +53,7 @@ Feature: Update clauses
|
||||
Given an empty graph
|
||||
And having executed
|
||||
"""
|
||||
CREATE (:q{name: 'Sinisa', x: 'y'})-[:X]->({name: 'V', desc: 'Traktor'})
|
||||
CREATE (:q{name: 'Sinisa', x: 'y'})-[:X]->({name: 'V', o: 'Traktor'})
|
||||
"""
|
||||
When executing query:
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user