Permalink
Browse files

Spec test coverage for the &>> operator. (#91)

This redirects both stdout and stderr and appends to a file.
  • Loading branch information...
timetoplatypus authored and andychu committed Mar 22, 2018
1 parent 78c2514 commit dea4f675fc7bcaf72741ce339febb7403579b701
Showing with 16 additions and 1 deletion.
  1. +15 −0 spec/redirect.test.sh
  2. +1 −1 test/spec.sh
View
@@ -277,3 +277,18 @@ echo second 1>&8
echo CONTENTS
cat $TMP/rw.txt
# stdout-json: "line=first\nCONTENTS\nfirst\nsecond\n"
### &>> appends stdout and stderr
echo "ok" > $TMP/f.txt
stdout_stderr.py &>> $TMP/f.txt
grep ok $TMP/f.txt >/dev/null && echo 'ok'
grep STDOUT $TMP/f.txt >/dev/null && echo 'ok'
grep STDERR $TMP/f.txt >/dev/null && echo 'ok'
## STDOUT:
ok
ok
ok
## END
# N-I dash stdout: STDOUT
# N-I dash stderr: STDERR
# N-I dash status: 1
View
@@ -378,7 +378,7 @@ here-doc() {
}
redirect() {
sh-spec spec/redirect.test.sh --osh-failures-allowed 6 \
sh-spec spec/redirect.test.sh --osh-failures-allowed 7 \
${REF_SHELLS[@]} $OSH "$@"
}

0 comments on commit dea4f67

Please sign in to comment.