This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
New file left out of the last commit.
[perl5.git] / t / uni / class.t
CommitLineData
0f1b7392
RGS
1BEGIN {
2 chdir 't' if -d 't';
3 @INC = qw(../lib .);
4 require "test.pl";
5}
6
7plan tests => 4;
8
9sub MyUniClass {
10 <<END;
110030 004F
12END
13}
14
15sub Other::Class {
16 <<END;
170040 005F
18END
19}
20
21sub A::B::Intersection {
22 <<END;
23+main::MyUniClass
24&Other::Class
25END
26}
27
28
29my $str = join "", map chr($_), 0x20 .. 0x6F;
30
31# make sure it finds built-in class
32is(($str =~ /(\p{Letter}+)/)[0], 'ABCDEFGHIJKLMNOPQRSTUVWXYZ');
33
34# make sure it finds user-defined class
35is(($str =~ /(\p{MyUniClass}+)/)[0], '0123456789:;<=>?@ABCDEFGHIJKLMNO');
36
37# make sure it finds class in other package
38is(($str =~ /(\p{Other::Class}+)/)[0], '@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_');
39
40# make sure it finds class in other OTHER package
41is(($str =~ /(\p{A::B::Intersection}+)/)[0], '@ABCDEFGHIJKLMNO');