7 |
|
|
8 |
my @test = ( |
my @test = ( |
9 |
sub { |
sub { |
10 |
eval q{use Char::Class::XML qw/InXMLNameChar/; 1} or die $@; |
eval q{use Char::Class::XML qw/InXMLNameChar InXML_NCNameStartChar/; 1} or die $@; |
11 |
my $s = 'NAME'; |
my $s = 'NAME'; |
12 |
ok (scalar ($s =~ /\p{InXMLNameChar}/), '{NameChar}'); |
ok (scalar ($s =~ /\p{InXMLNameChar}/), '{NameChar}'); |
13 |
ok (scalar ($s =~ /\p{InXMLNameChar}+/), '{NameChar}+'); |
ok (scalar ($s =~ /\p{InXMLNameChar}+/), '{NameChar}+'); |
14 |
ok (scalar ($s =~ /^\p{InXMLNameChar}+$/), '^{NameChar}+$'); |
ok (scalar ($s =~ /^\p{InXMLNameChar}+$/), '^{NameChar}+$'); |
15 |
}, '','', |
ok (scalar ($s =~ /^\p{InXMLNameChar}\p{InXMLNameChar}+$/), '^{NameChar}{NameChar}+$'); |
16 |
|
ok (scalar ($s =~ /^\p{InXML_NCNameStartChar}\p{InXMLNameChar}*$/), '^{NameStartChar}{NameChar}*$'); |
17 |
|
}, 1..4, |
18 |
sub { |
sub { |
19 |
package foo; |
package foo; |
20 |
eval q{use Char::Class::XML qw/InXML_NameStartChar/; 1} or die $@; |
eval q{use Char::Class::XML qw/InXML_NameStartChar InXMLNameChar/; 1} or die $@; |
21 |
my $s = 'NAME'; |
my $s = 'NAME'; |
22 |
main::ok (scalar ($s =~ /\p{InXML_NameStartChar}/), '{foo::NameStartChar}'); |
main::ok (scalar ($s =~ /\p{InXML_NameStartChar}/), '{foo::NameStartChar}'); |
23 |
main::ok (scalar ($s =~ /\p{InXML_NameStartChar}+/), '{foo::NameStartChar}+'); |
main::ok (scalar ($s =~ /\p{InXML_NameStartChar}+/), '{foo::NameStartChar}+'); |
24 |
main::ok (scalar ($s =~ /^\p{InXML_NameStartChar}+$/), '^{foo::NameStartChar}+$'); |
main::ok (scalar ($s =~ /^\p{InXML_NameStartChar}+$/), '^{foo::NameStartChar}+$'); |
25 |
}, '','', |
main::ok (scalar ($s =~ /^\p{InXMLNameChar}\p{InXMLNameChar}+$/), '^{NameChar}{NameChar}+$'); |
26 |
|
main::ok (scalar ($s =~ /^\p{InXML_NameStartChar}\p{InXMLNameChar}*$/), '^{NameStartChar}{NameChar}*$'); |
27 |
|
}, 1..4, |
28 |
sub { |
sub { |
29 |
eval q{use Char::Class::XML qw/InXMLNCNameChar InXML_NCNameStartChar/; 1} |
eval q{use Char::Class::XML qw/InXMLNCNameChar InXML_NCNameStartChar/; 1} |
30 |
or die $@; |
or die $@; |