2
0
Fork 0
mirror of https://github.com/fish-shell/fish-shell synced 2025-01-20 08:54:00 +00:00
fish-shell/tests/checks/zero_based_array.fish
Johannes Altmanninger 1e858eae35 tests: filter control sequences only when interactive
This demonstrates that we only write control sequences when interactive.
2024-04-12 12:28:22 +02:00

34 lines
1.1 KiB
Fish

#RUN: %fish %s
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[ 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
echo $foo[001]
#CHECK: one