Skip to content
Myr

Test negative indices in path expressions

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by pkoppstein · committed by Nico Williams · parent 086a156 · Browse files · 1 file+22 added−0 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+22 added−0 removed

  • tests:+22 added−0 removed

1 file+22 added−0 removed

modified:tests/jq.test+22 added
1000 unmodified lines
1001del(.[1], .[-6], .[2], .[-3:9])1002[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]1003[0, 3, 5, 6, 9]10041005# negative index1006setpath([-1]; 1)1007[0]1008[1]10091010pick(.a.b.c)1011null1012{"a":{"b":{"c":null}}}10131014pick(first)1015[1,2]1016[1]10171018pick(first|first)1019[[10,20],30]1020[[10]]10211022# negative indices in path expressions (since last/1 is .[-1])1023pick(last)1024[[10,20],30]1025[null,30]10261027#1028# Assignment1029#1030.message = "goodbye"
940 unmodified lines