Add a regression test for negative indices and fix a pick/1 test

This commit is contained in:
itchyny authored and Nico Williams committed 2023-08-16 17:49:44 -05:00
1 parent f85c9fcb78
commit 0733fd3d58
3 files changed
+11 -10

No files matched your search

+5 -5
View File
@@ -248,9 +248,9 @@ null
2
3
.[-2]
[.[-4,-3,-2,-1,0,1,2,3]]
[1,2,3]
2
[null,1,2,3,1,2,3,null]
[range(0;10)]
null
@@ -1052,9 +1052,9 @@ pick(first|first)
[[10]]
# negative indices in path expressions (since last/1 is .[-1])
pick(last)
[[10,20],30]
[null,30]
try pick(last) catch .
[1,2]
"Out of bounds negative array index"
#
# Assignment