/[suikacvs]/perl/charclass/t/xml.t
Suika

Diff of /perl/charclass/t/xml.t

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by wakaba, Sun Sep 7 02:52:04 2003 UTC revision 1.2 by wakaba, Sat Feb 14 11:27:44 2004 UTC
# Line 7  my $err; Line 7  my $err;
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 $@;

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24