Results for redirect.test.sh

casedashbashmkshoshosh_ALTdescription
0pass pass pass pass pass Leading redirect
1ok pass pass pass pass Nonexistent file
details
2pass pass pass pass pass No command
3pass pass pass pass pass Redirect in subshell
4pass BUG pass pass pass Redirect in assignment
details
5pass pass pass pass pass Redirect in function body.
6N-I pass pass pass pass Redirect in function body is evaluated multiple times
details
7pass pass pass pass pass Redirect in function body AND function call
8pass pass pass pass pass Descriptor redirect with spaces
9pass pass pass pass pass Filename redirect with spaces
10pass pass pass pass pass Quoted filename redirect with spaces
11ok BUG pass FAIL FAIL Descriptor redirect with filename
detailsdetailsdetailsdetails
12pass pass pass pass pass redirect for loop
13pass pass pass pass pass redirect subshell
14pass pass ok FAIL FAIL Prefix redirect for loop -- not allowed
detailsdetailsdetails
15pass pass pass pass pass Brace group redirect
16pass pass pass pass pass Redirect echo to stderr, and then redirect all of stdout somewhere.
17pass pass pass pass pass Redirect in the middle of two assignments
18pass pass pass pass pass Redirect in the middle of a command
19N-I pass N-I FAIL FAIL Named file descriptor
detailsdetailsdetailsdetails
20pass pass pass pass pass Redirect function stdout
21pass pass pass pass pass Nested function stdout redirect
22ok pass pass FAIL FAIL Redirect to empty string
detailsdetailsdetails
23ok pass pass pass pass Redirect to file descriptor that's not open
details
24pass pass pass pass pass Open descriptor with exec
25pass pass pass pass pass Open multiple descriptors with exec
26ok pass pass FAIL FAIL >| to clobber
detailsdetailsdetails
27N-I pass pass FAIL FAIL &> redirects stdout and stderr
detailsdetailsdetails
28N-I pass N-I FAIL FAIL 1>&2- to close file descriptor
detailsdetailsdetailsdetails
29pass pass pass FAIL FAIL <> for read/write
detailsdetails

120 passed, 6 ok, 6 known unimplemented, 2 known bugs, 8 failed, 0 skipped

Details on runs that didn't PASS

dash1 Nonexistent file

stdout:
status=2
stderr:
/bin/dash: 1: cannot open /home/andy/git/oil/test/../_tmp/spec-tmp/nonexistent.txt: No such file
bash4 Redirect in assignment

stdout:
FILE=
FOO=
stderr:
foo
dash6 Redirect in function body is evaluated multiple times

stdout:
stderr: 
/bin/dash: 2: arithmetic expression: expecting primary: "i++"
dash11 Descriptor redirect with filename

stdout:
stderr: 
/bin/dash: 2: Syntax error: Bad fd number
bash11 Descriptor redirect with filename

stdout:
status=0
stderr:
osh11 Descriptor redirect with filename

[osh stdout] Expected 'status=1\n', got 'one\nstatus=0\n'

stdout:
one
status=0
stderr:
osh warning: Redirect descriptor should look like an integer, got (Str s:/home/andy/git/oil/test/../_tmp/spec-tmp/nonexistent-filename__)
osh_ALT11 Descriptor redirect with filename

[osh_ALT stdout] Expected 'status=1\n', got 'one\nstatus=0\n'

stdout:
one
status=0
stderr:
osh warning: Redirect descriptor should look like an integer, got (Str s:/home/andy/git/oil/test/../_tmp/spec-tmp/nonexistent-filename__)
mksh14 Prefix redirect for loop -- not allowed

stdout:
stderr: 
/bin/mksh: <stdin>[1]: for: not found
/bin/mksh: <stdin>[2]: syntax error: 'do' unexpected
osh14 Prefix redirect for loop -- not allowed

[osh status] Expected 2, got 127

