diff options
author | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2014-01-11 19:31:29 +0000 |
---|---|---|
committer | Peter Stephenson <p.w.stephenson@ntlworld.com> | 2014-01-11 19:31:29 +0000 |
commit | ed44ddad22d2b8476ea72cba46c8847d5f082a87 (patch) | |
tree | 7e53725a3093cf0ed13b4de0992a393d8b4359b6 /Test/B08shift.ztst | |
parent | 8fd6d5766c74da73f9a68c97589c58b5292cab24 (diff) | |
download | zsh-ed44ddad22d2b8476ea72cba46c8847d5f082a87.tar.gz zsh-ed44ddad22d2b8476ea72cba46c8847d5f082a87.tar.xz zsh-ed44ddad22d2b8476ea72cba46c8847d5f082a87.zip |
32246: option "shift -p" pops arguments from end of array
Diffstat (limited to 'Test/B08shift.ztst')
-rw-r--r-- | Test/B08shift.ztst | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/Test/B08shift.ztst b/Test/B08shift.ztst index e69de29bb..0aa922673 100644 --- a/Test/B08shift.ztst +++ b/Test/B08shift.ztst @@ -0,0 +1,33 @@ +# Test the shift builtin. + +%test + + set -- one two three four five six seven eight nine ten + shift + print $* + shift 2 + print $* + shift -p 3 + print $* + shift -p + print $* +0:shifting positional parameters +>two three four five six seven eight nine ten +>four five six seven eight nine ten +>four five six seven +>four five six + + array=(yan tan tether mether pip azer sezar akker conter dick) + shift 2 array + print $array + shift array + print $array + shift -p 3 array + print $array + shift -p array + print $array +0:shifting array +>tether mether pip azer sezar akker conter dick +>mether pip azer sezar akker conter dick +>mether pip azer sezar +>mether pip azer |