GNU bug report logs - #16061
Error in the message for src/shuf.c:73 in 8.22-pre3

Previous Next

Package: coreutils;

Reported by: Philipp Thomas <pth <at> suse.de>

Date: Thu, 5 Dec 2013 20:55:02 UTC

Severity: normal

Done: Pádraig Brady <P <at> draigBrady.com>

Bug is archived. No further changes may be made.

Full log


Message #35 received at 16061 <at> debbugs.gnu.org (full text, mbox):

From: Bernhard Voelker <mail <at> bernhard-voelker.de>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Philipp Thomas <pth <at> suse.de>,
 Pádraig Brady <P <at> draigBrady.com>, 16061 <at> debbugs.gnu.org
Subject: Re: bug#16061: Error in the message for src/shuf.c:73 in 8.22-pre3
Date: Fri, 06 Dec 2013 20:26:34 +0100
On 12/06/2013 06:57 PM, Paul Eggert wrote:
> Here's a patch, which I've taken the liberty of pushing.

Thanks, I'm fine with this behavior.
Minor nit: sc_long_lines is triggered.

BTW: I noticed another tiny flaw in the test (not related to
your patch). The following fixes both.

Have a nice day,
Berny

From b4f5dca24f3ca2eea6060cff9695d746c125747b Mon Sep 17 00:00:00 2001
From: Bernhard Voelker <mail <at> bernhard-voelker.de>
Date: Fri, 6 Dec 2013 20:24:38 +0100
Subject: [PATCH] tests: fix shuf test verifying that -i and -e can not be
 combined
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

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 | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tests/misc/shuf.sh b/tests/misc/shuf.sh
index 28c6483..b2cd1ab 100755
--- a/tests/misc/shuf.sh
+++ b/tests/misc/shuf.sh
@@ -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_
-- 
1.8.3.1





This bug report was last modified 11 years and 165 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.