coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] tests: use returns_ function for new split test


From: Bernhard Voelker
Subject: [PATCH] tests: use returns_ function for new split test
Date: Tue, 20 Jan 2015 01:58:18 +0100

* tests/split/record-sep.sh: Use the recently added returns_ function
to simplify the shell syntax in this test.  Also remove the redirection
of stdout/stderr to /dev/null as this eases analyzing errors.
---
 tests/split/record-sep.sh | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/tests/split/record-sep.sh b/tests/split/record-sep.sh
index f41215a..69eb27f 100755
--- a/tests/split/record-sep.sh
+++ b/tests/split/record-sep.sh
@@ -55,23 +55,23 @@ done
 #
 
 # Should fail: '-t' requires an argument
-{ split -t </dev/null >/dev/null 2>/dev/null || test $? -ne 1; } &&
+returns_ 1 split -t </dev/null ||
   { warn_ "-t without argument did not trigger an error" ; fail=1 ; }
 
 # should fail: multi-character separator
-{ split -txx </dev/null >/dev/null 2>&1 || test $? -ne 1; } &&
+returns_ 1 split -txx </dev/null ||
   { warn_ "-txx did not trigger an error" ; fail=1 ; }
 
 # should fail: different separators used
-{ split -ta -tb </dev/null >/dev/null 2>&1 || test $? -ne 1; } &&
+returns_ 1 split -ta -tb </dev/null ||
   { warn_ "-ta -tb did not trigger an error" ; fail=1 ; }
 
 # should fail: different separators used, including default
-{ split -t"$NL" -tb </dev/null >/dev/null 2>&1 || test $? -ne 1; } &&
+returns_ 1 split -t"$NL" -tb </dev/null ||
   { warn_ "-t\$NL -tb did not trigger an error" ; fail=1 ; }
 
 # should not fail: same separator used multiple times
-split -t: -t: </dev/null >/dev/null 2>&1 ||
+split -t: -t: </dev/null ||
   { warn_ "-t: -t: triggered an error" ; fail=1 ; }
 
 
-- 
2.1.2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]