summaryrefslogtreecommitdiffstats
path: root/tests/ts/misc
diff options
context:
space:
mode:
authorRuediger Meier2015-12-03 01:42:28 +0100
committerRuediger Meier2015-12-03 01:56:53 +0100
commitcaad4ded121790c89f0c383636c6cf7e9b4a04d4 (patch)
treecda891a169cf8ee2c1fbf311388d9458a643eb23 /tests/ts/misc
parenttests: avoid sed -E (diff)
downloadkernel-qcow2-util-linux-caad4ded121790c89f0c383636c6cf7e9b4a04d4.tar.gz
kernel-qcow2-util-linux-caad4ded121790c89f0c383636c6cf7e9b4a04d4.tar.xz
kernel-qcow2-util-linux-caad4ded121790c89f0c383636c6cf7e9b4a04d4.zip
tests: add some line tests
regarding e03f29b6 ... Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
Diffstat (limited to 'tests/ts/misc')
-rwxr-xr-xtests/ts/misc/line11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/ts/misc/line b/tests/ts/misc/line
index a17ee28cc..71d5c0424 100755
--- a/tests/ts/misc/line
+++ b/tests/ts/misc/line
@@ -20,7 +20,18 @@ ts_init "$*"
ts_check_test_command "$TS_CMD_LINE"
+# usually behave like "head -n 1"
printf "a\nb\n" |
$TS_CMD_LINE > $TS_OUTPUT 2>&1
+echo "ret: $?" >> $TS_OUTPUT
+
+# never consume more than one line
+printf "1\n2\n" |
+ ($TS_CMD_LINE && $TS_CMD_LINE) >> $TS_OUTPUT 2>&1
+echo "ret: $?" >> $TS_OUTPUT
+
+# always print one newline, return 1 on EOF
+$TS_CMD_LINE </dev/null >> $TS_OUTPUT 2>&1
+echo "ret: $?" >> $TS_OUTPUT
ts_finalize