bug-coreutils
[Top][All Lists]
Advanced

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

Re: coreutils tests failure


From: Jim Meyering
Subject: Re: coreutils tests failure
Date: Sat Nov 16 09:24:50 2002

Hi Bruno,

Thanks for the report and analysis!
I think this patch fixes the test script portably,
without resorting to the sledgehammer of LC_ALL=C.
Would you please try it?

Index: tests/sum/sysv
===================================================================
RCS file: /fetish/cu/tests/sum/sysv,v
retrieving revision 1.1
diff -u -p -u -p -r1.1 sysv
--- tests/sum/sysv      28 Oct 2001 09:39:52 -0000      1.1
+++ tests/sum/sysv      16 Nov 2002 14:10:50 -0000
@@ -31,8 +31,12 @@ fail=0
 
 # FYI, 16843009 is floor (2^32 / 255).
 
-# aka: perl -e 'print chr(255) x 16843009'
-$PERL -e '$s = chr(255) x 65537; foreach (1..257) {print $s}' \
+# Use pack("C",255) (not chr(255)) to avoid unwanted conversion to
+# character data with newer versions of perl (e.g., perl-5.8.0).
+
+# The following is functionally equivalent to this:
+# perl -e 'print pack("C",255) x 16843009'
+$PERL -e '$s = pack("C",255) x 65537; foreach (1..257) {print $s}' \
   | sum -s > out || fail=1
 cat > exp <<\EOF
 65535 32897
@@ -42,8 +46,8 @@ test $fail = 1 && diff out exp 2> /dev/n
 
 rm -f out exp
 
-# aka: perl -e 'print chr(255) x 16843010'
-$PERL -e '$s = chr(255) x 65537; foreach (1..257) {print $s}; print chr(255)' \
+# aka: perl -e 'print pack("C",255) x 16843010'
+$PERL -e '$s = pack("C",255) x 65537; foreach (1..257) {print $s}; print 
pack("C",255)' \
   | sum -s > out || fail=1
 cat > exp <<\EOF
 254 32897

Thanks again,
Jim




reply via email to

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