On Fri, 23 Mar 2001, Peter Prymmer wrote:

> > +mkdir "PtEeRsLt.dir", 0777;
> > +chdir "PtEeRsLt.dir";
> 
> is there any chance that you might be convinced to use a more portable
> directory name like say "pteerslt"?  Thanks for any thoughts you might
> have on the matter.

Here's another patch using pteerslt instead of PtEeRsLt.dir.  I wonder if
these tests even apply to VMS?  Should I actually just C<if ($^O ....)>
around them?

Patch is against perl@9359.

Cheers,
-Ben

-- 
signer: can't create ~/.sig: Bad message

--- glob-basic.t.orig   Mon Mar 26 14:57:28 2001
+++ glob-basic.t        Mon Mar 26 14:58:09 2001
@@ -8,7 +8,7 @@
         print "1..0\n";
         exit 0;
     }
-    print "1..9\n";
+    print "1..11\n";
 }
 END {
     print "not ok 1\n" unless $loaded;
@@ -79,7 +79,7 @@
     print "ok 6 # skipped\n";
 }
 else {
-    $dir = "PtEeRsLt.dir";
+    $dir = "pteerslt";
     mkdir $dir, 0;
     @a = bsd_glob("$dir/*", GLOB_ERR);
     #print "\@a = ", array(@a);
@@ -124,3 +124,29 @@
     print "not ";
 }
 print "ok 9\n";
+
+# GLOB_ALPHASORT (default) should sort alphabetically regardless of case
+mkdir "pteerslt", 0777;
+chdir "pteerslt";
+@f_ascii = qw(A.test B.test C.test a.test b.test c.test);
+@f_alpha = qw(A.test a.test B.test b.test C.test c.test);
+for (@f_ascii) {
+    open T, "> $_";
+    close T;
+}
+$pat = "*.test";
+$ok = 1;
+@g_ascii = bsd_glob($pat, 0);
+for (@f_ascii) {
+    $ok = 0 unless $_ eq shift @g_ascii;
+}
+print $ok ? "ok 10\n" : "not ok 10\n";
+$ok = 1;
+@g_alpha = bsd_glob($pat);
+for (@f_alpha) {
+    $ok = 0 unless $_ eq shift @g_alpha;
+}
+print $ok ? "ok 11\n" : "not ok 11\n";
+unlink @f_ascii;
+chdir "..";
+rmdir "pteerslt";

Reply via email to