Results for nul-bytes.test.sh

statusoshosh-cpp
pass 910
ok 44
FAIL 21
total1515
caseoshosh-cppdescription
0pass pass NUL bytes with echo -e
1pass pass NUL bytes in printf format
2ok ok NUL bytes in printf value (OSH and zsh agree)
detailsdetails
3ok ok NUL bytes with echo $'\0' (OSH and zsh agree)
detailsdetails
4pass pass NUL bytes and IFS splitting
5ok ok NUL bytes with test -n
detailsdetails
6FAIL pass NUL bytes with test -f
details
7ok ok NUL bytes with ${#s} (OSH and zsh agree)
detailsdetails
8pass pass Compare \x00 byte versus \x01 byte - command sub
9pass pass Compare \x00 byte versus \x01 byte - read builtin
10pass pass Compare \x00 byte versus \x01 byte - read -n
11FAIL FAIL Compare \x00 byte versus \x01 byte - mapfile builtin
detailsdetails
12pass pass Strip ops # ## % %% with NUL bytes
13pass pass Issue 2269 Reduction
14pass pass Issue 2269 - Do NUL bytes match ? in ${a#?}
19 passed, 8 OK, 0 not implemented, 0 BUG, 2 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

osh2 NUL bytes in printf value (OSH and zsh agree)

stdout:


stderr:
osh-cpp2 NUL bytes in printf value (OSH and zsh agree)

stdout:


stderr:
osh3 NUL bytes with echo $'\0' (OSH and zsh agree)

stdout:

stderr:
osh-cpp3 NUL bytes with echo $'\0' (OSH and zsh agree)

stdout:

stderr:
osh5 NUL bytes with test -n

stdout:
status=1
status=0
stderr:
osh-cpp5 NUL bytes with test -n

stdout:
status=1
status=0
stderr:
osh6 NUL bytes with test -f

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

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/uke/oil/bin/oils_for_unix.py", line 212, in <module>
    sys.exit(main(sys.argv))
  File "/home/uke/oil/bin/oils_for_unix.py", line 181, in main
    return AppBundleMain(argv)
  File "/home/uke/oil/bin/oils_for_unix.py", line 141, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/uke/oil/core/shell.py", line 1285, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/uke/oil/core/main_loop.py", line 336, in Batch
    was_parsed, status = Batch2(cmd_ev, c_parser, errfmt, cmd_flags=cmd_flags)
  File "/home/uke/oil/core/main_loop.py", line 401, in Batch2
    is_return, is_fatal = cmd_ev.ExecuteAndCatch(node, cmd_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 2328, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/uke/oil/osh/cmd_eval.py", line 2127, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1854, in _Dispatch
    status = self._DoSimple(node, cmd_st)
  File "/home/uke/oil/osh/cmd_eval.py", line 1125, in _DoSimple
    status = self._RunSimpleCommand(cmd_val, cmd_st, run_flags)
  File "/home/uke/oil/osh/cmd_eval.py", line 752, in _RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/vm.py", line 234, in RunSimpleCommand
    run_flags)
  File "/home/uke/oil/core/executor.py", line 572, in _RunSimpleCommand
    return self.RunBuiltin(builtin_id, cmd_val)
  File "/home/uke/oil/core/vm.py", line 252, in RunBuiltin
    return self._RunBuiltinProc(builtin_proc, cmd_val)
  File "/home/uke/oil/core/vm.py", line 262, in _RunBuiltinProc
    status = builtin_proc.Run(cmd_val)
  File "/home/uke/oil/builtin/bracket_osh.py", line 278, in Run
    b = bool_ev.EvalB(bool_node)
  File "/home/uke/oil/osh/sh_expr_eval.py", line 1184, in EvalB
    return bool_stat.DoUnaryOp(op_id, s)
  File "/home/uke/oil/osh/bool_stat.py", line 46, in DoUnaryOp
    st = posix.stat(s)
TypeError: stat() argument 1 must be encoded string without null bytes, not str
osh7 NUL bytes with ${#s} (OSH and zsh agree)

stdout:
empty=0
nul=1
stderr:
osh-cpp7 NUL bytes with ${#s} (OSH and zsh agree)

stdout:
empty=0
nul=1
stderr:
osh11 Compare \x00 byte versus \x01 byte - mapfile builtin

[osh stdout] Expected 'len=2\n 2e\n 2e\n', got 'len=2\n 2e 00 2e\n 2e 00 2e\n'

stdout:
len=2
 2e 00 2e
 2e 00 2e
stderr:
osh-cpp11 Compare \x00 byte versus \x01 byte - mapfile builtin

[osh-cpp stdout] Expected 'len=2\n 2e\n 2e\n', got 'len=2\n 2e 00 2e\n 2e 00 2e\n'

stdout:
len=2
 2e 00 2e
 2e 00 2e
stderr: