This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/re/regex_sets.t: Add some tests
authorKarl Williamson <khw@cpan.org>
Wed, 10 Feb 2016 21:25:31 +0000 (14:25 -0700)
committerKarl Williamson <khw@cpan.org>
Thu, 11 Feb 2016 04:16:44 +0000 (21:16 -0700)
t/re/regex_sets.t

index 5a9807e..cd5df00 100644 (file)
@@ -139,6 +139,17 @@ if (! is_miniperl() && locales_enabled('LC_CTYPE')) {
     }
 }
 
+# Tests that no warnings given for valid Unicode digit range.
+my $arabic_digits = qr/(?[ [ ٠ - ٩ ] ])/;
+for my $char ("٠", "٥", "٩") {
+    use charnames ();
+    my @got = capture_warnings(sub {
+                like("٠", $arabic_digits, "Matches "
+                                                . charnames::viacode(ord $char));
+            });
+    is (@got, 0, "... without warnings");
+}
+
 # RT #126181: \cX behaves strangely inside (?[])
 {
        no warnings qw(syntax regexp);