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 |
wakaba |
1.3 |
}, 1..4, |
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 |
wakaba |
1.3 |
Copyright 2003, 2007 Wakaba <w@suika.fam.cx> |
46 |
wakaba |
1.1 |
|
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.3 |
1; # $Date: 2004/02/14 11:27:44 $ |