This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
parts/inc/utf8: Wrap qr in string eval
authorKarl Williamson <khw@cpan.org>
Tue, 9 Jul 2019 17:09:24 +0000 (11:09 -0600)
committerNicolas R <atoomic@cpan.org>
Fri, 27 Sep 2019 22:51:28 +0000 (16:51 -0600)
Very early perls fail to compile this because qr doesn't exist and is
viewed as a syntax error, even though the tests don't get executed.

(cherry picked from commit 682fa53f57973b5a263c3b6742a54fa90d7995b6)
Signed-off-by: Nicolas R <atoomic@cpan.org>
dist/Devel-PPPort/parts/inc/utf8
dist/Devel-PPPort/t/utf8.t

index a9c166f..6498576 100644 (file)
@@ -522,43 +522,43 @@ else {
         {
             input      => "A",
             adjustment => -1,
-            warning    => qr/empty/,
+            warning    => eval "qr/empty/",
             no_warnings_returned_length => 0,
         },
         {
             input      => "\xc4\xc5",
             adjustment => 0,
-            warning    => qr/non-continuation/,
+            warning    => eval "qr/non-continuation/",
             no_warnings_returned_length => 1,
         },
         {
             input      => "\xc4\x80",
             adjustment => -1,
-            warning    => qr/short|1 byte, need 2/,
+            warning    => eval "qr/short|1 byte, need 2/",
             no_warnings_returned_length => 1,
         },
         {
             input      => "\xc0\x81",
             adjustment => 0,
-            warning    => qr/overlong|2 bytes, need 1/,
+            warning    => eval "qr/overlong|2 bytes, need 1/",
             no_warnings_returned_length => 2,
         },
         {
             input      => "\xe0\x80\x81",
             adjustment => 0,
-            warning    => qr/overlong|3 bytes, need 1/,
+            warning    => eval "qr/overlong|3 bytes, need 1/",
             no_warnings_returned_length => 3,
         },
         {
             input      => "\xf0\x80\x80\x81",
             adjustment => 0,
-            warning    => qr/overlong|4 bytes, need 1/,
+            warning    => eval "qr/overlong|4 bytes, need 1/",
             no_warnings_returned_length => 4,
         },
         {                 # Old algorithm failed to detect this
             input      => "\xff\x80\x90\x90\x90\xbf\xbf\xbf\xbf\xbf\xbf\xbf\xbf",
             adjustment => 0,
-            warning    => qr/overflow/,
+            warning    => eval "qr/overflow/",
             no_warnings_returned_length => 13,
         },
     );
index 119553d..f80cd28 100644 (file)
@@ -116,43 +116,43 @@ else {
         {
             input      => "A",
             adjustment => -1,
-            warning    => qr/empty/,
+            warning    => eval "qr/empty/",
             no_warnings_returned_length => 0,
         },
         {
             input      => "\xc4\xc5",
             adjustment => 0,
-            warning    => qr/non-continuation/,
+            warning    => eval "qr/non-continuation/",
             no_warnings_returned_length => 1,
         },
         {
             input      => "\xc4\x80",
             adjustment => -1,
-            warning    => qr/short|1 byte, need 2/,
+            warning    => eval "qr/short|1 byte, need 2/",
             no_warnings_returned_length => 1,
         },
         {
             input      => "\xc0\x81",
             adjustment => 0,
-            warning    => qr/overlong|2 bytes, need 1/,
+            warning    => eval "qr/overlong|2 bytes, need 1/",
             no_warnings_returned_length => 2,
         },
         {
             input      => "\xe0\x80\x81",
             adjustment => 0,
-            warning    => qr/overlong|3 bytes, need 1/,
+            warning    => eval "qr/overlong|3 bytes, need 1/",
             no_warnings_returned_length => 3,
         },
         {
             input      => "\xf0\x80\x80\x81",
             adjustment => 0,
-            warning    => qr/overlong|4 bytes, need 1/,
+            warning    => eval "qr/overlong|4 bytes, need 1/",
             no_warnings_returned_length => 4,
         },
         {                 # Old algorithm failed to detect this
             input      => "\xff\x80\x90\x90\x90\xbf\xbf\xbf\xbf\xbf\xbf\xbf\xbf",
             adjustment => 0,
-            warning    => qr/overflow/,
+            warning    => eval "qr/overflow/",
             no_warnings_returned_length => 13,
         },
     );