run-file () { local spec_name=$1; shift; local spec_file=spec/$spec_name.test.sh; local suite; suite=$(test/sh_spec.py --print-spec-suite $spec_file); local spec_subdir; case $suite in osh) spec_subdir='osh-cpp' ;; ysh) spec_subdir='ysh-cpp' ;; *) die "Invalid suite $suite" ;; esac; local base_dir=_tmp/spec/$spec_subdir; mkdir -v -p $base_dir; sh-spec $spec_file --timeout 10 --oils-bin-dir $PWD/bin --oils-cpp-bin-dir $REPO_ROOT/_bin/cxx-asan --tsv-output $base_dir/${spec_name}.tsv "$@" } redirect-command: spec test case results

Results for redirect-command.test.sh

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