summaryrefslogtreecommitdiff
path: root/stdout-and-$3/all.do
diff options
context:
space:
mode:
authorNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2018-10-18 17:10:03 +0200
committerNils Dagsson Moskopp <nils@dieweltistgarnichtso.net>2018-10-18 17:10:03 +0200
commit0703144d9083cc23a38fe6e49e532f0bdddef22b (patch)
treeaad970124010be119c17370a431c8aea34c31b0c /stdout-and-$3/all.do
parentba56beab291152581e2e525f42247f01200dfe9a (diff)
+ test handling of dofiles that write to $3 or stdout
Diffstat (limited to 'stdout-and-$3/all.do')
-rw-r--r--stdout-and-$3/all.do14
1 files changed, 14 insertions, 0 deletions
diff --git a/stdout-and-$3/all.do b/stdout-and-$3/all.do
index a6d65eb..767863e 100644
--- a/stdout-and-$3/all.do
+++ b/stdout-and-$3/all.do
@@ -1,4 +1,18 @@
#!/bin/sh
+[ -e stdout ] && rm stdout
+redo-ifchange stdout
+read -r STDOUT <stdout
+[ "${STDOUT}" = "stdout" ] \
+ && printf >&2 'PASS: Write to stdout possible.\n' \
+ || printf >&2 'FAIL: Write to stdout impossible.\n'
+
+[ -e param3 ] && rm param3
+redo-ifchange param3
+read -r PARAM3 <param3
+[ "${PARAM3}" = "param3" ] \
+ && printf >&2 'PASS: Write to $3 possible.\n' \
+ || printf >&2 'FAIL: Write to $3 impossible.\n'
+
redo-ifchange bogus \
&& printf >&2 'FAIL: Write to $3 and stdout possible.\n' \
|| printf >&2 'PASS: Write to $3 and stdout impossible.\n'