From: Ruediger Meier Date: Thu, 3 Dec 2015 00:42:28 +0000 (+0100) Subject: tests: add some line tests X-Git-Tag: v2.28-rc1~228^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=caad4ded121790c89f0c383636c6cf7e9b4a04d4;p=thirdparty%2Futil-linux.git tests: add some line tests regarding e03f29b6 ... Signed-off-by: Ruediger Meier --- diff --git a/tests/expected/misc/line b/tests/expected/misc/line index 7898192261..fa7dcebb0f 100644 --- a/tests/expected/misc/line +++ b/tests/expected/misc/line @@ -1 +1,7 @@ a +ret: 0 +1 +2 +ret: 0 + +ret: 1 diff --git a/tests/ts/misc/line b/tests/ts/misc/line index a17ee28cce..71d5c04247 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 > $TS_OUTPUT 2>&1 +echo "ret: $?" >> $TS_OUTPUT ts_finalize