This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/re/charset.t: Fix comment, test names
[perl5.git] / t / re / charset.t
index 578964b..76a3bce 100644 (file)
@@ -60,7 +60,7 @@ if (! is_miniperl() && $Config{d_setlocale}) {
     skip_adding_C_locale:
 
         # Use a pseudo-modifier 'L' to indicate to use /l with a UTF-8 locale
-        $utf8_locale = find_utf8_locale();
+        $utf8_locale = find_utf8_ctype_locale();
         push @charsets, 'L' if defined $utf8_locale;
     }
 }
@@ -108,15 +108,16 @@ foreach my $charset (@charsets) {
                 my $match = 1;      # Calculated whether test regex should
                                     # match or not
 
-                # Everything always matches in ASCII, or under /u
+                # Everything always matches in ASCII, or under /u, or under /l
+                # with a UTF-8 locale
                 if ($ord < 128 || $charset eq 'u' || $charset eq 'L') {
                     $reason = "\"$char\" is a $class under /$charset_display";
                     $neg_reason = "\"$char\" is not a $complement under /$charset_display";
                 }
                 elsif ($charset eq "a" || $charset eq "aa") {
                     $match = 0;
-                    $reason = "\"$char\" is non-ASCII, which can't be a $class under /a";
-                    $neg_reason = "\"$char\" is non-ASCII, which is a $complement under /a";
+                    $reason = "\"$char\" is non-ASCII, which can't be a $class under /$charset_display";
+                    $neg_reason = "\"$char\" is non-ASCII, which is a $complement under /$charset_display";
                 }
                 elsif ($ord > 255) {
                     $reason = "\"$char\" is a $class under /$charset_display";
@@ -127,17 +128,17 @@ foreach my $charset (@charsets) {
                     # We are using the C locale, which is essentially ASCII,
                     # but under utf8, the above-latin1 chars are treated as
                     # Unicode)
-                    $reason = "\"$char\" is not a $class in the C locale under /l";
-                    $neg_reason = "\"$char\" is a $complement in the C locale under /l";
+                    $reason = "\"$char\" is not a $class in the C locale under /$charset_mod";
+                    $neg_reason = "\"$char\" is a $complement in the C locale under /$charset_mod";
                     $match = 0;
                 }
                 elsif ($upgrade) {
-                    $reason = "\"$char\" is a $class in utf8 under /d";
-                    $neg_reason = "\"$char\" is not a $complement in utf8 under /d";
+                    $reason = "\"$char\" is a $class in utf8 under /$charset_display";
+                    $neg_reason = "\"$char\" is not a $complement in utf8 under /$charset_display";
                 }
                 else {
-                    $reason = "\"$char\" is above-ASCII latin1, which requires utf8 to be a $class under /d";
-                    $neg_reason = "\"$char\" is above-ASCII latin1, which is a $complement under /d (unless in utf8)";
+                    $reason = "\"$char\" is above-ASCII latin1, which requires utf8 to be a $class under /$charset_display";
+                    $neg_reason = "\"$char\" is above-ASCII latin1, which is a $complement under /$charset_display (unless in utf8)";
                     $match = 0;
                 }
                 $reason = "; $reason" if $reason;