aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test/script/runner/driver.cxx3
-rw-r--r--tests/test/script/runner/testscript70
2 files changed, 54 insertions, 19 deletions
diff --git a/tests/test/script/runner/driver.cxx b/tests/test/script/runner/driver.cxx
index 940a68c..9eb36a0 100644
--- a/tests/test/script/runner/driver.cxx
+++ b/tests/test/script/runner/driver.cxx
@@ -6,6 +6,7 @@
#include <string>
#include <cassert>
#include <ostream> // endl, *bit
+#include <istream> // istream::traits_type::eof()
#include <iostream>
#include <exception>
@@ -50,7 +51,7 @@ main (int argc, char* argv[])
if (ifd == 0)
cin.ignore (numeric_limits<streamsize>::max ());
- else
+ else if (cin.peek () != istream::traits_type::eof ())
(ifd == 1 ? cout : cerr) << cin.rdbuf ();
}
else if (o == "-o")
diff --git a/tests/test/script/runner/testscript b/tests/test/script/runner/testscript
index 4d5d3b3..89ef6a3 100644
--- a/tests/test/script/runner/testscript
+++ b/tests/test/script/runner/testscript
@@ -1,31 +1,42 @@
-$*
-$* -i 0 <foo
-$* -o foo >foo
-$* -o foo >-
-$* -e foo 2>-
+$* # status-def
+$* == 0 # status-eq-0
+$* -s 1 != 0 # status-ne-0
+$* -s 1 == 1 # status-eq-1
+$* != 1 # status-ne-1
-$* -o foo -o bar >>EOO
+$* -o foo >- # out-null
+$* -e foo 2>- # err-null
+$* -i 0 <foo # in-str
+$* -o foo >foo # out-str
+$* -e foo 2>foo # err-str
+$* -i 1 <foo >foo # inout-str
+$* -i 2 <foo 2>foo # inerr-str
+$* -i 1 -e bar <foo 1>foo 2>bar # inout-err-str
+
+$* -i 0 <<EOO # in-doc
foo
bar
EOO
-$* -i 1 <<EOI >>EOO
+$* -o foo -o bar >>EOO # out-doc
foo
bar
-EOI
+EOO
+
+$* -e foo -e bar 2>>EOO # err-doc
foo
bar
EOO
-$* -i 2 <<EOI 2>>EOE
+$* -i 1 <<EOI >>EOO # inout-doc
foo
bar
EOI
foo
bar
-EOE
+EOO
-$* -i 2 -s 1 <<EOI 2>>EOE != 0
+$* -i 2 <<EOI 2>>EOE # inerr-doc
foo
bar
EOI
@@ -33,40 +44,63 @@ foo
bar
EOE
-$* -i 2 -o baz -s 10 <<EOI 1>baz 2>>EOE == 10
+$* -i 1 -e bar -e baz -s 2 <<EOI 1>>EOO 2>>EOE == 2 # inout-err-doc-status
foo
bar
EOI
foo
bar
+EOO
+bar
+baz
EOE
+$* -i 1 -e "" <<EOI >>EOO 2>"" # empty-str-doc
+EOI
+EOO
+
+$* -i 1 <<EOI >>EOO # nl-containing-doc
+
+EOI
+
+EOO
+
# No-newline tests.
#
# @@ TMP Need does not compare test.
#
-$* -i 1 <:"foo" >:"foo" # no-newline-str
+$* -i 1 <:"foo" >:"foo" # no-newline-str
#\
-$* -i 1 <:"foo" >!"foo" # no-newline-str-fail1
-$* -i 1 <"foo" >:!"foo" # no-newline-str-fail2
+$* -i 1 <:"foo" >!"foo" # no-newline-str-fail1
+$* -i 1 <"foo" >:!"foo" # no-newline-str-fail2
#\
-$* -i 1 <<:EOI >>:EOO # no-newline-doc
+$* -i 1 <<:EOI >>:EOO # no-newline-doc
foo
EOI
foo
EOO
#\
-$* -i 1 <<:EOI >>!EOO # no-newline-doc-fail1
+$* -i 1 <<:EOI >>!EOO # no-newline-doc-fail1
foo
EOI
foo
EOO
-$* -i 1 <<EOI >>:!EOO # no-newline-doc-fail2
+$* -i 1 <<EOI >>:!EOO # no-newline-doc-fail2
foo
EOI
foo
EOO
#\
+
+$* -i 1 <<:EOI >>:EOO 2>:"" # no-newline-empty-str-doc
+EOI
+EOO
+
+$* -i 1 <<:EOI >>:EOO # no-newline-nl-cont-doc
+
+EOI
+
+EOO