Results for nul-bytes.test.sh

statusoshosh-cpp
pass 23
ok 44
FAIL 21
total88
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
4FAIL FAIL NUL bytes and IFS splitting
detailsdetails
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
5 passed, 8 OK, 0 not implemented, 0 BUG, 3 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:
osh4 NUL bytes and IFS splitting

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

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 224, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 199, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 146, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/andy/git/oilshell/oil/core/shell.py", line 830, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 347, 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 1709, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1533, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 752, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, cmd_st, node.do_fork)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 571, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, cmd_st, do_fork)
  File "/home/andy/git/oilshell/oil/core/executor.py", line 316, in RunSimpleCommand
    status = p.RunProcess(self.waiter, trace.External(cmd_val.argv))
  File "/home/andy/git/oilshell/oil/core/process.py", line 1082, in RunProcess
    self.StartProcess(why)
  File "/home/andy/git/oilshell/oil/core/process.py", line 1012, in StartProcess
    self.thunk.Run()
  File "/home/andy/git/oilshell/oil/core/process.py", line 768, in Run
    self.ext_prog.Exec(self.argv0_path, self.cmd_val, self.environ)
  File "/home/andy/git/oilshell/oil/core/process.py", line 653, in Exec
    self._Exec(argv0_path, cmd_val.argv, cmd_val.arg_locs[0], environ, True)
  File "/home/andy/git/oilshell/oil/core/process.py", line 684, in _Exec
    posix.execve(argv0_path, argv, environ)
TypeError: execve() arg 2 must contain only strings
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 224, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 199, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 146, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/andy/git/oilshell/oil/core/shell.py", line 830, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 347, 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 1709, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1533, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 752, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, cmd_st, node.do_fork)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 571, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, cmd_st, do_fork)
  File "/home/andy/git/oilshell/oil/core/executor.py", line 316, in RunSimpleCommand
    status = p.RunProcess(self.waiter, trace.External(cmd_val.argv))
  File "/home/andy/git/oilshell/oil/core/process.py", line 1082, in RunProcess
    self.StartProcess(why)
  File "/home/andy/git/oilshell/oil/core/process.py", line 1012, in StartProcess
    self.thunk.Run()
  File "/home/andy/git/oilshell/oil/core/process.py", line 768, in Run
    self.ext_prog.Exec(self.argv0_path, self.cmd_val, self.environ)
  File "/home/andy/git/oilshell/oil/core/process.py", line 653, in Exec
    self._Exec(argv0_path, cmd_val.argv, cmd_val.arg_locs[0], environ, True)
  File "/home/andy/git/oilshell/oil/core/process.py", line 684, in _Exec
    posix.execve(argv0_path, argv, environ)
TypeError: execve() arg 2 must contain only strings
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 224, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 199, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 146, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/andy/git/oilshell/oil/core/shell.py", line 830, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 347, 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 1709, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1533, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 752, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, cmd_st, node.do_fork)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 571, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, cmd_st, do_fork)
  File "/home/andy/git/oilshell/oil/core/executor.py", line 316, in RunSimpleCommand
    status = p.RunProcess(self.waiter, trace.External(cmd_val.argv))
  File "/home/andy/git/oilshell/oil/core/process.py", line 1082, in RunProcess
    self.StartProcess(why)
  File "/home/andy/git/oilshell/oil/core/process.py", line 1012, in StartProcess
    self.thunk.Run()
  File "/home/andy/git/oilshell/oil/core/process.py", line 768, in Run
    self.ext_prog.Exec(self.argv0_path, self.cmd_val, self.environ)
  File "/home/andy/git/oilshell/oil/core/process.py", line 653, in Exec
    self._Exec(argv0_path, cmd_val.argv, cmd_val.arg_locs[0], environ, True)
  File "/home/andy/git/oilshell/oil/core/process.py", line 684, in _Exec
    posix.execve(argv0_path, argv, environ)
TypeError: execve() arg 2 must contain only strings
Traceback (most recent call last):
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 224, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 199, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 146, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/andy/git/oilshell/oil/core/shell.py", line 830, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 347, 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 1709, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1533, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 752, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, cmd_st, node.do_fork)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 571, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, cmd_st, do_fork)
  File "/home/andy/git/oilshell/oil/core/executor.py", line 316, in RunSimpleCommand
    status = p.RunProcess(self.waiter, trace.External(cmd_val.argv))
  File "/home/andy/git/oilshell/oil/core/process.py", line 1082, in RunProcess
    self.StartProcess(why)
  File "/home/andy/git/oilshell/oil/core/process.py", line 1012, in StartProcess
    self.thunk.Run()
  File "/home/andy/git/oilshell/oil/core/process.py", line 768, in Run
    self.ext_prog.Exec(self.argv0_path, self.cmd_val, self.environ)
  File "/home/andy/git/oilshell/oil/core/process.py", line 653, in Exec
    self._Exec(argv0_path, cmd_val.argv, cmd_val.arg_locs[0], environ, True)
  File "/home/andy/git/oilshell/oil/core/process.py", line 684, in _Exec
    posix.execve(argv0_path, argv, environ)
TypeError: execve() arg 2 must contain only strings
osh-cpp4 NUL bytes and IFS splitting

[osh-cpp stdout] Expected "[]\n['']\n['ab']\n['ab']\n", got "['']\n['']\n['a']\n['a']\n"

stdout:
['']
['']
['a']
['a']
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/andy/git/oilshell/oil/bin/oils_for_unix.py", line 224, in <module>
    sys.exit(main(sys.argv))
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 199, in main
    return AppBundleMain(argv)
  File "/home/andy/git/oilshell/oil/bin/oils_for_unix.py", line 146, in AppBundleMain
    return shell.Main('osh', arg_r, environ, login_shell, loader, readline)
  File "/home/andy/git/oilshell/oil/core/shell.py", line 830, in Main
    cmd_flags=cmd_eval.IsMainProgram)
  File "/home/andy/git/oilshell/oil/core/main_loop.py", line 347, 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 1709, in ExecuteAndCatch
    status = self._Execute(node)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 1533, in _Execute
    status = self._Dispatch(node, cmd_st)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 752, in _Dispatch
    status = self._RunSimpleCommand(cmd_val, cmd_st, node.do_fork)
  File "/home/andy/git/oilshell/oil/osh/cmd_eval.py", line 571, in _RunSimpleCommand
    return self.shell_ex.RunSimpleCommand(cmd_val, cmd_st, do_fork)
  File "/home/andy/git/oilshell/oil/core/executor.py", line 288, in RunSimpleCommand
    return self.RunBuiltin(builtin_id, cmd_val)
  File "/home/andy/git/oilshell/oil/core/executor.py", line 186, in RunBuiltin
    status = builtin_func.Run(cmd_val)
  File "/home/andy/git/oilshell/oil/osh/builtin_bracket.py", line 268, in Run
    b = bool_ev.EvalB(bool_node)
  File "/home/andy/git/oilshell/oil/osh/sh_expr_eval.py", line 933, in EvalB
    return bool_stat.DoUnaryOp(op_id, s)
  File "/home/andy/git/oilshell/oil/osh/bool_stat.py", line 47, 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: