]> git.ipfire.org Git - thirdparty/coreutils.git/commitdiff
tests: fix shuf test verifying that -i and -e can not be combined
authorBernhard Voelker <mail@bernhard-voelker.de>
Fri, 6 Dec 2013 19:24:38 +0000 (20:24 +0100)
committerBernhard Voelker <mail@bernhard-voelker.de>
Fri, 6 Dec 2013 19:24:38 +0000 (20:24 +0100)
Previously, the test triggered another error diagnostic:
  shuf: invalid input range ā€˜-e’
and therefore eclipsed the expected one:
  shuf: cannot combine -e and -i options

While at it, reindent a line with more than 80 characters, present
since the previous commit to silence sc_long_lines.

* tests/misc/shuf.sh: Pass a valid range to the -i option.

tests/misc/shuf.sh

index 28c6483ca1617646cd4f722d3af3ebd9489af5b9..b2cd1abc2019eef6d180b9308cb037d5f6aa654a 100755 (executable)
@@ -73,7 +73,7 @@ test "$c" -eq 3 || { fail=1; echo "Multiple -n failed">&2 ; }
 # Test error conditions
 
 # -i and -e must not be used together
-: | shuf -i -e A B &&
+: | shuf -i0-9 -e A B &&
   { fail=1; echo "shuf did not detect erroneous -e and -i usage.">&2 ; }
 # Test invalid value for -n
 : | shuf -nA &&
@@ -99,7 +99,8 @@ shuf -i0-9 --random-source A --random-source B &&
 # --repeat without count should return an indefinite number of lines
 shuf --rep -i 0-10 | head -n 1000 > exp || framework_failure_
 c=$(wc -l < exp) || framework_failure_
-test "$c" -eq 1000 || { fail=1; echo "--repeat does not repeat indefinitely">&2 ; }
+test "$c" -eq 1000 \
+  || { fail=1; echo "--repeat does not repeat indefinitely">&2 ; }
 
 # --repeat can output more values than the input range
 shuf --rep -i0-9 -n1000 > exp || framework_failure_