stdout:
stderr: 
Unexpected error in execvpe('for', ['for', 'i', 'in', '1', '2', '3'], ...): [Errno 2] No such file or directory
osh_ALT14 Prefix redirect for loop -- not allowed

[osh_ALT status] Expected 2, got 127

stdout:
stderr: 
Unexpected error in execvpe('for', ['for', 'i', 'in', '1', '2', '3'], ...): [Errno 2] No such file or directory
dash19 Named file descriptor

stdout:
stderr: 
/bin/dash: 1: exec: {myfd}: not found
mksh19 Named file descriptor

stdout:
stderr: 
/bin/mksh: <stdin>[1]: {myfd}: not found
osh19 Named file descriptor

[osh stdout] Expected 'named-fd-contents\n', got ''
[osh status] Expected 0, got 127

stdout:
stderr: 
Unexpected error in execvpe('{myfd}', ['{myfd}'], ...): [Errno 2] No such file or directory
osh_ALT19 Named file descriptor

[osh_ALT stdout] Expected 'named-fd-contents\n', got ''
[osh_ALT status] Expected 0, got 127

stdout:
stderr: 
Unexpected error in execvpe('{myfd}', ['{myfd}'], ...): [Errno 2] No such file or directory
dash22 Redirect to empty string

stdout:
result=2
stderr:
/bin/dash: 2: cannot create : Directory nonexistent
/bin/dash: 5: cannot create : Directory nonexistent
osh22 Redirect to empty string

[osh stdout] Expected 'result=1\n', got 's\nresult=0\ns\nDONE\n'
[osh status] Expected 1, got 0

stdout:
s
result=0
s
DONE
stderr:
osh warning: Redirect filename can't be empty
osh warning: Redirect filename can't be empty
osh_ALT22 Redirect to empty string

[osh_ALT stdout] Expected 'result=1\n', got 's\nresult=0\ns\nDONE\n'
[osh_ALT status] Expected 1, got 0

stdout:
s
result=0
s
DONE
stderr:
osh warning: Redirect filename can't be empty
osh warning: Redirect filename can't be empty
dash23 Redirect to file descriptor that's not open

stdout:
stderr: 
/bin/dash: 1: 9: Bad file descriptor
dash26 >| to clobber

stdout:
status=2
XX
ZZ
stderr:
/bin/dash: 3: cannot create /home/andy/git/oil/test/../_tmp/spec-tmp/c.txt: File exists
osh26 >| to clobber

[osh stdout] Expected u'status=1\nXX\nZZ\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 440, in <module>
    main(sys.argv)
  File "bin/osh", line 427, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 410, in OilMain
    status = OshMain(main_argv)
  File "bin/osh", line 373, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 892, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 856, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 674, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 885, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 854, in _Execute
    if self.fd_state.Push(redirects, self.waiter):
  File "/home/andy/git/oil/bin/../core/process.py", line 177, in Push
    if not self._ApplyRedirect(r, waiter):
  File "/home/andy/git/oil/bin/../core/process.py", line 111, in _ApplyRedirect
    raise NotImplementedError(r.op_id)
NotImplementedError: Redir_Clobber
osh_ALT26 >| to clobber

[osh_ALT stdout] Expected u'status=1\nXX\nZZ\n', got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/andy/git/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/andy/git/oil/bin/oil.py", line 440, in <module>
    main(sys.argv)
  File "/home/andy/git/oil/bin/oil.py", line 427, in main
    sys.exit(OilMain(argv))
  File "/home/andy/git/oil/bin/oil.py", line 410, in OilMain
    status = OshMain(main_argv)
  File "/home/andy/git/oil/bin/oil.py", line 373, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 892, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 856, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 674, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 885, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 854, in _Execute
    if self.fd_state.Push(redirects, self.waiter):
  File "/home/andy/git/oil/bin/../core/process.py", line 177, in Push
    if not self._ApplyRedirect(r, waiter):
  File "/home/andy/git/oil/bin/../core/process.py", line 111, in _ApplyRedirect
    raise NotImplementedError(r.op_id)
