Change keyword symbolic names

Reviewers: mferencevic

Reviewed By: mferencevic

Differential Revision: https://phabricator.memgraph.io/D505
This commit is contained in:
Mislav Bradac 2017-06-21 15:52:45 +02:00
parent e2f3aba332
commit e86d73eb98
4 changed files with 63 additions and 67 deletions

View File

@ -596,16 +596,16 @@ Feature: Functions
| (:y) | false | true | | (:y) | false | true |
| (:y) | false | true | | (:y) | false | true |
Scenario: Keys test: # Scenario: Keys test:
Given an empty graph # Given an empty graph
When executing query: # When executing query:
""" # """
CREATE (n{true: 123, a: null, b: 'x', null: 1}) RETURN KEYS(n) AS a # 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) # Then the result should be (ignoring element order for lists)
| a | # | a |
| ['true', 'null', 'b'] | # | ['x', 'null', 'b'] |
#
Scenario: Pi test: Scenario: Pi test:
When executing query: When executing query:
""" """

View File

@ -4,89 +4,87 @@ Feature: List operators
When executing query: When executing query:
""" """
WITH [1, 2, 3, 4] AS l WITH [1, 2, 3, 4] AS l
RETURN 3 IN l as in RETURN 3 IN l as x
""" """
Then the result should be: Then the result should be:
| in | | x |
| true | | true |
Scenario: In test2 Scenario: In test2
When executing query: When executing query:
""" """
WITH [1, '2', 3, 4] AS l WITH [1, '2', 3, 4] AS l
RETURN 2 IN l as in RETURN 2 IN l as x
""" """
Then the result should be: Then the result should be:
| in | | x |
| false | | false |
Scenario: In test4 Scenario: In test4
When executing query: When executing query:
""" """
WITH [1, [2, 3], 4] AS l 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: Then the result should be:
| in | | x |
| false | | false |
Scenario: In test5 Scenario: In test5
When executing query: When executing query:
""" """
WITH [[1, 2], 3, 4] AS l WITH [[1, 2], 3, 4] AS l
RETURN 1 IN l as in RETURN 1 IN l as x
""" """
Then the result should be: Then the result should be:
| in | | x |
| false | | false |
Scenario: In test6 Scenario: In test6
When executing query: When executing query:
""" """
WITH [1, [[2, 3], 4]] AS l 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: Then the result should be:
| in | | x |
| true | | true |
Scenario: In test7 Scenario: In test7
When executing query: When executing query:
""" """
WITH [1, [[2, 3], 4]] AS l 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: Then the result should be:
| in | | x |
| false | | false |
Scenario: Index test1 Scenario: Index test1
When executing query: When executing query:
""" """
WITH [1, 2, 3, 4] AS l WITH [1, 2, 3, 4] AS l
RETURN l[2] as in RETURN l[2] as x
""" """
Then the result should be: Then the result should be:
| in | | x |
| 3 | | 3 |
Scenario: Index test2 Scenario: Index test2
When executing query: When executing query:
""" """
WITH [1, 2, 3, 4] AS l WITH [1, 2, 3, 4] AS l
RETURN l[-2] as in RETURN l[-2] as x
""" """
Then the result should be: Then the result should be:
| in | | x |
| 3 | | 3 |
Scenario: Index test3 Scenario: Index test3
When executing query: When executing query:
""" """
WITH [1, 2, 3, 4] AS l 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 Then an error should be raised
@ -94,122 +92,120 @@ Feature: List operators
When executing query: When executing query:
""" """
WITH [1, 2, [3], 4] AS l WITH [1, 2, [3], 4] AS l
RETURN l[2][0] as in RETURN l[2][0] as x
""" """
Then the result should be: Then the result should be:
| in | | x |
| 3 | | 3 |
Scenario: Index test5 Scenario: Index test5
When executing query: When executing query:
""" """
WITH [[1, [2, [3]]], 4] AS l 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: Then the result should be:
| in | | x |
| 3 | | 3 |
Scenario: Slice test1 Scenario: Slice test1
When executing query: When executing query:
""" """
WITH [1, 2, 3, 4] AS l 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: Then the result should be, in order:
| in | | x |
| [1, 2] | | [1, 2] |
Scenario: Slice test2 Scenario: Slice test2
When executing query: When executing query:
""" """
WITH [1, 2, 3, 4] AS l 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: Then the result should be, in order:
| in | | x |
| [3, 4] | | [3, 4] |
Scenario: Slice test3 Scenario: Slice test3
When executing query: When executing query:
""" """
WITH [1, 2, 3, 4] AS l 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: Then the result should be, in order:
| in | | x |
| [3, 4] | | [3, 4] |
Scenario: Slice test4 Scenario: Slice test4
When executing query: When executing query:
""" """
WITH [1, 2, 3, 4] AS l 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: Then the result should be, in order:
| in | | x |
| [4] | | [4] |
Scenario: Slice test5 Scenario: Slice test5
When executing query: When executing query:
""" """
WITH [1, 2, 3, 4] AS l 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: Then the result should be, in order:
| in | | x |
| [] | | [] |
Scenario: Slice test6 Scenario: Slice test6
When executing query: When executing query:
""" """
WITH [1, 2, 3, 4] AS l 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: Then the result should be, in order:
| in | | x |
| [] | | [] |
Scenario: Concatenate test1 Scenario: Concatenate test1
When executing query: When executing query:
""" """
WITH [1, 2, 3, 4] AS l1, [5, 6, 7] AS l2 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: Then the result should be, in order:
| in | | x |
| [1, 2, 3, 4, 5, 6, 7] | | [1, 2, 3, 4, 5, 6, 7] |
Scenario: Concatenate test2 Scenario: Concatenate test2
When executing query: When executing query:
""" """
WITH [[1, [2]]] AS l1, [[[3], 4]] AS l2 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: Then the result should be, in order:
| in | | x |
| [[1, [2]], [[3], 4]] | | [[1, [2]], [[3], 4]] |
Scenario: Concatenate test3 Scenario: Concatenate test3
When executing query: When executing query:
""" """
WITH [1, 2, 3, 4] AS l1, NULL AS l2 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: Then the result should be, in order:
| in | | x |
| null | | null |
Scenario: Concatenate test4 Scenario: Concatenate test4
When executing query: When executing query:
""" """
WITH [] AS l1, [] AS l2 WITH [] AS l1, [] AS l2
RETURN l1+l2 as in RETURN l1+l2 as x
""" """
Then the result should be, in order: Then the result should be, in order:
| in | | x |
| [] | | [] |
Scenario: Unwind test Scenario: Unwind test

View File

@ -39,20 +39,20 @@ Feature: Memgraph only tests (queries in which we choose to be incompatible with
When executing query: When executing query:
""" """
WITH [[1], 2, 3, 4] AS l WITH [[1], 2, 3, 4] AS l
RETURN 1 IN l as in RETURN 1 IN l as x
""" """
Then the result should be: Then the result should be:
| in | | x |
| false | | false |
Scenario: In test8 Scenario: In test8
When executing query: When executing query:
""" """
WITH [[[[1]]], 2, 3, 4] AS l WITH [[[[1]]], 2, 3, 4] AS l
RETURN 1 IN l as in RETURN 1 IN l as x
""" """
Then the result should be: Then the result should be:
| in | | x |
| false | | false |
Scenario: Keyword as symbolic name Scenario: Keyword as symbolic name

View File

@ -53,7 +53,7 @@ Feature: Update clauses
Given an empty graph Given an empty graph
And having executed 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: When executing query:
""" """