Results for builtin-bracket.test.sh

statusoshosh_.pyosh_.cc
pass 433315
FAIL 01028
total434343
caseoshosh_.pyosh_.ccdescription
0pass pass pass zero args: [ ]
1pass pass pass one arg: [ x ] where x is one of '=' '!' '(' ']'
2pass pass pass one arg: empty string is false. Equivalent to -n.
3pass pass FAIL -a as unary operator (alias of -e)
details
4pass pass pass two args: -z with = ! ( ]
5pass pass FAIL three args
details
6pass pass pass four args
7pass pass FAIL test with extra args is syntax error
details
8pass pass pass ] syntax errors
9pass pass pass -n
10pass pass FAIL ! -a
details
11pass pass FAIL -o
details
12pass pass FAIL ( )
details
13pass pass FAIL ( ) ! -a -o with system version of [
details
14pass pass pass == is alias for =
15pass pass pass == and = does not do glob
16pass pass pass [ with op variable
17pass pass FAIL [ with unquoted empty var
details
18pass pass pass [ compare with literal -f
19pass pass FAIL [ '(' foo ] is runtime syntax error
details
20pass pass FAIL -z '>' implies two token lookahead
details
21pass pass FAIL operator/operand ambiguity with ]
details
22pass pass FAIL operator/operand ambiguity with -a
details
23pass pass FAIL -d
details
24pass FAIL FAIL -x
detailsdetails
25pass FAIL FAIL -r
detailsdetails
26pass FAIL FAIL -w
detailsdetails
27pass pass FAIL -k for sticky bit
details
28pass FAIL FAIL -h and -L test for symlink
detailsdetails
29pass pass FAIL -t 1 for stdout
details
30pass pass pass [ -t invalid ]
31pass FAIL FAIL -ot and -nt
detailsdetails
32pass pass pass [ a -eq b ]
33pass FAIL FAIL test -s
detailsdetails
34pass pass FAIL test -b -c -S (block, character, socket)
details
35pass FAIL FAIL test -p named pipe
detailsdetails
36pass FAIL FAIL -G and -O for effective user ID and group ID
detailsdetails
37pass FAIL FAIL -u for setuid, -g too
detailsdetails
38pass pass pass -v to test variable
39pass pass pass test -o for options
40pass pass FAIL -nt -ot
details
41pass FAIL FAIL -ef
detailsdetails
42pass pass FAIL Overflow error
details
91 passed, 0 OK, 0 not implemented, 0 BUG, 38 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

osh_.cc3 -a as unary operator (alias of -e)

[osh_.cc stdout] Expected 'status=0\nstatus=1\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/osh_bool_stat.h:18: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str *): Assertion `0' failed.
osh_.cc5 three args

[osh_.cc stdout] Expected 'status=1\nstatus=1\nstatus=0\nstatus=0\nstatus=0\n', got ''
[osh_.cc status] Expected 0, got -4

stdout:
stderr: 
osh_.cc7 test with extra args is syntax error

[osh_.cc stdout] Expected 'status=2\nstatus=2\n', got ''
[osh_.cc status] Expected 0, got -4

stdout:
stderr: 
osh_.cc10 ! -a

[osh_.cc stdout] Expected 'status=0\n', got 'status=2\n'

stdout:
status=2
stderr:
  [ -z '' -a ! -z x ]
             ^
[ stdin ]:1: (test) Unexpected token in boolean expression
osh_.cc11 -o

[osh_.cc stdout] Expected 'status=0\n', got 'status=2\n'

stdout:
status=2
stderr:
  [ -z x -o ! -z x ]
            ^
[ stdin ]:1: (test) Unexpected token in boolean expression
osh_.cc12 ( )

[osh_.cc stdout] Expected 'status=0\n', got 'status=2\n'

stdout:
status=2
stderr:
  [ -z '' -a '(' ! -z x ')' ]
             ^
[ stdin ]:1: (test) Unexpected token in boolean expression
osh_.cc13 ( ) ! -a -o with system version of [

[osh_.cc stdout] Expected 'true\n', got ''
[osh_.cc status] Expected 0, got 2

stdout:
stderr: 
  command [ --version
          ^
[ stdin ]:1: missing closing ]
  command [ -z '' -a '(' ! -z x ')' ] && echo true
                     ^
[ stdin ]:2: (test) Unexpected token in boolean expression
osh_.cc17 [ with unquoted empty var

[osh_.cc status] Expected 2, got -4

stdout:
stderr: 
osh_.cc19 [ '(' foo ] is runtime syntax error

[osh_.cc stdout] Expected 'status=2\n', got ''
[osh_.cc status] Expected 0, got -4

stdout:
stderr: 
osh_.cc20 -z '>' implies two token lookahead

[osh_.cc stdout] Expected 'true\nfalse\ntrue\n', got 'true\nfalse\n'
[osh_.cc status] Expected 0, got 1

stdout:
true
false
stderr:
osh_.cc21 operator/operand ambiguity with ]

[osh_.cc stdout] Expected 'status=0\n', got ''
[osh_.cc status] Expected 0, got -4

stdout:
stderr: 
osh_.cc22 operator/operand ambiguity with -a

[osh_.cc stdout] Expected 'status=0\n', got ''
[osh_.cc status] Expected 0, got -4

stdout:
stderr: 
osh_.cc23 -d

[osh_.cc stdout] Expected 'status=0\nstatus=1\n', got 'status=0\n'
[osh_.cc status] Expected 0, got -6

stdout:
status=0
stderr:
osh_eval.dbg: cpp/osh_bool_stat.h:18: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str *): Assertion `0' failed.
osh_.py24 -x

[osh_.py stdout] Expected 'no\nyes\nbad\n', got 'echo hi\nno\nbad\n'

stdout:
echo hi
no
bad
stderr:
chmod: cannot access '/x': No such file or directory
osh_.cc24 -x

[osh_.cc stdout] Expected 'no\nyes\nbad\n', got "(cmd_value.Argv argv:[rm -f '/x'] arg_spids:[0 2 4])\necho hi\n"
[osh_.cc status] Expected 0, got -6

stdout:
(cmd_value.Argv argv:[rm -f '/x'] arg_spids:[0 2 4])
echo hi
stderr:
Unhandled SimpleCommand
osh_eval.dbg: cpp/osh_bool_stat.h:18: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str *): Assertion `0' failed.
osh_.py25 -r

[osh_.py stdout] Expected 'yes\nno\n', got '1\n2\nno\n'

stdout:
1
2
no
stderr:
chmod: cannot access '/testr_no': No such file or directory
osh_.cc25 -r

[osh_.cc stdout] Expected 'yes\nno\n', got "1\n2\n(cmd_value.Argv argv:[chmod -r '/testr_no'] arg_spids:[22 24 26])\n"
[osh_.cc status] Expected 0, got -6

stdout:
1
2
(cmd_value.Argv argv:[chmod -r '/testr_no'] arg_spids:[22 24 26])
stderr:
Unhandled SimpleCommand
osh_eval.dbg: cpp/osh_bool_stat.h:18: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str *): Assertion `0' failed.
osh_.py26 -w

[osh_.py stdout] Expected 'yes\nno\n', got '1\n2\nno\n'

stdout:
1
2
no
stderr:
chmod: cannot access '/testw_no': No such file or directory
osh_.cc26 -w

[osh_.cc stdout] Expected 'yes\nno\n', got "(cmd_value.Argv argv:[rm -f '/testw_*'] arg_spids:[0 2 4])\n1\n2\n(cmd_value.Argv argv:[chmod -w '/testw_no'] arg_spids:[30 32 34])\n"
[osh_.cc status] Expected 0, got -6

stdout:
(cmd_value.Argv argv:[rm -f '/testw_*'] arg_spids:[0 2 4])
1
2
(cmd_value.Argv argv:[chmod -w '/testw_no'] arg_spids:[30 32 34])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_eval.dbg: cpp/osh_bool_stat.h:18: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str *): Assertion `0' failed.
osh_.cc27 -k for sticky bit

[osh_.cc stdout] Expected 'status=0\nstatus=1\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/osh_bool_stat.h:18: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str *): Assertion `0' failed.
osh_.py28 -h and -L test for symlink

[osh_.py stdout] Expected 'no\nno\nis-file\nsymlink\nsymlink\ndangling\ndangling\ndangling is not file\n', got 'no\nno\ndangling is not file\n'

stdout:
no
no
dangling is not file
stderr:
mkdir: cannot create directory ‘/builtin-test-1’: Permission denied
touch: cannot touch '/builtin-test-1/zz': No such file or directory
ln: failed to create symbolic link '/builtin-test-1/symlink': No such file or directory
ln: failed to create symbolic link '/builtin-test-1/dangling': No such file or directory
osh_.cc28 -h and -L test for symlink

[osh_.cc stdout] Expected 'no\nno\nis-file\nsymlink\nsymlink\ndangling\ndangling\ndangling is not file\n', got "(cmd_value.Argv argv:[mkdir -p '/builtin-test-1'] arg_spids:[4 6 8])\n(cmd_value.Argv argv:[touch '/builtin-test-1/zz'] arg_spids:[10 12])\n(cmd_value.Argv\n argv: [ln -s -f '/builtin-test-1/zz' '/builtin-test-1/symlink']\n arg_spids: [15 17 19 21 24]\n)\n(cmd_value.Argv\n argv: [ln -s -f '/builtin-test-1/__nonexistent_ZZ__' '/builtin-test-1/dangling']\n arg_spids: [27 29 31 33 36]\n)\n"
[osh_.cc status] Expected 0, got -6

stdout:
(cmd_value.Argv argv:[mkdir -p '/builtin-test-1'] arg_spids:[4 6 8])
(cmd_value.Argv argv:[touch '/builtin-test-1/zz'] arg_spids:[10 12])
(cmd_value.Argv
  argv: [ln -s -f '/builtin-test-1/zz' '/builtin-test-1/symlink']
  arg_spids: [15 17 19 21 24]
)
(cmd_value.Argv
  argv: [ln -s -f '/builtin-test-1/__nonexistent_ZZ__' '/builtin-test-1/dangling']
  arg_spids: [27 29 31 33 36]
)
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_eval.dbg: cpp/osh_bool_stat.h:18: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str *): Assertion `0' failed.
osh_.cc29 -t 1 for stdout

[osh_.cc stdout] Expected 'status=1\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/osh_bool_stat.h:14: bool bool_stat::isatty(int, Str *, syntax_asdl::word_t *): Assertion `0' failed.
osh_.py31 -ot and -nt

[osh_.py stdout] Expected 'older\nnot newer\nnot older than itself\nnot newer than itself\n', got 'not newer\nnot older than itself\nnot newer than itself\n'

stdout:
not newer
not older than itself
not newer than itself
stderr:
touch: cannot touch '/x': Permission denied
touch: missing file operand
Try 'touch --help' for more information.
osh_.cc31 -ot and -nt

[osh_.cc stdout] Expected 'older\nnot newer\nnot older than itself\nnot newer than itself\n', got "(cmd_value.Argv argv:[touch -d '2017/12/31' '/x'] arg_spids:[0 2 4 6])\n(cmd_value.Argv argv:[touch -d '2018/01/01'] arg_spids:[9 11 13])\n"
[osh_.cc status] Expected 0, got -6

stdout:
(cmd_value.Argv argv:[touch -d '2017/12/31' '/x'] arg_spids:[0 2 4 6])
(cmd_value.Argv argv:[touch -d '2018/01/01'] arg_spids:[9 11 13])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_eval.dbg: cpp/osh_bool_stat.h:22: bool bool_stat::DoBinaryOp(id_kind_asdl::Id_t, Str *, Str *): Assertion `0' failed.
osh_.py33 test -s

[osh_.py stdout] Expected 'status=1\nstatus=1\nstatus=0\n', got 'status=1\nstatus=1\nnonempty\nstatus=1\n'

stdout:
status=1
status=1
nonempty
status=1
stderr:
touch: cannot touch '/empty': Permission denied
osh_.cc33 test -s

[osh_.cc stdout] Expected 'status=1\nstatus=1\nstatus=0\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/osh_bool_stat.h:18: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str *): Assertion `0' failed.
osh_.cc34 test -b -c -S (block, character, socket)

[osh_.cc stdout] Expected '-b\nstatus=1\nstatus=1\n-c\nstatus=1\nstatus=1\n-S\nstatus=1\nstatus=1\n', got '-b\n'
[osh_.cc status] Expected 0, got -6

stdout:
-b
stderr:
osh_eval.dbg: cpp/osh_bool_stat.h:18: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str *): Assertion `0' failed.
osh_.py35 test -p named pipe

[osh_.py stdout] Expected 'status=0\nstatus=1\n', got 'status=1\nstatus=1\n'

stdout:
status=1
status=1
stderr:
mkfifo: cannot create fifo '/fifo': Permission denied
osh_.cc35 test -p named pipe

[osh_.cc stdout] Expected 'status=0\nstatus=1\n', got "(cmd_value.Argv argv:[mkfifo '/fifo'] arg_spids:[0 2])\n"
[osh_.cc status] Expected 0, got -6

stdout:
(cmd_value.Argv argv:[mkfifo '/fifo'] arg_spids:[0 2])
stderr:
Unhandled SimpleCommand
osh_eval.dbg: cpp/osh_bool_stat.h:18: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str *): Assertion `0' failed.
osh_.py36 -G and -O for effective user ID and group ID