NotImplementedError: Redir_Clobber
dash27 &> redirects stdout and stderr

stdout:
STDOUT
stderr:
STDERR
osh27 &> redirects stdout and stderr

[osh stdout] Expected u'ok\nok\n', got 'STDOUT\n'
[osh status] Expected 0, got 1

stdout:
STDOUT
stderr:
Started background job with pid 10668
STDERR
osh_ALT27 &> redirects stdout and stderr

[osh_ALT stdout] Expected u'ok\nok\n', got 'STDOUT\n'
[osh_ALT status] Expected 0, got 1

stdout:
STDOUT
stderr:
Started background job with pid 10706
STDERR
dash28 1>&2- to close file descriptor

stdout:
stderr: 
/bin/dash: 2: Syntax error: Bad fd number
mksh28 1>&2- to close file descriptor

stdout:
stderr: 
/bin/mksh: <stdin>[1]: >&2- : illegal file descriptor name
osh28 1>&2- to close file descriptor

[osh stdout] Expected u'', got 'hi\n'

stdout:
hi
stderr:
osh warning: Redirect descriptor should look like an integer, got (Str s:2-)
osh_ALT28 1>&2- to close file descriptor

[osh_ALT stdout] Expected u'', got 'hi\n'

stdout:
hi
stderr:
osh warning: Redirect descriptor should look like an integer, got (Str s:2-)
osh29 <> for read/write

[osh stdout] Expected u'line=first\nCONTENTS\nfirst\nsecond\n', got ''
[osh status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "bin/osh", line 440, in <module>
    main(sys.argv)
  File "bin/osh", line 427, in main
    sys.exit(OilMain(argv))
  File "bin/osh", line 410, in OilMain
    status = OshMain(main_argv)
  File "bin/osh", line 373, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 892, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 856, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 674, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 885, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 854, in _Execute
    if self.fd_state.Push(redirects, self.waiter):
  File "/home/andy/git/oil/bin/../core/process.py", line 177, in Push
    if not self._ApplyRedirect(r, waiter):
  File "/home/andy/git/oil/bin/../core/process.py", line 111, in _ApplyRedirect
    raise NotImplementedError(r.op_id)
NotImplementedError: Redir_LessGreat
osh_ALT29 <> for read/write

[osh_ALT stdout] Expected u'line=first\nCONTENTS\nfirst\nsecond\n', got ''
[osh_ALT status] Expected 0, got 1

stdout:
stderr: 
Traceback (most recent call last):
  File "/home/andy/git/oil/Python-2.7.13/Lib/runpy.py", line 174, in _run_module_as_main
    "__main__", fname, loader, pkg_name)
  File "/home/andy/git/oil/Python-2.7.13/Lib/runpy.py", line 72, in _run_code
    exec code in run_globals
  File "/home/andy/git/oil/bin/oil.py", line 440, in <module>
    main(sys.argv)
  File "/home/andy/git/oil/bin/oil.py", line 427, in main
    sys.exit(OilMain(argv))
  File "/home/andy/git/oil/bin/oil.py", line 410, in OilMain
    status = OshMain(main_argv)
  File "/home/andy/git/oil/bin/oil.py", line 373, in OshMain
    status = ex.Execute(node)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 892, in Execute
    status = self._Execute(node, fork_external=fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 856, in _Execute
    status, check_errexit = self._Dispatch(node, fork_external)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 674, in _Dispatch
    status = self._ExecuteList(node.children)
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 885, in _ExecuteList
    status = self._Execute(child)  # last status wins
  File "/home/andy/git/oil/bin/../core/cmd_exec.py", line 854, in _Execute
    if self.fd_state.Push(redirects, self.waiter):
  File "/home/andy/git/oil/bin/../core/process.py", line 177, in Push
    if not self._ApplyRedirect(r, waiter):
  File "/home/andy/git/oil/bin/../core/process.py", line 111, in _ApplyRedirect
    raise NotImplementedError(r.op_id)
NotImplementedError: Redir_LessGreat