Skip to content

Commit

Permalink
refact: adding more lists in regression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
M4rcxs committed Jul 12, 2023
1 parent 3ab9c6c commit 74bfd24
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 18 deletions.
28 changes: 14 additions & 14 deletions regress/expected/expr.out
Original file line number Diff line number Diff line change
Expand Up @@ -2958,7 +2958,7 @@ ERROR: function ag_catalog.age_tointeger() does not exist
LINE 2: RETURN toInteger()
^
HINT: No function matches the given name and argument types. You might need to add explicit type casts.
-- toIntegerList()
! -- toIntegerList()
! SELECT * FROM cypher('expr', $$
! RETURN toIntegerList([1, 7.8, 9.0, '88'])
! $$) AS (toIntegerList agtype);
Expand Down Expand Up @@ -3001,32 +3001,32 @@ HINT: No function matches the given name and argument types. You might need to
!
! -- should return null
! SELECT * FROM cypher('expr', $$
! RETURN toIntegerList(["false_"])
! RETURN toIntegerList(["false_", 'asdsad', '123k1kdk1'])
! $$) AS (toIntegerList agtype);
! tointegerlist
! ---------------
! [null]
! tointegerlist
! --------------------
! [null, null, null]
! (1 row)
!
! SELECT * FROM cypher('expr', $$
! RETURN toIntegerList([null])
! RETURN toIntegerList([null, ['A', 'B'], 'one'])
! $$) AS (toIntegerList agtype);
! tointegerlist
! ---------------
! [null]
! tointegerlist
! --------------------
! [null, null, null]
! (1 row)
!
! -- should fail
! SELECT * FROM cypher('expr', $$
! RETURN toIntegerList(123)
! RETURN toIntegerList(123, '123')
! $$) AS (toIntegerList agtype);
! ERROR: toIntegerList() argument must resolve to a list or null
! SELECT * FROM cypher('expr', $$
! RETURN toIntegerList([;])
! RETURN toIntegerList([12]12)
! $$) AS (toIntegerList agtype);
! ERROR: syntax error at or near ";"
! LINE 2: RETURN toIntegerList([;])
! ^
! ERROR: syntax error at or near "12"
! LINE 2: RETURN toIntegerList([12]12)
!
-- length() of a path
SELECT * FROM cypher('expr', $$
RETURN length([{id: 0, label: "vertex 0", properties: {}}::vertex, {id: 2, label: "edge 0", end_id: 1, start_id: 0, properties: {}}::edge, {id: 1, label: "vertex 1", properties: {}}::vertex]::path)
Expand Down
8 changes: 4 additions & 4 deletions regress/sql/expr.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1346,17 +1346,17 @@ SELECT * FROM cypher('expr', $$
$$) AS (toIntegerList agtype);
-- should return null
SELECT * FROM cypher('expr', $$
RETURN toIntegerList(["false_"])
RETURN toIntegerList(["false_", 'asdsad', '123k1kdk1'])
$$) AS (toIntegerList agtype);
SELECT * FROM cypher('expr', $$
RETURN toIntegerList([null])
RETURN toIntegerList([null, ['A', 'B'], 'one'])
$$) AS (toIntegerList agtype);
-- should fail
SELECT * FROM cypher('expr', $$
RETURN toIntegerList(123)
RETURN toIntegerList(123, '123')
$$) AS (toIntegerList agtype);
SELECT * FROM cypher('expr', $$
RETURN toIntegerList([;])
RETURN toIntegerList([12]12)
$$) AS (toIntegerList agtype);
-- length() of a path
SELECT * FROM cypher('expr', $$
Expand Down

0 comments on commit 74bfd24

Please sign in to comment.