Results for redirect-command.test.sh

statusoshosh-cpp
pass 2318
FAIL 05
total2323
caseoshosh-cppdescription
0pass pass >$file touches a file
1pass FAIL $(< $file) yields the contents of the file
details
2pass pass `< $file` behaves like $(< file)
3pass FAIL $(< file; end) is not a special case
details
4pass pass < file in pipeline and subshell doesn't work
5pass pass Leading redirect in a simple command
6pass pass Redirect in the middle of a simple command
7pass FAIL Redirect in command sub
details
8pass pass Redirect in the middle of two assignments
9pass FAIL Redirect in assignment
details
10pass pass Redirect in function body
11pass pass Redirect in function body is evaluated multiple times
12pass pass Redirect in function body AND function call
13pass pass redirect bash extensions: [[ (( for ((
14pass pass redirect if
15pass pass redirect case
16pass pass redirect while
17pass FAIL redirect for loop
details
18pass pass redirect subshell
19pass pass Prefix redirect for loop -- not allowed
20pass pass Brace group redirect
21pass pass Redirect function stdout
22pass pass Nested function stdout redirect
41 passed, 0 OK, 0 not implemented, 0 BUG, 0 failed, 0 timeouts, 0 cases skipped

Details on runs that didn't PASS

osh-cpp1 $(< $file) yields the contents of the file

[osh-cpp stdout] Expected "['2\\n3']\n" Got ''
[osh-cpp status] Expected 0 Got 2

stdout:
stderr: 
  foo=$(< myfile)
                ^
[ stdin ]:2: Invalid word while parsing command list
osh-cpp3 $(< file; end) is not a special case

[osh-cpp stdout] Expected 'begin\n---\nend\n---\n\n---\n' Got ''
[osh-cpp status] Expected 0 Got 2

stdout:
stderr: 
  foo=$(echo begin; < myfile)
                            ^
[ stdin ]:4: Invalid word while parsing command list
osh-cpp7 Redirect in command sub

[osh-cpp stdout] Expected '\n' Got ''
[osh-cpp stderr] Expected 'foo\n' Got ' FOO=$(echo foo 1>&2)\n ^\n[ stdin ]:1: Invalid word while parsing command list\n'
[osh-cpp status] Expected 0 Got 2

stdout:
stderr: 
  FOO=$(echo foo 1>&2)
                     ^
[ stdin ]:1: Invalid word while parsing command list
osh-cpp9 Redirect in assignment

[osh-cpp stdout] Expected 'FILE=\nfoo\nFOO=\n' Got ''
[osh-cpp status] Expected 0 Got 2

stdout:
stderr: 
  FOO=$(echo foo 1>&2) 2>$TMP/no-command.txt
                     ^
[ stdin ]:1: Invalid word while parsing command list
osh-cpp17 redirect for loop

[osh-cpp stdout] Expected '1\n2\n3\n' Got ''
[osh-cpp status] Expected 0 Got 2

stdout:
stderr: 
  for i in $(seq 3)
                  ^
[ stdin ]:1: Invalid word while parsing command list