[osh_.py stdout] Expected 'status=0\nstatus=1\nstatus=0\nstatus=1\n', got 'status=1\nstatus=1\nstatus=1\nstatus=1\n'

stdout:
status=1
status=1
status=1
status=1
stderr:
osh_.cc36 -G and -O for effective user ID and group ID

[osh_.cc stdout] Expected 'status=0\nstatus=1\nstatus=0\nstatus=1\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/osh_bool_stat.h:18: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str *): Assertion `0' failed.
osh_.py37 -u for setuid, -g too

[osh_.py stdout] Expected 'status=1\nstatus=0\nstatus=1\nstatus=1\n', got 'status=1\n'
[osh_.py status] Expected 0, got 1
[osh_.py stderr] Found 'Traceback (most recent'

stdout:
status=1
stderr:
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 417, in <module>
    status = main(sys.argv)
  File "/home/andy/git/oilshell/oil/bin/osh_eval.py", line 309, in main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 168, in Batch
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags=cmd_flags)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1461, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1341, in _Execute
    status, check_errexit = self._Dispatch(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 547, in _Dispatch
    cmd_val = self.word_ev.EvalWordSequence2(words, allow_assign=True)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1868, in EvalWordSequence2
    self._EvalWordToParts(w, False, part_vals)  # not double quoted
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1455, in _EvalWordToParts
    self._EvalWordPart(p, part_vals, quoted=quoted, is_subst=is_subst)
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1332, in _EvalWordPart
    sv = self._EvalCommandSub(part.child, quoted) # type: part_value_t
  File "/home/andy/git/oilshell/oil/osh/word_eval.py", line 1959, in _EvalCommandSub
    stdout = self.shell_ex.RunCommandSub(node)
AttributeError: 'NoneType' object has no attribute 'RunCommandSub'
osh_.cc37 -u for setuid, -g too

[osh_.cc stdout] Expected 'status=1\nstatus=0\nstatus=1\nstatus=1\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/osh_bool_stat.h:18: bool bool_stat::DoUnaryOp(id_kind_asdl::Id_t, Str *): Assertion `0' failed.
osh_.cc40 -nt -ot

[osh_.cc status] Expected 1, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/osh_bool_stat.h:22: bool bool_stat::DoBinaryOp(id_kind_asdl::Id_t, Str *, Str *): Assertion `0' failed.
osh_.py41 -ef

[osh_.py stdout] Expected 'same\nsame\ndifferent\ndifferent\n', got 'different\ndifferent\n'

stdout:
different
different
stderr:
touch: cannot touch '/left': Permission denied
touch: cannot touch '/right': Permission denied
ln: failed to access '/left': No such file or directory
osh_.cc41 -ef

[osh_.cc stdout] Expected 'same\nsame\ndifferent\ndifferent\n', got "(cmd_value.Argv argv:[touch '/left' '/right'] arg_spids:[8 10 12])\n(cmd_value.Argv argv:[ln -f '/left' '/hardlink'] arg_spids:[14 16 18 21])\n"
[osh_.cc status] Expected 0, got -6

stdout:
(cmd_value.Argv argv:[touch '/left' '/right'] arg_spids:[8 10 12])
(cmd_value.Argv argv:[ln -f '/left' '/hardlink'] arg_spids:[14 16 18 21])
stderr:
Unhandled SimpleCommand
Unhandled SimpleCommand
osh_eval.dbg: cpp/osh_bool_stat.h:22: bool bool_stat::DoBinaryOp(id_kind_asdl::Id_t, Str *, Str *): Assertion `0' failed.
osh_.cc42 Overflow error

[osh_.cc stdout] Expected 'status=2\n', got ''
[osh_.cc status] Expected 0, got -6

stdout:
stderr: 
osh_eval.dbg: cpp/osh_bool_stat.h:14: bool bool_stat::isatty(int, Str *, syntax_asdl::word_t *): Assertion `0' failed.