spec test index / oilshell.org
| case | dash | bash | mksh | osh | description |
| 0 | pass | pass | pass | pass | zero args: [ ] |
| 1 | pass | pass | pass | pass | one arg: [ x ] where x is one of '=' '!' '(' ']' |
| 2 | pass | pass | pass | pass | one arg: empty string is false. Equivalent to -n. |
| 3 | N-I | pass | pass | pass | -a as unary operator (alias of -e) |
| details | |||||
| 4 | pass | pass | pass | pass | two args: -z with = ! ( ] |
| 5 | pass | pass | pass | pass | three args |
| 6 | pass | pass | pass | pass | four args |
| 7 | pass | pass | pass | pass | test with extra args is syntax error |
| 8 | pass | pass | pass | pass | ] syntax errors |
| 9 | pass | pass | pass | pass | -n |
| 10 | pass | pass | pass | pass | ! -a |
| 11 | pass | pass | pass | pass | -o |
| 12 | pass | pass | pass | pass | ( ) |
| 13 | pass | pass | pass | pass | ( ) ! -a -o with system version of [ |
| 14 | BUG | pass | pass | pass | == is alias for = |
| details | |||||
| 15 | N-I | pass | pass | pass | == and = does not do glob |
| details | |||||
| 16 | pass | pass | pass | pass | [ with op variable |
| 17 | pass | pass | pass | pass | [ with unquoted empty var |
| 18 | pass | pass | pass | pass | [ compare with literal -f |
| 19 | pass | pass | pass | pass | [ '(' foo ] is runtime syntax error |
| 20 | pass | pass | pass | pass | -z '>' implies two token lookahead |
| 21 | ok | pass | ok | pass | operator/operand ambiguity with ] |
| details | details | ||||
| 22 | ok | pass | ok | pass | operator/operand ambiguity with -a |
| details | details | ||||
| 23 | pass | pass | pass | pass | -d |
| 24 | pass | pass | pass | pass | -x |
| 25 | pass | pass | pass | pass | -r |
| 26 | pass | pass | pass | pass | -w |
| 27 | pass | pass | pass | pass | -h and -L test for symlink |
| 28 | pass | pass | pass | pass | -t 1 for stdout |
| 29 | pass | BUG | pass | pass | [ -t invalid ] |
| details | |||||
| 30 | pass | pass | pass | pass | -ot and -nt |
| 31 | pass | pass | BUG | pass | [ a -eq b ] |
| details | |||||
| 32 | pass | pass | pass | pass | test -s |
123 passed, 4 ok, 2 known unimplemented, 3 known bugs, 0 failed, 0 skipped
| dash | 3 -a as unary operator (alias of -e) stdout: status=2 status=2stderr: _tmp/spec-bin/dash: 1: [: -a: unexpected operator _tmp/spec-bin/dash: 3: [: -a: unexpected operator |
| dash | 14 == is alias for = stdout: truestderr: _tmp/spec-bin/dash: 2: [: a: unexpected operator |
| dash | 15 == and = does not do glob stdout: status=1 status=2stderr: _tmp/spec-bin/dash: 3: [: abc: unexpected operator |
| dash | 21 operator/operand ambiguity with ] stdout: status=2stderr: _tmp/spec-bin/dash: 1: [: -a: unexpected operator |
| mksh | 21 operator/operand ambiguity with ] stdout: status=2stderr: _tmp/spec-bin/mksh: <stdin>[1]: [: ]: unexpected operator/operand |
| dash | 22 operator/operand ambiguity with -a stdout: status=1stderr: |
| mksh | 22 operator/operand ambiguity with -a stdout: status=2stderr: _tmp/spec-bin/mksh: <stdin>[1]: [: expression expected |
| bash | 29 [ -t invalid ] stdout: status=1stderr: |
| mksh | 31 [ a -eq b ] stdout: status=0stderr: |