Add test for \p{} failing silently blead
authorFather Chrysostomos <sprout@cpan.org>
Tue, 2 Sep 2014 05:51:10 +0000 (22:51 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Tue, 2 Sep 2014 05:51:10 +0000 (22:51 -0700)
This tests the fix added in commit 2db3e09128.

Only after writing what I said in
<20140901194542.21940.qmail@lists-nntp.develooper.com> did I realise
that this is actually trivial to test.

t/re/pat.t

index 770a45a..ba64d29 100644 (file)
@@ -20,7 +20,7 @@ BEGIN {
     require './test.pl';
 }
 
-plan tests => 738;  # Update this when adding/deleting tests.
+plan tests => 739;  # Update this when adding/deleting tests.
 
 run_tests() unless caller;
 
@@ -1612,6 +1612,25 @@ EOP
         like("X", qr/$x/, "UTF-8 of /[x]/i matches upper case");
     }
 
+    {   # make sure we get an error when \p{} cannot load Unicode tables
+        fresh_perl_like(<<'        prog that cannot load uni tables',
+            BEGIN {
+                @INC = '../lib';
+                require utf8; require 'utf8_heavy.pl';
+                @INC = ();
+            }
+            $name = 'A B';
+            if ($name =~ /(\p{IsUpper}) (\p{IsUpper})/){
+                print "It's good! >$1< >$2<\n";
+            } else {
+                print "It's not good...\n";
+            }
+        prog that cannot load uni tables
+                  qr/^Can't locate unicore\/Heavy\.pl(?x:
+                   )|^Can't find Unicode property definition/,
+                  undef,
+                 '\p{} should not fail silently when uni tables evanesce');
+    }
 } # End of sub run_tests
 
 1;