Re: glob test 1 failing...bad test or bug
authorCharles Bailey <bailey@HMIVAX.HUMGEN.UPENN.EDU>
Tue, 1 Oct 1996 20:37:03 +0000 (16:37 -0400)
committerAndy Dougherty <doughera@lafcol.lafayette.edu>
Tue, 1 Oct 1996 20:37:03 +0000 (16:37 -0400)
Under AIX 4.1.4, with LOCALE set en_GB (British english) glob test one
fails because <op/*> sorts  op/re_* before op/rea*, while
$otherway = `echo op/*`  sorts  op/re_* after op/re[a-z]*.t

This version doesn't rely on the sorting order.

t/op/glob.t

index b403844..fce2952 100755 (executable)
@@ -5,11 +5,12 @@
 print "1..4\n";
 
 @ops = <op/*>;
-$list = join(' ',@ops);
 
-chop($otherway = `echo op/*`);
-
-print $list eq $otherway ? "ok 1\n" : "not ok 1\n$list\n$otherway\n";
+map { $files{$_}++ } <op/*>;
+map { delete $files{$_} } split /[\s\n]/, `echo op/*`;
+if (keys %files) {
+       print "not ok 1\t(",join(' ', sort keys %files),"\n";
+} else { print "ok 1\n"; }
 
 print $/ eq "\n" ? "ok 2\n" : "not ok 2\n";