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

Contents of /perl/charclass/t/perlbug.t

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download) (as text)
Sat Feb 14 11:27:44 2004 UTC (20 years, 9 months ago) by wakaba
Branch: MAIN
Changes since 1.1: +7 -3 lines
File MIME type: application/x-troff
New test

1 wakaba 1.1 use strict;
2     ## Check whether perl is buggy or not
3     require Test::Simple;
4     my $case = 0;
5    
6     my $err;
7    
8     my @test = (
9     sub {
10     my $s = 'NAME';
11     ok (scalar ($s =~ /\p{InBasicLatin}/), '\p support of perl');
12     ok (scalar ($s =~ /\p{InBasicLatin}+/), '\p+ support of perl');
13     ok (scalar ($s =~ /^\p{InBasicLatin}+$/), '^\p+$ support of perl');
14     ## perl 5.8.0 has bug??
15 wakaba 1.2 ok (scalar ($s =~ /^\p{InBasicLatin}\p{InBasicLatin}+$/), '^\p\p+$ support of perl');
16     ok (scalar ($s =~ /^\p{InBasicLatin}\p{InBasicLatin}*$/), '^\p\p*$ support of perl');
17     },1..4,
18 wakaba 1.1 sub {
19     package foo;
20     my $s = 'NAME';
21     main::ok (scalar ($s =~ /\p{InBasicLatin}/), 'NSed \p support of perl');
22     main::ok (scalar ($s =~ /\p{InBasicLatin}+/), 'NSed \p+ support of perl');
23     main::ok (scalar ($s =~ /^\p{InBasicLatin}+$/), 'NSed ^\p+$ support of perl');
24 wakaba 1.2 main::ok (scalar ($s =~ /^\p{InBasicLatin}\p{InBasicLatin}+$/), 'NSed ^\p\p+$ support of perl');
25     main::ok (scalar ($s =~ /^\p{InBasicLatin}\p{InBasicLatin}*$/), 'NSed ^\p\p*$ support of perl');
26     }, 1..3,
27 wakaba 1.1 );
28     $case += @test;
29     $case += @test;
30    
31     Test::Simple->import (tests => $case);
32    
33     for (1,2) {
34     for (@test) {&$_ if ref $_}
35     }
36    
37     exit;
38     /\p{InUndefinedSet}/;
39     ## Older perl (such as 5.6.1) cannot run if undefined
40     ## (not defined by perl nor provided by "use"ed module) character class
41     ## is in use.
42    
43     =head1 LICENSE
44    
45     Copyright 2003 Wakaba <w@suika.fam.cx>
46    
47     This program is free software; you can redistribute it and/or
48     modify it under the same terms as Perl itself.
49    
50     =cut
51    
52 wakaba 1.2 1; # $Date: 2003/09/07 02:52:04 $

admin@suikawiki.org
ViewVC Help
Powered by ViewVC 1.1.24