Results for redirect.test.sh

statusoshosh-cpp
pass 5252
ok 11
FAIL 22
total5555
caseoshosh-cppdescription
0pass pass >&
1pass pass <&
2pass pass Leading redirect
3pass pass Nonexistent file
4pass pass Redirect in command sub
5pass pass Redirect in assignment
6pass pass Redirect in function body.
7pass pass Redirect in function body is evaluated multiple times
8pass pass Redirect in function body AND function call
9pass pass Descriptor redirect with spaces
10pass pass Filename redirect with spaces
11pass pass Quoted filename redirect with spaces
12pass pass Descriptor redirect with filename
13pass pass redirect for loop
14pass pass redirect subshell
15pass pass Prefix redirect for loop -- not allowed
16pass pass Brace group redirect
17pass pass Redirect echo to stderr, and then redirect all of stdout somewhere.
18pass pass Redirect in the middle of two assignments
19pass pass Redirect in the middle of a command
20pass pass Named file descriptor
21pass pass Double digit fd (20> file)
22pass pass : 9> fdleak (OSH regression)
23pass pass : 3>&3 (OSH regression)
24pass pass : 3>&3-
25pass pass 3>&- << EOF (OSH regression: fail to restore fds)
26pass pass Open file on descriptor 3 and write to it many times
27pass pass Open file on descriptor 4 and write to it many times
28pass pass Redirect function stdout
29pass pass Nested function stdout redirect
30pass pass Redirect to empty string
31pass pass Redirect to file descriptor that's not open
32pass pass Open descriptor with exec
33pass pass Open multiple descriptors with exec
34FAIL FAIL >| to clobber
detailsdetails
35pass pass &> redirects stdout and stderr
36FAIL FAIL >&word redirects stdout and stderr when word is not a number or -
detailsdetails
37pass pass 1>&- to close file descriptor
38pass pass 1>&2- to move file descriptor
39pass pass 1>&2- (Bash bug: fail to restore closed fd)
40pass pass <> for read/write
41pass pass <> for read/write named pipes
42pass pass &>> appends stdout and stderr
43pass pass exec redirect then various builtins
44pass pass >$file touches a file
45pass pass $(< $file) yields the contents of the file
46pass pass $(< file) with more statements
47pass pass < file in pipeline and subshell doesn't work
48pass pass 2>&1 with no command
49pass pass 2&>1 (is it a redirect or is it like a&>1)
50ok ok can't mention big file descriptor
detailsdetails
51pass pass : >/dev/null 2> / (OSH regression: fail to pop fd frame)
52pass pass echo foo >&100 (OSH regression: does not fail with invalid fd 100)
53pass pass echo foo >&N where N is first unused fd
54pass pass exec {fd}>&- (OSH regression: fails to close fd)
104 passed, 2 OK, 0 not implemented, 0 BUG, 4 failed, 0 timeouts, 0 cases skipped
2 failed under osh

Details on runs that didn't PASS

osh34 >| to clobber

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

stdout:
status=0
YY
ZZ
stderr:
osh-cpp34 >| to clobber

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

stdout:
status=0
YY
ZZ
stderr:
osh36 >&word redirects stdout and stderr when word is not a number or -

[osh stdout] Expected 'STDOUT\nSTDERR\n', got ''
[osh status] Expected 0, got 2

stdout:
stderr: 
  stdout_stderr.py >&$tmp
                     ^~~~
[ stdin ]:5: Invalid descriptor 'osh-26054.txt'.  Expected D, -, or D- where D is an integer
grep: osh-26054.txt: No such file or directory
grep: osh-26054.txt: No such file or directory
osh-cpp36 >&word redirects stdout and stderr when word is not a number or -

[osh-cpp stdout] Expected 'STDOUT\nSTDERR\n', got ''
[osh-cpp status] Expected 0, got 2

stdout:
stderr: 
  stdout_stderr.py >&$tmp
                     ^~~~
[ stdin ]:5: Invalid descriptor 'osh-26130.txt'.  Expected D, -, or D- where D is an integer
grep: osh-26130.txt: No such file or directory
grep: osh-26130.txt: No such file or directory
osh50 can't mention big file descriptor

stdout:
hi
hi
hi 100
stderr:
osh-cpp50 can't mention big file descriptor

stdout:
hi
hi
hi 100
stderr: