This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add some tests for [\N{}]
authorKarl Williamson <public@khwilliamson.com>
Thu, 2 Aug 2012 16:50:00 +0000 (10:50 -0600)
committerKarl Williamson <public@khwilliamson.com>
Sun, 12 Aug 2012 01:32:30 +0000 (19:32 -0600)
t/re/pat_advanced.t

index 95f904f..771e441 100644 (file)
@@ -985,6 +985,16 @@ sub run_tests {
                    "Zerolength charname in charclass doesn't match \\\\0"];
         ok $w && $w =~ /Ignoring zero length/,
                  'Ignoring zero length \N{} in character class warning';
+        undef $w;
+        eval q [ok 'xy' =~ /x[\N{EMPTY-STR} y]/x,
+                    'Empty string charname in [] is ignored; finds a following character'];
+        ok $w && $w =~ /Ignoring zero length/,
+                 'Ignoring zero length \N{} in character class warning';
+        undef $w;
+        eval q [ok 'x ' =~ /x[\N{EMPTY-STR} y]/,
+                    'Empty string charname in [] is ignored; finds a following blank under /x'];
+        ok $w && $w =~ /Ignoring zero length/,
+                 'Ignoring zero length \N{} in character class warning';
 
         ok 'AB'  =~ /(\N{EVIL})/ && $1 eq 'A', 'Charname caching $1';
         ok 'ABC' =~ /(\N{EVIL})/,              'Charname caching $1';