mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-22 14:43:55 +08:00
Add more tests for literal zero indexes
This commit is contained in:
parent
5326462116
commit
0a4f80ec41
|
@ -1,16 +1,32 @@
|
|||
#RUN: %fish %s
|
||||
echo $foo[0]
|
||||
echo $foo[ 0 ]
|
||||
echo $foo[ 00 ]
|
||||
#CHECKERR: {{.*}}checks/zero_based_array.fish (line {{\d+}}): array indices start at 1, not 0.
|
||||
#CHECKERR: echo $foo[0]
|
||||
#CHECKERR: ^
|
||||
echo $foo[ 0 ]
|
||||
#CHECKERR: {{.*}}checks/zero_based_array.fish (line {{\d+}}): array indices start at 1, not 0.
|
||||
#CHECKERR: echo $foo[ 0 ]
|
||||
#CHECKERR: ^
|
||||
echo $foo[ 00 ]
|
||||
#CHECKERR: {{.*}}checks/zero_based_array.fish (line {{\d+}}): array indices start at 1, not 0.
|
||||
#CHECKERR: echo $foo[ 00 ]
|
||||
#CHECKERR: ^
|
||||
echo $foo[+0]
|
||||
#CHECKERR: {{.*}}checks/zero_based_array.fish (line {{\d+}}): array indices start at 1, not 0.
|
||||
#CHECKERR: echo $foo[+0]
|
||||
#CHECKERR: ^
|
||||
echo $foo[-0]
|
||||
#CHECKERR: {{.*}}checks/zero_based_array.fish (line {{\d+}}): array indices start at 1, not 0.
|
||||
#CHECKERR: echo $foo[-0]
|
||||
#CHECKERR: ^
|
||||
echo $foo[0..1]
|
||||
#CHECKERR: {{.*}}checks/zero_based_array.fish (line {{\d+}}): array indices start at 1, not 0.
|
||||
#CHECKERR: echo $foo[0..1]
|
||||
#CHECKERR: ^
|
||||
echo $foo[1..0]
|
||||
#CHECKERR: {{.*}}checks/zero_based_array.fish (line {{\d+}}): array indices start at 1, not 0.
|
||||
#CHECKERR: echo $foo[1..0]
|
||||
#CHECKERR: ^
|
||||
|
||||
# and make sure these didn't break
|
||||
set -l foo one two three
|
||||
|
|
Loading…
Reference in New Issue
Block a user