From: Jarkko Hietaniemi Date: Mon, 7 Oct 1996 19:03:00 +0000 (+0300) Subject: LC_COLLATE. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2f52a3580b4a7ee9bec0aab0bca8b2c19859675d;p=p5sagit%2Fp5-mst-13.2.git LC_COLLATE. Big patch to add, document, and test LC_COLLATE support. A not necessarily gt a. --- diff --git a/t/lib/anydbm.t b/t/lib/anydbm.t index 11ac103..957aada 100755 --- a/t/lib/anydbm.t +++ b/t/lib/anydbm.t @@ -80,7 +80,7 @@ delete $h{'goner3'}; if ($#keys == 29 && $#values == 29) {print "ok 5\n";} else {print "not ok 5\n";} while (($key,$value) = each(h)) { - if ($key eq $keys[$i] && $value eq $values[$i] && $key gt $value) { + if ($key eq $keys[$i] && $value eq $values[$i] && $key eq lc($value)) { $key =~ y/a-z/A-Z/; $i++ if $key eq $value; } diff --git a/t/lib/db-btree.t b/t/lib/db-btree.t index 1944c38..4142f67 100755 --- a/t/lib/db-btree.t +++ b/t/lib/db-btree.t @@ -158,7 +158,7 @@ ok(27, $#keys == 29 && $#values == 29) ; $i = 0 ; while (($key,$value) = each(%h)) { - if ($key eq $keys[$i] && $value eq $values[$i] && $key gt $value) { + if ($key eq $keys[$i] && $value eq $values[$i] && $key eq lc($value)) { $key =~ y/a-z/A-Z/; $i++ if $key eq $value; } diff --git a/t/lib/db-hash.t b/t/lib/db-hash.t index f5c9cc8..36a3f33 100755 --- a/t/lib/db-hash.t +++ b/t/lib/db-hash.t @@ -153,7 +153,7 @@ ok(23, $#keys == 29 && $#values == 29) ; $i = 0 ; while (($key,$value) = each(%h)) { - if ($key eq $keys[$i] && $value eq $values[$i] && $key gt $value) { + if ($key eq $keys[$i] && $value eq $values[$i] && $key eq lc($value)) { $key =~ y/a-z/A-Z/; $i++ if $key eq $value; } diff --git a/t/lib/gdbm.t b/t/lib/gdbm.t index 0d2c1fe..d15228c 100755 --- a/t/lib/gdbm.t +++ b/t/lib/gdbm.t @@ -83,7 +83,7 @@ delete $h{'goner3'}; if ($#keys == 29 && $#values == 29) {print "ok 5\n";} else {print "not ok 5\n";} while (($key,$value) = each(h)) { - if ($key eq $keys[$i] && $value eq $values[$i] && $key gt $value) { + if ($key eq $keys[$i] && $value eq $values[$i] && $key eq lc($value)) { $key =~ y/a-z/A-Z/; $i++ if $key eq $value; } diff --git a/t/lib/ndbm.t b/t/lib/ndbm.t index e3093db..c4788ab 100755 --- a/t/lib/ndbm.t +++ b/t/lib/ndbm.t @@ -86,7 +86,7 @@ delete $h{'goner3'}; if ($#keys == 29 && $#values == 29) {print "ok 5\n";} else {print "not ok 5\n";} while (($key,$value) = each(h)) { - if ($key eq $keys[$i] && $value eq $values[$i] && $key gt $value) { + if ($key eq $keys[$i] && $value eq $values[$i] && $key eq lc($value)) { $key =~ y/a-z/A-Z/; $i++ if $key eq $value; } diff --git a/t/lib/odbm.t b/t/lib/odbm.t index b49aa91..301640a 100755 --- a/t/lib/odbm.t +++ b/t/lib/odbm.t @@ -86,7 +86,7 @@ delete $h{'goner3'}; if ($#keys == 29 && $#values == 29) {print "ok 5\n";} else {print "not ok 5\n";} while (($key,$value) = each(h)) { - if ($key eq $keys[$i] && $value eq $values[$i] && $key gt $value) { + if ($key eq $keys[$i] && $value eq $values[$i] && $key eq lc($value)) { $key =~ y/a-z/A-Z/; $i++ if $key eq $value; } diff --git a/t/lib/sdbm.t b/t/lib/sdbm.t index a754bb7..7b93276 100755 --- a/t/lib/sdbm.t +++ b/t/lib/sdbm.t @@ -85,7 +85,7 @@ delete $h{'goner3'}; if ($#keys == 29 && $#values == 29) {print "ok 5\n";} else {print "not ok 5\n";} while (($key,$value) = each(h)) { - if ($key eq $keys[$i] && $value eq $values[$i] && $key gt $value) { + if ($key eq $keys[$i] && $value eq $values[$i] && $key eq lc($value)) { $key =~ y/a-z/A-Z/; $i++ if $key eq $value; } diff --git a/t/op/readdir.t b/t/op/readdir.t index 1215f11..ca19ebc 100755 --- a/t/op/readdir.t +++ b/t/op/readdir.t @@ -12,7 +12,7 @@ closedir(OP); if (@D > 20 && @D < 100) { print "ok 2\n"; } else { print "not ok 2\n"; } @R = sort @D; -@G = ; +@G = sort ; if ($G[0] =~ m#.*\](\w+\.t)#i) { # grep is to convert filespecs returned from glob under VMS to format # identical to that returned by readdir diff --git a/t/op/sort.t b/t/op/sort.t index dc01e5f..27bc630 100755 --- a/t/op/sort.t +++ b/t/op/sort.t @@ -4,19 +4,22 @@ print "1..10\n"; -sub backwards { $a lt $b ? 1 : $a gt $b ? -1 : 0; } +sub backwards { $a lt $b ? 1 : $a gt $b ? -1 : 0 } @harry = ('dog','cat','x','Cain','Abel'); -@george = ('gone','chased','yz','Punished','Axed'); +@george = ('gone','chased','yz','punished','Axed'); $x = join('', sort @harry); print ($x eq 'AbelCaincatdogx' ? "ok 1\n" : "not ok 1\n"); +print "# x = '$x'\n"; $x = join('', sort( backwards @harry)); print ($x eq 'xdogcatCainAbel' ? "ok 2\n" : "not ok 2\n"); +print "# x = '$x'\n"; $x = join('', sort @george, 'to', @harry); -print ($x eq 'AbelAxedCainPunishedcatchaseddoggonetoxyz'?"ok 3\n":"not ok 3\n"); +print ($x eq 'AbelAxedCaincatchaseddoggonepunishedtoxyz'?"ok 3\n":"not ok 3\n"); +print "# x = '$x'\n"; @a = (); @b = reverse @a;