diff options
author | 2014-03-24 14:58:42 +0000 | |
---|---|---|
committer | 2014-03-24 14:58:42 +0000 | |
commit | 91f110e064cd7c194e59e019b83bb7496c1c84d4 (patch) | |
tree | 3e8e577405dba7e94b43cbf21c22f21aaa5ab949 /gnu/usr.bin/perl/t/lib/warnings | |
parent | do not call purge_task every 10 secs, it is only needed once at startup and (diff) | |
download | wireguard-openbsd-91f110e064cd7c194e59e019b83bb7496c1c84d4.tar.xz wireguard-openbsd-91f110e064cd7c194e59e019b83bb7496c1c84d4.zip |
Import perl-5.18.2
OK espie@ sthen@ deraadt@
Diffstat (limited to 'gnu/usr.bin/perl/t/lib/warnings')
-rw-r--r-- | gnu/usr.bin/perl/t/lib/warnings/2use | 19 | ||||
-rw-r--r-- | gnu/usr.bin/perl/t/lib/warnings/9uninit | 78 | ||||
-rw-r--r-- | gnu/usr.bin/perl/t/lib/warnings/doio | 6 | ||||
-rw-r--r-- | gnu/usr.bin/perl/t/lib/warnings/gv | 50 | ||||
-rw-r--r-- | gnu/usr.bin/perl/t/lib/warnings/op | 207 | ||||
-rw-r--r-- | gnu/usr.bin/perl/t/lib/warnings/pad | 24 | ||||
-rw-r--r-- | gnu/usr.bin/perl/t/lib/warnings/perl | 6 | ||||
-rw-r--r-- | gnu/usr.bin/perl/t/lib/warnings/perly | 236 | ||||
-rw-r--r-- | gnu/usr.bin/perl/t/lib/warnings/pp | 6 | ||||
-rw-r--r-- | gnu/usr.bin/perl/t/lib/warnings/pp_hot | 27 | ||||
-rw-r--r-- | gnu/usr.bin/perl/t/lib/warnings/regcomp | 265 | ||||
-rw-r--r-- | gnu/usr.bin/perl/t/lib/warnings/toke | 101 | ||||
-rw-r--r-- | gnu/usr.bin/perl/t/lib/warnings/utf8 | 465 |
13 files changed, 951 insertions, 539 deletions
diff --git a/gnu/usr.bin/perl/t/lib/warnings/2use b/gnu/usr.bin/perl/t/lib/warnings/2use index e5a8103b810..c0d203a399d 100644 --- a/gnu/usr.bin/perl/t/lib/warnings/2use +++ b/gnu/usr.bin/perl/t/lib/warnings/2use @@ -358,3 +358,22 @@ $a =+ 1 ; EXPECT Reversed += operator at - line 6. Use of uninitialized value $c in scalar chop at - line 9. +######## + +# Check that deprecation warnings are not implicitly disabled by use +$*; +use warnings "void"; +$#; +EXPECT +$* is no longer supported at - line 3. +$# is no longer supported at - line 5. +Useless use of a variable in void context at - line 5. +######## + +# Check that deprecation warnings are not implicitly disabled by no +$*; +no warnings "void"; +$#; +EXPECT +$* is no longer supported at - line 3. +$# is no longer supported at - line 5. diff --git a/gnu/usr.bin/perl/t/lib/warnings/9uninit b/gnu/usr.bin/perl/t/lib/warnings/9uninit index 37e24e73859..829e2de8386 100644 --- a/gnu/usr.bin/perl/t/lib/warnings/9uninit +++ b/gnu/usr.bin/perl/t/lib/warnings/9uninit @@ -820,6 +820,7 @@ undef $g1; $m1 = '$g1'; $foo =~ s//$m1/ee; EXPECT +Use of my $_ is experimental at - line 16. Use of uninitialized value $_ in pattern match (m//) at - line 5. Use of uninitialized value $m1 in regexp compilation at - line 6. Use of uninitialized value $_ in pattern match (m//) at - line 6. @@ -830,9 +831,8 @@ Use of uninitialized value $m1 in regexp compilation at - line 10. Use of uninitialized value $_ in substitution (s///) at - line 10. Use of uninitialized value $_ in substitution (s///) at - line 10. Use of uninitialized value $_ in substitution (s///) at - line 11. -Use of uninitialized value $g1 in substitution (s///) at - line 11. Use of uninitialized value $_ in substitution (s///) at - line 11. -Use of uninitialized value $g1 in substitution (s///) at - line 11. +Use of uninitialized value $g1 in substitution iterator at - line 11. Use of uninitialized value $m1 in regexp compilation at - line 12. Use of uninitialized value $_ in substitution (s///) at - line 12. Use of uninitialized value $_ in substitution (s///) at - line 12. @@ -849,9 +849,8 @@ Use of uninitialized value $m1 in regexp compilation at - line 21. Use of uninitialized value $_ in substitution (s///) at - line 21. Use of uninitialized value $_ in substitution (s///) at - line 21. Use of uninitialized value $_ in substitution (s///) at - line 22. -Use of uninitialized value $g1 in substitution (s///) at - line 22. Use of uninitialized value $_ in substitution (s///) at - line 22. -Use of uninitialized value $g1 in substitution (s///) at - line 22. +Use of uninitialized value $g1 in substitution iterator at - line 22. Use of uninitialized value $m1 in regexp compilation at - line 23. Use of uninitialized value $_ in substitution (s///) at - line 23. Use of uninitialized value $_ in substitution (s///) at - line 23. @@ -868,9 +867,8 @@ Use of uninitialized value $m1 in regexp compilation at - line 31. Use of uninitialized value $g2 in substitution (s///) at - line 31. Use of uninitialized value $g2 in substitution (s///) at - line 31. Use of uninitialized value $g2 in substitution (s///) at - line 32. -Use of uninitialized value $g1 in substitution (s///) at - line 32. Use of uninitialized value $g2 in substitution (s///) at - line 32. -Use of uninitialized value $g1 in substitution (s///) at - line 32. +Use of uninitialized value $g1 in substitution iterator at - line 32. Use of uninitialized value $m1 in regexp compilation at - line 33. Use of uninitialized value $g2 in substitution (s///) at - line 33. Use of uninitialized value $g2 in substitution (s///) at - line 33. @@ -880,10 +878,10 @@ Use of uninitialized value in transliteration (tr///) at - line 35. Use of uninitialized value $m1 in regexp compilation at - line 38. Use of uninitialized value $g1 in regexp compilation at - line 39. Use of uninitialized value $m1 in regexp compilation at - line 41. -Use of uninitialized value $g1 in substitution (s///) at - line 42. +Use of uninitialized value $g1 in substitution iterator at - line 42. Use of uninitialized value $m1 in regexp compilation at - line 43. Use of uninitialized value $g1 in substitution iterator at - line 43. -Use of uninitialized value $m1 in substitution iterator at - line 44. +Use of uninitialized value $m1 in substitution (s///) at - line 44. Use of uninitialized value in substitution iterator at - line 47. ######## use warnings 'uninitialized'; @@ -1035,7 +1033,6 @@ Use of uninitialized value $g1 in vec at - line 11. Use of uninitialized value $m1 in vec at - line 11. Use of uninitialized value $m2 in vec at - line 12. Use of uninitialized value $g1 in vec at - line 12. -Use of uninitialized value $m1 in vec at - line 12. Use of uninitialized value $m1 in index at - line 14. Use of uninitialized value $m2 in index at - line 14. Use of uninitialized value $g1 in index at - line 15. @@ -1144,8 +1141,8 @@ our @foo3=(1,undef); chop @foo3; my @foo4=(1,undef); chop @foo4; our @foo5=(1,undef); $v = sprintf "%s%s",@foo5; my @foo6=(1,undef); $v = sprintf "%s%s",@foo6; -our %foo7=('foo'=>'bar','baz'=>undef); $v = sprintf "%s%s",%foo7; -my %foo8=('foo'=>'bar','baz'=>undef); $v = sprintf "%s%s",%foo8; +our %foo7=('foo'=>'bar','baz'=>undef); $v = sprintf "%s%s%s%s",%foo7; +my %foo8=('foo'=>'bar','baz'=>undef); $v = sprintf "%s%s%s%s",%foo8; our @foo9 =(1,undef); $v = sprintf "%s%s%s%s",$m1,@foo9, $ma[2]; my @foo10=(1,undef); $v = sprintf "%s%s%s%s",$m2,@foo10,$ma[2]; our %foo11=('foo'=>'bar','baz'=>undef); $v = join '', %foo11; @@ -1226,8 +1223,6 @@ Use of uninitialized value $m1 in splice at - line 10. Use of uninitialized value $g1 in splice at - line 10. Use of uninitialized value in addition (+) at - line 10. Use of uninitialized value $m1 in method lookup at - line 13. -Use of uninitialized value in subroutine entry at - line 15. -Use of uninitialized value in subroutine entry at - line 16. Use of uninitialized value $m1 in warn at - line 18. Use of uninitialized value $g1 in warn at - line 18. foo at - line 18. @@ -1962,7 +1957,7 @@ $v = 1 + prototype $fn; EXPECT Use of uninitialized value in addition (+) at - line 4. ######## -use warnings 'uninitialized'; +use warnings 'uninitialized'; no warnings 'experimental::smartmatch'; my $v; my $fn = sub {}; $v = 1 + (1 ~~ $fn); @@ -2037,3 +2032,58 @@ use warnings 'uninitialized'; "@{[ $x ]}"; EXPECT Use of uninitialized value in join or string at - line 3. +######## +# inside formats +use warnings 'uninitialized'; +my $x; +format = +@ +"$x"; +. +write; +EXPECT +Use of uninitialized value $x in string at - line 6. +######## +# NAME off-by-one error in hash bucket walk in key detection logic +use warnings 'uninitialized'; + +for ( 0 .. 20 ) { # we assume that this means we test keys for every bucket + my %h= ( $_ => undef ); + my $s= sprintf "%s", $h{$_}; +} +EXPECT +Use of uninitialized value $h{"0"} in sprintf at - line 5. +Use of uninitialized value $h{"1"} in sprintf at - line 5. +Use of uninitialized value $h{"2"} in sprintf at - line 5. +Use of uninitialized value $h{"3"} in sprintf at - line 5. +Use of uninitialized value $h{"4"} in sprintf at - line 5. +Use of uninitialized value $h{"5"} in sprintf at - line 5. +Use of uninitialized value $h{"6"} in sprintf at - line 5. +Use of uninitialized value $h{"7"} in sprintf at - line 5. +Use of uninitialized value $h{"8"} in sprintf at - line 5. +Use of uninitialized value $h{"9"} in sprintf at - line 5. +Use of uninitialized value $h{"10"} in sprintf at - line 5. +Use of uninitialized value $h{"11"} in sprintf at - line 5. +Use of uninitialized value $h{"12"} in sprintf at - line 5. +Use of uninitialized value $h{"13"} in sprintf at - line 5. +Use of uninitialized value $h{"14"} in sprintf at - line 5. +Use of uninitialized value $h{"15"} in sprintf at - line 5. +Use of uninitialized value $h{"16"} in sprintf at - line 5. +Use of uninitialized value $h{"17"} in sprintf at - line 5. +Use of uninitialized value $h{"18"} in sprintf at - line 5. +Use of uninitialized value $h{"19"} in sprintf at - line 5. +Use of uninitialized value $h{"20"} in sprintf at - line 5. +######## +# NAME SvPOK && SvLEN==0 should not produce uninit warning +use warnings 'uninitialized'; + +$v = int(${qr||}); # sv_2iv on a regexp +$v = 1.1 * ${qr||}; # sv_2nv on a regexp +$v = ${qr||} << 2; # sv_2uv on a regexp + +sub TIESCALAR{bless[]} +sub FETCH {${qr||}} +tie $t, ""; +$v = 1.1 * $t; # sv_2nv on a tied regexp + +EXPECT diff --git a/gnu/usr.bin/perl/t/lib/warnings/doio b/gnu/usr.bin/perl/t/lib/warnings/doio index 732f66d3184..37b55e3e770 100644 --- a/gnu/usr.bin/perl/t/lib/warnings/doio +++ b/gnu/usr.bin/perl/t/lib/warnings/doio @@ -159,10 +159,16 @@ Unsuccessful stat on filename containing newline at - line 4. # doio.c [Perl_my_stat] use warnings 'io'; -l STDIN; +-l $fh; +open $fh, $0 or die "# $!"; +-l $fh; no warnings 'io'; -l STDIN; +-l $fh; +close $fh; EXPECT Use of -l on filehandle STDIN at - line 3. +Use of -l on filehandle $fh at - line 6. ######## # doio.c [Perl_my_stat] use utf8; diff --git a/gnu/usr.bin/perl/t/lib/warnings/gv b/gnu/usr.bin/perl/t/lib/warnings/gv index 6101f691320..6b022e1294c 100644 --- a/gnu/usr.bin/perl/t/lib/warnings/gv +++ b/gnu/usr.bin/perl/t/lib/warnings/gv @@ -63,6 +63,56 @@ $# is no longer supported at - line 2. $* is no longer supported at - line 3. ######## # gv.c +$a = ${#}; +$a = ${*}; +no warnings 'deprecated' ; +$a = ${#}; +$a = ${*}; +EXPECT +$# is no longer supported at - line 2. +$* is no longer supported at - line 3. +######## +# gv.c +$a = $#; +$a = $*; +$# = $a; +$* = $a; +$a = \$#; +$a = \$*; +no warnings 'deprecated' ; +$a = $#; +$a = $*; +$# = $a; +$* = $a; +$a = \$#; +$a = \$*; +EXPECT +$# is no longer supported at - line 2. +$* is no longer supported at - line 3. +$# is no longer supported at - line 4. +$* is no longer supported at - line 5. +$# is no longer supported at - line 6. +$* is no longer supported at - line 7. +######## +# gv.c +@a = @#; +@a = @*; +$a = $#; +$a = $*; +EXPECT +$# is no longer supported at - line 4. +$* is no longer supported at - line 5. +######## +# gv.c +$a = $#; +$a = $*; +@a = @#; +@a = @*; +EXPECT +$# is no longer supported at - line 2. +$* is no longer supported at - line 3. +######## +# gv.c use warnings 'syntax' ; use utf8; use open qw( :utf8 :std ); diff --git a/gnu/usr.bin/perl/t/lib/warnings/op b/gnu/usr.bin/perl/t/lib/warnings/op index de74d2e3604..83d3705f560 100644 --- a/gnu/usr.bin/perl/t/lib/warnings/op +++ b/gnu/usr.bin/perl/t/lib/warnings/op @@ -1,5 +1,8 @@ op.c AOK + Use of my $_ is experimental + my $_ ; + Found = in conditional, should be == 1 if $a = 1 ; @@ -73,6 +76,8 @@ (Maybe you should just omit the defined()?) my %h ; defined %h ; + "my %s" used in sort comparison + $[ used in comparison (did you mean $] ?) length() used on @array (did you mean "scalar(@array)"?) @@ -97,18 +102,33 @@ sub fred() ; sub fred($) {} - Runaway prototype [newSUB] TODO oops: oopsAV [oopsAV] TODO oops: oopsHV [oopsHV] TODO __END__ # op.c +use warnings 'experimental::lexical_topic' ; +my $_; +CORE::state $_; +no warnings 'experimental::lexical_topic' ; +my $_; +CORE::state $_; +EXPECT +Use of my $_ is experimental at - line 3. +Use of state $_ is experimental at - line 4. +######## +# op.c use warnings 'syntax' ; 1 if $a = 1 ; +1 if $a + = 1 ; no warnings 'syntax' ; 1 if $a = 1 ; +1 if $a + = 1 ; EXPECT Found = in conditional, should be == at - line 3. +Found = in conditional, should be == at - line 4. ######## # op.c use warnings 'syntax' ; @@ -148,8 +168,10 @@ Using an array as a reference is deprecated at - line 9. Using an array as a reference is deprecated at - line 10. ######## # op.c -use warnings 'void' ; close STDIN ; -1 x 3 ; # OP_REPEAT +use warnings 'void' ; no warnings 'experimental::smartmatch'; close STDIN ; +#line 2 +1 x 3 ; # OP_REPEAT (folded) +(1) x 3 ; # OP_REPEAT # OP_GVSV wantarray ; # OP_WANTARRAY # OP_GV @@ -206,6 +228,7 @@ $a <=> $b; # OP_NCMP use 5.015; __SUB__ # OP_RUNCV EXPECT +Useless use of a constant ("111") in void context at - line 2. Useless use of repeat (x) in void context at - line 3. Useless use of wantarray in void context at - line 5. Useless use of reference-type operator in void context at - line 12. @@ -660,28 +683,43 @@ Bareword found in conditional at - line 3. use warnings 'misc' ; open FH, "<abc" ; $x = 1 if $x = <FH> ; +$x = 1 if $x + = <FH> ; no warnings 'misc' ; $x = 1 if $x = <FH> ; +$x = 1 if $x + = <FH> ; EXPECT Value of <HANDLE> construct can be "0"; test with defined() at - line 4. +Value of <HANDLE> construct can be "0"; test with defined() at - line 5. ######## # op.c use warnings 'misc' ; opendir FH, "." ; $x = 1 if $x = readdir FH ; +$x = 1 if $x + = readdir FH ; no warnings 'misc' ; $x = 1 if $x = readdir FH ; +$x = 1 if $x + = readdir FH ; closedir FH ; EXPECT Value of readdir() operator can be "0"; test with defined() at - line 4. +Value of readdir() operator can be "0"; test with defined() at - line 5. ######## # op.c use warnings 'misc' ; $x = 1 if $x = <*> ; +$x = 1 if $x + = <*> ; no warnings 'misc' ; $x = 1 if $x = <*> ; +$x = 1 if $x + = <*> ; EXPECT Value of glob construct can be "0"; test with defined() at - line 3. +Value of glob construct can be "0"; test with defined() at - line 4. ######## # op.c use warnings 'misc' ; @@ -722,10 +760,15 @@ EXPECT use warnings 'redefine' ; sub fred {} sub fred {} +sub fred { # warning should be for this line +} no warnings 'redefine' ; sub fred {} +sub fred { +} EXPECT Subroutine fred redefined at - line 4. +Subroutine fred redefined at - line 5. ######## # op.c use warnings 'redefine' ; @@ -749,6 +792,28 @@ EXPECT Constant subroutine main::fred redefined at - line 3. ######## # op.c +use feature "lexical_subs", "state"; +my sub fred () { 1 } +sub fred { 2 }; +my sub george { 1 } +sub george () { 2 } # should *not* produce redef warnings by default +state sub phred () { 1 } +sub phred { 2 }; +state sub jorge { 1 } +sub jorge () { 2 } # should *not* produce redef warnings by default +EXPECT +The lexical_subs feature is experimental at - line 3. +Prototype mismatch: sub fred () vs none at - line 4. +Constant subroutine fred redefined at - line 4. +The lexical_subs feature is experimental at - line 5. +Prototype mismatch: sub george: none vs () at - line 6. +The lexical_subs feature is experimental at - line 7. +Prototype mismatch: sub phred () vs none at - line 8. +Constant subroutine phred redefined at - line 8. +The lexical_subs feature is experimental at - line 9. +Prototype mismatch: sub jorge: none vs () at - line 10. +######## +# op.c no warnings 'redefine' ; sub fred () { 1 } sub fred () { 2 } @@ -840,8 +905,13 @@ EXPECT # op.c sub fred(); sub fred($) {} +use constant foo=>bar; sub foo(@); +use constant bav=>bar; sub bav(); # no warning +sub btu; sub btu(); EXPECT Prototype mismatch: sub main::fred () vs ($) at - line 3. +Prototype mismatch: sub foo () vs (@) at - line 4. +Prototype mismatch: sub btu: none vs () at - line 6. ######## # op.c use utf8; @@ -926,6 +996,116 @@ Prototype mismatch: sub main::fred () vs ($) at - line 4. Prototype mismatch: sub main::freD () vs ($) at - line 11. Prototype mismatch: sub main::FRED () vs ($) at - line 14. ######## +# op.c [S_simplify_sort] +# [perl #86136] +my @tests = split /^/, ' + sort {$a <=> $b} @a; + sort {$a cmp $b} @a; + { use integer; sort {$a <=> $b} @a} + sort {$b <=> $a} @a; + sort {$b cmp $a} @a; + { use integer; sort {$b <=> $a} @a} +'; +for my $pragma ('use warnings "syntax";', '') { + for my $vars ('', 'my $a;', 'my $b;', 'my ($a,$b);') { + for my $inner_stmt ('', 'print;', 'func();') { + eval "#line " . ++$line . "01 -\n$pragma\n$vars" + . join "", map s/sort \{\K/$inner_stmt/r, @tests; + $@ and die; + } + } +} +sub func{} +use warnings 'syntax'; +my $a; +# These used to be errors! +sort { ; } $a <=> $b; +sort { ; } $a, "<=>"; +sort { ; } $a, $cmp; +sort $a, $b if $cmpany_name; +sort if $a + $cmp; +sort @t; $a + $cmp; +EXPECT +"my $a" used in sort comparison at - line 403. +"my $a" used in sort comparison at - line 404. +"my $a" used in sort comparison at - line 405. +"my $a" used in sort comparison at - line 406. +"my $a" used in sort comparison at - line 407. +"my $a" used in sort comparison at - line 408. +"my $a" used in sort comparison at - line 503. +"my $a" used in sort comparison at - line 504. +"my $a" used in sort comparison at - line 505. +"my $a" used in sort comparison at - line 506. +"my $a" used in sort comparison at - line 507. +"my $a" used in sort comparison at - line 508. +"my $a" used in sort comparison at - line 603. +"my $a" used in sort comparison at - line 604. +"my $a" used in sort comparison at - line 605. +"my $a" used in sort comparison at - line 606. +"my $a" used in sort comparison at - line 607. +"my $a" used in sort comparison at - line 608. +"my $b" used in sort comparison at - line 703. +"my $b" used in sort comparison at - line 704. +"my $b" used in sort comparison at - line 705. +"my $b" used in sort comparison at - line 706. +"my $b" used in sort comparison at - line 707. +"my $b" used in sort comparison at - line 708. +"my $b" used in sort comparison at - line 803. +"my $b" used in sort comparison at - line 804. +"my $b" used in sort comparison at - line 805. +"my $b" used in sort comparison at - line 806. +"my $b" used in sort comparison at - line 807. +"my $b" used in sort comparison at - line 808. +"my $b" used in sort comparison at - line 903. +"my $b" used in sort comparison at - line 904. +"my $b" used in sort comparison at - line 905. +"my $b" used in sort comparison at - line 906. +"my $b" used in sort comparison at - line 907. +"my $b" used in sort comparison at - line 908. +"my $a" used in sort comparison at - line 1003. +"my $b" used in sort comparison at - line 1003. +"my $a" used in sort comparison at - line 1004. +"my $b" used in sort comparison at - line 1004. +"my $a" used in sort comparison at - line 1005. +"my $b" used in sort comparison at - line 1005. +"my $b" used in sort comparison at - line 1006. +"my $a" used in sort comparison at - line 1006. +"my $b" used in sort comparison at - line 1007. +"my $a" used in sort comparison at - line 1007. +"my $b" used in sort comparison at - line 1008. +"my $a" used in sort comparison at - line 1008. +"my $a" used in sort comparison at - line 1103. +"my $b" used in sort comparison at - line 1103. +"my $a" used in sort comparison at - line 1104. +"my $b" used in sort comparison at - line 1104. +"my $a" used in sort comparison at - line 1105. +"my $b" used in sort comparison at - line 1105. +"my $b" used in sort comparison at - line 1106. +"my $a" used in sort comparison at - line 1106. +"my $b" used in sort comparison at - line 1107. +"my $a" used in sort comparison at - line 1107. +"my $b" used in sort comparison at - line 1108. +"my $a" used in sort comparison at - line 1108. +"my $a" used in sort comparison at - line 1203. +"my $b" used in sort comparison at - line 1203. +"my $a" used in sort comparison at - line 1204. +"my $b" used in sort comparison at - line 1204. +"my $a" used in sort comparison at - line 1205. +"my $b" used in sort comparison at - line 1205. +"my $b" used in sort comparison at - line 1206. +"my $a" used in sort comparison at - line 1206. +"my $b" used in sort comparison at - line 1207. +"my $a" used in sort comparison at - line 1207. +"my $b" used in sort comparison at - line 1208. +"my $a" used in sort comparison at - line 1208. +######## +# op.c [S_simplify_sort] +use warnings 'syntax'; use 5.01; +state $a; +sort { $a <=> $b } (); +EXPECT +"state $a" used in sort comparison at - line 4. +######## # op.c [Perl_ck_cmp] use warnings 'syntax' ; no warnings 'deprecated'; @@ -1360,3 +1540,24 @@ sub ᚠርƊ () { 1 } EXPECT Constant subroutine main::ᚠርƊ redefined at - line 5. ######## +# OPTION regex +sub DynaLoader::dl_error {}; +use warnings; +# We're testing that the warnings report the same line number: +eval <<'EOC' or die $@; +{ + DynaLoader::boot_DynaLoader("DynaLoader"); +} +EOC +eval <<'EOC' or die $@; +BEGIN { + DynaLoader::boot_DynaLoader("DynaLoader"); +} +1 +EOC +EXPECT +OPTION regex +\ASubroutine DynaLoader::dl_error redefined at \(eval 1\) line 2\. +?(?s).* +Subroutine DynaLoader::dl_error redefined at \(eval 2\) line 2\. +######## diff --git a/gnu/usr.bin/perl/t/lib/warnings/pad b/gnu/usr.bin/perl/t/lib/warnings/pad index b226239ab1b..03c4ddb7c06 100644 --- a/gnu/usr.bin/perl/t/lib/warnings/pad +++ b/gnu/usr.bin/perl/t/lib/warnings/pad @@ -173,7 +173,7 @@ sub { }->(); f(); EXPECT -Variable "$x" is not available at (eval 1) line 2. +Variable "$x" is not available at (eval 1) line 1. ######## # pad.c use warnings 'closure' ; @@ -195,7 +195,7 @@ sub f { } f()->(); EXPECT -Variable "$x" is not available at (eval 1) line 2. +Variable "$x" is not available at (eval 1) line 1. ######## use warnings 'closure' ; { @@ -205,7 +205,7 @@ use warnings 'closure' ; } f2(); EXPECT -Variable "$x" is not available at (eval 1) line 2. +Variable "$x" is not available at (eval 1) line 1. ######## use warnings 'closure' ; for my $x (1,2,3) { @@ -214,7 +214,7 @@ for my $x (1,2,3) { } f(); EXPECT -Variable "$x" is not available at (eval 4) line 2. +Variable "$x" is not available at (eval 4) line 1. ######## # pad.c no warnings 'closure' ; @@ -433,7 +433,7 @@ sub { }->(); f(); EXPECT -Variable "$に" is not available at (eval 1) line 2. +Variable "$に" is not available at (eval 1) line 1. ######## # pad.c # see bugid 1754 @@ -446,7 +446,7 @@ sub f { } f()->(); EXPECT -Variable "$に" is not available at (eval 1) line 2. +Variable "$に" is not available at (eval 1) line 1. ######## use warnings 'closure' ; BEGIN { binmode STDERR, 'utf8'; } @@ -458,7 +458,7 @@ BEGIN { binmode STDERR, 'utf8'; } } f2(); EXPECT -Variable "$に" is not available at (eval 1) line 2. +Variable "$に" is not available at (eval 1) line 1. ######## use warnings 'closure' ; BEGIN { binmode STDERR, 'utf8'; } @@ -469,7 +469,7 @@ for my $に (1,2,3) { } f(); EXPECT -Variable "$に" is not available at (eval 4) line 2. +Variable "$に" is not available at (eval 4) line 1. ######## # pad.c use warnings 'closure' ; @@ -534,7 +534,7 @@ sub { }->(); f(); EXPECT -Variable "$è" is not available at (eval 1) line 2. +Variable "$è" is not available at (eval 1) line 1. ######## # pad.c # see bugid 1754 @@ -547,7 +547,7 @@ sub f { } f()->(); EXPECT -Variable "$è" is not available at (eval 1) line 2. +Variable "$è" is not available at (eval 1) line 1. ######## use warnings 'closure' ; BEGIN { binmode STDERR, 'utf8'; } @@ -559,7 +559,7 @@ BEGIN { binmode STDERR, 'utf8'; } } f2(); EXPECT -Variable "$è" is not available at (eval 1) line 2. +Variable "$è" is not available at (eval 1) line 1. ######## use warnings 'closure' ; BEGIN { binmode STDERR, 'utf8'; } @@ -570,5 +570,5 @@ for my $è (1,2,3) { } f(); EXPECT -Variable "$è" is not available at (eval 4) line 2. +Variable "$è" is not available at (eval 4) line 1. ######## diff --git a/gnu/usr.bin/perl/t/lib/warnings/perl b/gnu/usr.bin/perl/t/lib/warnings/perl index f619cc6a249..a00ed62b395 100644 --- a/gnu/usr.bin/perl/t/lib/warnings/perl +++ b/gnu/usr.bin/perl/t/lib/warnings/perl @@ -223,3 +223,9 @@ BEGIN { $^W = 1 } $ŷ = 3 ; EXPECT Name "ɕლȃṢȿ::ŷ" used only once: possible typo at - line 9. +######## + +use warnings 'once'; +$foo++; BEGIN { eval q|@a =~ s///; sub foo;| } +EXPECT +Name "main::foo" used only once: possible typo at - line 3. diff --git a/gnu/usr.bin/perl/t/lib/warnings/perly b/gnu/usr.bin/perl/t/lib/warnings/perly index d2b95607c00..c912c0ea3c3 100644 --- a/gnu/usr.bin/perl/t/lib/warnings/perly +++ b/gnu/usr.bin/perl/t/lib/warnings/perly @@ -8,23 +8,6 @@ sub fred {} $a = "fred" ; do $a() sub fred {} $a = "fred" ; do $a(1) - Use of qw(...) as parentheses is deprecated - - if qw(a) {} - unless qw(a) {} - if (0) {} elsif qw(a) {} - given qw(a) {} - when qw(a) {} - while qw(a) {} - until qw(a) {} - foreach $x qw(a b c) {} - foreach my $x qw(a b c) {} - $obj->meth qw(a b c) - do foo qw(a b c) - do $subref qw(a b c) - &foo qw(a b c) - $a[0] qw(a b c) - __END__ # perly.y use warnings 'deprecated' ; @@ -45,222 +28,3 @@ Use of "do" to call subroutines is deprecated at - line 4. Use of "do" to call subroutines is deprecated at - line 5. Use of "do" to call subroutines is deprecated at - line 7. Use of "do" to call subroutines is deprecated at - line 8. -######## -use warnings qw(deprecated void); -if qw(a) { print "x0\n"; } else { } -if qw(0) { print "x1\n"; } else { } -if qw(z a) { print "x2\n"; } else { } -if qw(z 0) { print "x3\n"; } else { } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 2. -Use of qw(...) as parentheses is deprecated at - line 3. -Use of qw(...) as parentheses is deprecated at - line 4. -Useless use of a constant ("z") in void context at - line 4. -Use of qw(...) as parentheses is deprecated at - line 5. -Useless use of a constant ("z") in void context at - line 5. -x0 -x2 -######## -if qw() { print "x0\n"; } else { } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 1. -syntax error at - line 1, near "if qw()" -Execution of - aborted due to compilation errors. -######## -use warnings qw(deprecated void); -unless qw(a) { print "x0\n"; } else { } -unless qw(0) { print "x1\n"; } else { } -unless qw(z a) { print "x2\n"; } else { } -unless qw(z 0) { print "x3\n"; } else { } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 2. -Use of qw(...) as parentheses is deprecated at - line 3. -Use of qw(...) as parentheses is deprecated at - line 4. -Useless use of a constant ("z") in void context at - line 4. -Use of qw(...) as parentheses is deprecated at - line 5. -Useless use of a constant ("z") in void context at - line 5. -x1 -x3 -######## -unless qw() { print "x0\n"; } else { } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 1. -syntax error at - line 1, near "unless qw()" -Execution of - aborted due to compilation errors. -######## -use warnings qw(deprecated void); -if(0) { print "eek\n"; } elsif qw(a) { print "x0\n"; } else { } -if(0) { print "eek\n"; } elsif qw(0) { print "x1\n"; } else { } -if(0) { print "eek\n"; } elsif qw(z a) { print "x2\n"; } else { } -if(0) { print "eek\n"; } elsif qw(z 0) { print "x3\n"; } else { } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 2. -Use of qw(...) as parentheses is deprecated at - line 3. -Use of qw(...) as parentheses is deprecated at - line 4. -Useless use of a constant ("z") in void context at - line 4. -Use of qw(...) as parentheses is deprecated at - line 5. -Useless use of a constant ("z") in void context at - line 5. -x0 -x2 -######## -if(0) { print "eek\n"; } elsif qw() { print "x0\n"; } else { } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 1. -syntax error at - line 1, near "elsif qw()" -Execution of - aborted due to compilation errors. -######## -use warnings qw(deprecated void); use feature "switch"; -given qw(a) { print "x0 $_\n"; } -given qw(z a) { print "x1 $_\n"; } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 2. -Use of qw(...) as parentheses is deprecated at - line 3. -Useless use of a constant ("z") in void context at - line 3. -x0 a -x1 a -######## -use feature "switch"; -given qw() { print "x0\n"; } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 2. -syntax error at - line 2, near "given qw()" -Execution of - aborted due to compilation errors. -######## -use warnings qw(deprecated void); use feature "switch"; -given("a") { when qw(a) { print "x0\n"; } } -given("a") { when qw(b) { print "x1\n"; } } -given("a") { when qw(z a) { print "x2\n"; } } -given("a") { when qw(z b) { print "x3\n"; } } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 2. -Use of qw(...) as parentheses is deprecated at - line 3. -Use of qw(...) as parentheses is deprecated at - line 4. -Useless use of a constant ("z") in void context at - line 4. -Use of qw(...) as parentheses is deprecated at - line 5. -Useless use of a constant ("z") in void context at - line 5. -x0 -x2 -######## -use feature "switch"; -given("a") { when qw() { print "x0\n"; } } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 2. -syntax error at - line 2, near "when qw()" -syntax error at - line 2, near "} }" -Execution of - aborted due to compilation errors. -######## -use warnings qw(deprecated void); -while qw(a) { print "x0\n"; last; } {;} -while qw(0) { print "x1\n"; last; } {;} -while qw(z a) { print "x2\n"; last; } {;} -while qw(z 0) { print "x3\n"; last; } {;} -EXPECT -Use of qw(...) as parentheses is deprecated at - line 2. -Use of qw(...) as parentheses is deprecated at - line 3. -Use of qw(...) as parentheses is deprecated at - line 4. -Useless use of a constant ("z") in void context at - line 4. -Use of qw(...) as parentheses is deprecated at - line 5. -Useless use of a constant ("z") in void context at - line 5. -x0 -x2 -######## -while qw() { print "x0\n"; last; } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 1. -x0 -######## -use warnings qw(deprecated void); -until qw(a) { print "x0\n"; last; } {;} -until qw(0) { print "x1\n"; last; } {;} -until qw(z a) { print "x2\n"; last; } {;} -until qw(z 0) { print "x3\n"; last; } {;} -EXPECT -Use of qw(...) as parentheses is deprecated at - line 2. -Use of qw(...) as parentheses is deprecated at - line 3. -Use of qw(...) as parentheses is deprecated at - line 4. -Useless use of a constant ("z") in void context at - line 4. -Use of qw(...) as parentheses is deprecated at - line 5. -Useless use of a constant ("z") in void context at - line 5. -x1 -x3 -######## -until qw() { print "x0\n"; } else { } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 1. -syntax error at - line 1, near "until qw()" -Execution of - aborted due to compilation errors. -######## -foreach $x qw(a b c) { print $x, "\n"; } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 1. -a -b -c -######## -foreach $x qw() { print $x, "\n"; } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 1. -syntax error at - line 1, near "$x qw()" -Execution of - aborted due to compilation errors. -######## -foreach my $x qw(a b c) { print $x, "\n"; } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 1. -a -b -c -######## -foreach my $x qw() { print $x, "\n"; } -EXPECT -Use of qw(...) as parentheses is deprecated at - line 1. -syntax error at - line 1, near "$x qw()" -Execution of - aborted due to compilation errors. -######## -sub a5c85eef3bf30129e20989e96b099d13::foo { print "+", join(":", @_), "\n"; } -"a5c85eef3bf30129e20989e96b099d13"->foo qw(); {;} -"a5c85eef3bf30129e20989e96b099d13"->foo qw(a b c); {;} -EXPECT -Use of qw(...) as parentheses is deprecated at - line 2. -Use of qw(...) as parentheses is deprecated at - line 3. -+a5c85eef3bf30129e20989e96b099d13 -+a5c85eef3bf30129e20989e96b099d13:a:b:c -######## -sub fd4de2af1449cec72693c36842d41862 { print "+", join(":", @_), "\n"; } -do fd4de2af1449cec72693c36842d41862 qw(); {;} -do fd4de2af1449cec72693c36842d41862 qw(a b c); {;} -EXPECT -Use of qw(...) as parentheses is deprecated at - line 2. -Use of "do" to call subroutines is deprecated at - line 2. -Use of qw(...) as parentheses is deprecated at - line 3. -Use of "do" to call subroutines is deprecated at - line 3. -+ -+a:b:c -######## -$subref = sub { print "+", join(":", @_), "\n"; }; -do $subref qw(); -do $subref qw(a b c); -EXPECT -Use of qw(...) as parentheses is deprecated at - line 2. -Use of "do" to call subroutines is deprecated at - line 2. -Use of qw(...) as parentheses is deprecated at - line 3. -Use of "do" to call subroutines is deprecated at - line 3. -+ -+a:b:c -######## -sub e293a8f7cb38880a48867fcb336448e5 { print "+", join(":", @_), "\n"; } -&e293a8f7cb38880a48867fcb336448e5 qw(); -&e293a8f7cb38880a48867fcb336448e5 qw(a b c); -EXPECT -Use of qw(...) as parentheses is deprecated at - line 2. -Use of qw(...) as parentheses is deprecated at - line 3. -+ -+a:b:c -######## -my @a = (sub { print "+", join(":", @_), "\n"; }); -$a[0] qw(); -$a[0] qw(a b c); -EXPECT -Use of qw(...) as parentheses is deprecated at - line 2. -Use of qw(...) as parentheses is deprecated at - line 3. -+ -+a:b:c diff --git a/gnu/usr.bin/perl/t/lib/warnings/pp b/gnu/usr.bin/perl/t/lib/warnings/pp index 89ebcbcbc47..ab8f9516518 100644 --- a/gnu/usr.bin/perl/t/lib/warnings/pp +++ b/gnu/usr.bin/perl/t/lib/warnings/pp @@ -37,10 +37,16 @@ use warnings 'substr' ; $a = "ab" ; $b = \$a ; substr($b, 1,1) = "ab" ; +$b = \$a; +substr($b, 1,1) = "\x{100}" ; no warnings 'substr' ; +$b = \$a; substr($b, 1,1) = "ab" ; +$b = \$a; +substr($b, 1,1) = "\x{100}" ; EXPECT Attempt to use reference as lvalue in substr at - line 5. +Attempt to use reference as lvalue in substr at - line 7. ######## # pp.c use warnings 'misc' ; diff --git a/gnu/usr.bin/perl/t/lib/warnings/pp_hot b/gnu/usr.bin/perl/t/lib/warnings/pp_hot index 9ef68e01eba..ad63d2a935f 100644 --- a/gnu/usr.bin/perl/t/lib/warnings/pp_hot +++ b/gnu/usr.bin/perl/t/lib/warnings/pp_hot @@ -61,6 +61,15 @@ EXPECT print() on unopened filehandle abc at - line 4. ######## # pp_hot.c [pp_print] +use warnings 'unopened' ; +$SIG{__WARN__} = sub { warn $_[0] =~ s/\0/\\0/rug; }; +print {"a\0b"} "anc"; +print {"\0b"} "anc"; +EXPECT +print() on unopened filehandle a\0b at - line 4. +print() on unopened filehandle \0b at - line 5. +######## +# pp_hot.c [pp_print] use warnings 'io' ; # There is no guarantee that STDOUT is output only, or STDIN input only. # Certainly on some BSDs (at least FreeBSD, Darwin, BSDi) file descriptors @@ -90,6 +99,24 @@ Filehandle FH opened only for input at - line 19. Filehandle FOO opened only for input at - line 20. ######## # pp_hot.c [pp_print] +$SIG{__WARN__} = sub { warn $_[0] =~ s/\0/\\0/rug; }; +use warnings 'io' ; +my $file = "./xcv" ; unlink $file ; +open (FH, ">$file") or die $! ; +close FH or die $! ; +die "There is no file $file" unless -f $file ; +open ("a\0b", "<$file") or die $! ; +print {"a\0b"} "anc" ; +open ("\0b", "<$file") or die $! ; +print {"\0b"} "anc" ; +close "a\0b" or die $! ; +close "\0b" or die $! ; +unlink $file ; +EXPECT +Filehandle a\0b opened only for input at - line 9. +Filehandle \0b opened only for input at - line 11. +######## +# pp_hot.c [pp_print] use warnings 'closed' ; close STDIN ; print STDIN "anc"; diff --git a/gnu/usr.bin/perl/t/lib/warnings/regcomp b/gnu/usr.bin/perl/t/lib/warnings/regcomp index b435d2a1da6..19b6b06f6f4 100644 --- a/gnu/usr.bin/perl/t/lib/warnings/regcomp +++ b/gnu/usr.bin/perl/t/lib/warnings/regcomp @@ -1,266 +1,3 @@ - regcomp.c AOK - - Quantifier unexpected on zero-length expression [S_study_chunk] - - Useless (%s%c) - %suse /%c modifier [S_reg] - Useless (%sc) - %suse /gc modifier [S_reg] - - - - Strange *+?{} on zero-length expression [S_study_chunk] - /(?=a)?/ - - %.*s matches null string many times [S_regpiece] - $a = "ABC123" ; $a =~ /(?=a)*/' - - /%.127s/: Unrecognized escape \\%c passed through [S_regatom] - $x = '\m' ; /$x/ - - POSIX syntax [%c %c] belongs inside character classes [S_checkposixcc] - - - Character class [:%.*s:] unknown [S_regpposixcc] - - Character class syntax [%c %c] belongs inside character classes [S_checkposixcc] - - /%.127s/: false [] range \"%*.*s\" in regexp [S_regclass] - - /%.127s/: false [] range \"%*.*s\" in regexp [S_regclassutf8] - - /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclass] - - /%.127s/: Unrecognized escape \\%c in character class passed through" [S_regclassutf8] - - False [] range \"%*.*s\" [S_regclass] + regcomp.c These tests have been moved to t/re/reg_mesg.t __END__ -# regcomp.c [S_regpiece] -use warnings 'regexp' ; -my $a = "ABC123" ; -$a =~ /(?=a)*/ ; -no warnings 'regexp' ; -$a =~ /(?=a)*/ ; -EXPECT -(?=a)* matches null string many times in regex; marked by <-- HERE in m/(?=a)* <-- HERE / at - line 4. -######## -# regcomp.c [S_regatom] -$x = '\m' ; -use warnings 'regexp' ; -$a =~ /a$x/ ; -no warnings 'regexp' ; -$a =~ /a$x/ ; -EXPECT -Unrecognized escape \m passed through in regex; marked by <-- HERE in m/a\m <-- HERE / at - line 4. -######## -# regcomp.c [S_regatom] -# The \q should warn, the \_ should NOT warn. -use warnings 'regexp'; -"foo" =~ /\q/; -"foo" =~ /\q{/; -"foo" =~ /a\b{cde/; -"foo" =~ /a\B{cde/; -"bar" =~ /\_/; -no warnings 'regexp'; -"foo" =~ /\q/; -"foo" =~ /\q{/; -"foo" =~ /a\b{cde/; -"foo" =~ /a\B{cde/; -"bar" =~ /\_/; -EXPECT -Unrecognized escape \q passed through in regex; marked by <-- HERE in m/\q <-- HERE / at - line 4. -Unrecognized escape \q{ passed through in regex; marked by <-- HERE in m/\q{ <-- HERE / at - line 5. -"\b{" is deprecated; use "\b\{" instead in regex; marked by <-- HERE in m/a\ <-- HERE b{cde/ at - line 6. -"\B{" is deprecated; use "\B\{" instead in regex; marked by <-- HERE in m/a\ <-- HERE B{cde/ at - line 7. -######## -# regcomp.c [S_regpposixcc S_checkposixcc] -# -use warnings 'regexp' ; -$_ = "" ; -/[:alpha:]/; -/[:zog:]/; -no warnings 'regexp' ; -/[:alpha:]/; -/[:zog:]/; -EXPECT -POSIX syntax [: :] belongs inside character classes in regex; marked by <-- HERE in m/[:alpha:] <-- HERE / at - line 5. -POSIX syntax [: :] belongs inside character classes in regex; marked by <-- HERE in m/[:zog:] <-- HERE / at - line 6. -######## -# regcomp.c [S_checkposixcc] -# -use warnings 'regexp' ; -$_ = "" ; -/[.zog.]/; -no warnings 'regexp' ; -/[.zog.]/; -EXPECT -POSIX syntax [. .] belongs inside character classes in regex; marked by <-- HERE in m/[.zog.] <-- HERE / at - line 5. -POSIX syntax [. .] is reserved for future extensions in regex; marked by <-- HERE in m/[.zog.] <-- HERE / at - line 5. -######## -# regcomp.c [S_regclass] -$_ = ""; -use warnings 'regexp' ; -/[a-b]/; -/[a-\d]/; -/[\d-b]/; -/[\s-\d]/; -/[\d-\s]/; -/[a-[:digit:]]/; -/[[:digit:]-b]/; -/[[:alpha:]-[:digit:]]/; -/[[:digit:]-[:alpha:]]/; -no warnings 'regexp' ; -/[a-b]/; -/[a-\d]/; -/[\d-b]/; -/[\s-\d]/; -/[\d-\s]/; -/[a-[:digit:]]/; -/[[:digit:]-b]/; -/[[:alpha:]-[:digit:]]/; -/[[:digit:]-[:alpha:]]/; -EXPECT -False [] range "a-\d" in regex; marked by <-- HERE in m/[a-\d <-- HERE ]/ at - line 5. -False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE b]/ at - line 6. -False [] range "\s-" in regex; marked by <-- HERE in m/[\s- <-- HERE \d]/ at - line 7. -False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE \s]/ at - line 8. -False [] range "a-[:digit:]" in regex; marked by <-- HERE in m/[a-[:digit:] <-- HERE ]/ at - line 9. -False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE b]/ at - line 10. -False [] range "[:alpha:]-" in regex; marked by <-- HERE in m/[[:alpha:]- <-- HERE [:digit:]]/ at - line 11. -False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE [:alpha:]]/ at - line 12. -######## -# regcomp.c [S_regclassutf8] -BEGIN { - if (ord("\t") == 5) { - print "SKIPPED\n# ebcdic regular expression ranges differ."; - exit 0; - } -} -use utf8; -$_ = ""; -use warnings 'regexp' ; -/[a-b]/; -/[a-\d]/; -/[\d-b]/; -/[\s-\d]/; -/[\d-\s]/; -/[a-[:digit:]]/; -/[[:digit:]-b]/; -/[[:alpha:]-[:digit:]]/; -/[[:digit:]-[:alpha:]]/; -no warnings 'regexp' ; -/[a-b]/; -/[a-\d]/; -/[\d-b]/; -/[\s-\d]/; -/[\d-\s]/; -/[a-[:digit:]]/; -/[[:digit:]-b]/; -/[[:alpha:]-[:digit:]]/; -/[[:digit:]-[:alpha:]]/; -EXPECT -False [] range "a-\d" in regex; marked by <-- HERE in m/[a-\d <-- HERE ]/ at - line 12. -False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE b]/ at - line 13. -False [] range "\s-" in regex; marked by <-- HERE in m/[\s- <-- HERE \d]/ at - line 14. -False [] range "\d-" in regex; marked by <-- HERE in m/[\d- <-- HERE \s]/ at - line 15. -False [] range "a-[:digit:]" in regex; marked by <-- HERE in m/[a-[:digit:] <-- HERE ]/ at - line 16. -False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE b]/ at - line 17. -False [] range "[:alpha:]-" in regex; marked by <-- HERE in m/[[:alpha:]- <-- HERE [:digit:]]/ at - line 18. -False [] range "[:digit:]-" in regex; marked by <-- HERE in m/[[:digit:]- <-- HERE [:alpha:]]/ at - line 19. -######## -# regcomp.c [S_regclass S_regclassutf8] -use warnings 'regexp' ; -$a =~ /[a\zb]/ ; -no warnings 'regexp' ; -$a =~ /[a\zb]/ ; -EXPECT -Unrecognized escape \z in character class passed through in regex; marked by <-- HERE in m/[a\z <-- HERE b]/ at - line 3. - -######## -# regcomp.c [S_reg] -use warnings 'regexp' ; -$a = qr/(?c)/; -$a = qr/(?-c)/; -$a = qr/(?g)/; -$a = qr/(?-g)/; -$a = qr/(?o)/; -$a = qr/(?-o)/; -$a = qr/(?g-o)/; -$a = qr/(?g-c)/; -$a = qr/(?o-cg)/; # (?c) means (?g) error won't be thrown -$a = qr/(?ogc)/; -no warnings 'regexp' ; -$a = qr/(?c)/; -$a = qr/(?-c)/; -$a = qr/(?g)/; -$a = qr/(?-g)/; -$a = qr/(?o)/; -$a = qr/(?-o)/; -$a = qr/(?g-o)/; -$a = qr/(?g-c)/; -$a = qr/(?o-cg)/; # (?c) means (?g) error won't be thrown -$a = qr/(?ogc)/; -#EXPECT -EXPECT -Useless (?c) - use /gc modifier in regex; marked by <-- HERE in m/(?c <-- HERE )/ at - line 3. -Useless (?-c) - don't use /gc modifier in regex; marked by <-- HERE in m/(?-c <-- HERE )/ at - line 4. -Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?g <-- HERE )/ at - line 5. -Useless (?-g) - don't use /g modifier in regex; marked by <-- HERE in m/(?-g <-- HERE )/ at - line 6. -Useless (?o) - use /o modifier in regex; marked by <-- HERE in m/(?o <-- HERE )/ at - line 7. -Useless (?-o) - don't use /o modifier in regex; marked by <-- HERE in m/(?-o <-- HERE )/ at - line 8. -Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?g <-- HERE -o)/ at - line 9. -Useless (?-o) - don't use /o modifier in regex; marked by <-- HERE in m/(?g-o <-- HERE )/ at - line 9. -Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?g <-- HERE -c)/ at - line 10. -Useless (?-c) - don't use /gc modifier in regex; marked by <-- HERE in m/(?g-c <-- HERE )/ at - line 10. -Useless (?o) - use /o modifier in regex; marked by <-- HERE in m/(?o <-- HERE -cg)/ at - line 11. -Useless (?-c) - don't use /gc modifier in regex; marked by <-- HERE in m/(?o-c <-- HERE g)/ at - line 11. -Useless (?o) - use /o modifier in regex; marked by <-- HERE in m/(?o <-- HERE gc)/ at - line 12. -Useless (?g) - use /g modifier in regex; marked by <-- HERE in m/(?og <-- HERE c)/ at - line 12. -Useless (?c) - use /gc modifier in regex; marked by <-- HERE in m/(?ogc <-- HERE )/ at - line 12. -######## -# regcomp.c [S_regatom] -$a = qr/\o{/; -EXPECT -Missing right brace on \o{ in regex; marked by <-- HERE in m/\o{ <-- HERE / at - line 2. -######## -# regcomp.c [S_regatom] -$a = qr/\o/; -EXPECT -Missing braces on \o{} in regex; marked by <-- HERE in m/\o <-- HERE / at - line 2. -######## -# regcomp.c [S_regatom] -$a = qr/\o{}/; -EXPECT -Number with no digits in regex; marked by <-- HERE in m/\o{} <-- HERE / at - line 2. -######## -# regcomp.c [S_regclass] -$a = qr/[\o{]/; -EXPECT -Missing right brace on \o{ in regex; marked by <-- HERE in m/[\o{ <-- HERE ]/ at - line 2. -######## -# regcomp.c [S_regclass] -$a = qr/[\o]/; -EXPECT -Missing braces on \o{} in regex; marked by <-- HERE in m/[\o <-- HERE ]/ at - line 2. -######## -# regcomp.c [S_regclass] -$a = qr/[\o{}]/; -EXPECT -Number with no digits in regex; marked by <-- HERE in m/[\o{} <-- HERE ]/ at - line 2. -######## -# regcomp.c [S_regclass] -use warnings 'regexp' ; -$a = qr/[\8\9]/; -$a = qr/[\_\0]/; # Should have no warnings on this and the remainder of this test -$a = qr/[\07]/; -$a = qr/[\006]/; -$a = qr/[\0005]/; -no warnings 'regexp' ; -$a = qr/[\8\9]/; -EXPECT -Unrecognized escape \8 in character class passed through in regex; marked by <-- HERE in m/[\8 <-- HERE \9]/ at - line 3. -Unrecognized escape \9 in character class passed through in regex; marked by <-- HERE in m/[\8\9 <-- HERE ]/ at - line 3. -######## -# regcomp.c [Perl_re_compile] -$a = qr/(?^-i:foo)/; -EXPECT -Sequence (?^-...) not recognized in regex; marked by <-- HERE in m/(?^- <-- HERE i:foo)/ at - line 2. diff --git a/gnu/usr.bin/perl/t/lib/warnings/toke b/gnu/usr.bin/perl/t/lib/warnings/toke index dd8dc3d517a..5ee3ad52109 100644 --- a/gnu/usr.bin/perl/t/lib/warnings/toke +++ b/gnu/usr.bin/perl/t/lib/warnings/toke @@ -143,19 +143,39 @@ Use of comma-less variable list is deprecated at - line 4. Use of comma-less variable list is deprecated at - line 4. ######## # toke.c -$a =~ m/$foo/sand $bar; -$a =~ s/$foo/fool/sand $bar; $a = <<; no warnings 'deprecated' ; -$a =~ m/$foo/sand $bar; -$a =~ s/$foo/fool/sand $bar; $a = <<; EXPECT -Having no space between pattern and following word is deprecated at - line 2. -Having no space between pattern and following word is deprecated at - line 3. -Use of bare << to mean <<"" is deprecated at - line 4. +Use of bare << to mean <<"" is deprecated at - line 2. +######## +# toke.c +$a =~ m/$foo/eq; +$a =~ s/$foo/fool/seq; + +EXPECT +OPTION fatal +Unknown regexp modifier "/e" at - line 2, near "=~ " +Unknown regexp modifier "/q" at - line 2, near "=~ " +Unknown regexp modifier "/q" at - line 3, near "=~ " +Execution of - aborted due to compilation errors. +######## +# toke.c +use utf8; +use open qw( :utf8 :std ); +$a =~ m/$foo/eネq; +$a =~ s/$foo/fool/seネq; + +EXPECT +OPTION fatal +Unknown regexp modifier "/e" at - line 4, near "=~ " +Unknown regexp modifier "/ネ" at - line 4, near "=~ " +Unknown regexp modifier "/q" at - line 4, near "=~ " +Unknown regexp modifier "/ネ" at - line 5, near "=~ " +Unknown regexp modifier "/q" at - line 5, near "=~ " +Execution of - aborted due to compilation errors. ######## # toke.c use warnings 'syntax' ; @@ -662,6 +682,8 @@ yelp at foo line 30. ######## # toke.c my $a = rand + 4 ; +$a = rand *^H ; +$a = rand $^H ; EXPECT Warning: Use of "rand" without parentheses is ambiguous at - line 2. ######## @@ -696,6 +718,8 @@ EXPECT # toke.c sub fred {}; -fred ; +sub hank : lvalue {$_} +--hank; # This should *not* warn [perl #77240] EXPECT Ambiguous use of -fred resolved as -&fred() at - line 3. ######## @@ -1063,7 +1087,7 @@ Number found where operator expected at (eval 1) line 1, near "5 6" (Missing operator before 6?) ######## # toke.c -use warnings "syntax"; +use warnings "syntax"; no warnings "deprecated"; $_ = $a = 1; $a !=~ /1/; $a !=~ m#1#; @@ -1111,7 +1135,7 @@ Use of :locked is deprecated at - line 4. Use of :locked is deprecated at - line 6. ######## # toke.c -use warnings "syntax"; +use warnings "syntax"; use feature 'lexical_subs'; sub proto_after_array(@$); sub proto_after_arref(\@$); sub proto_after_arref2(\[@$]); @@ -1123,6 +1147,14 @@ sub underscore_last_pos($_); sub underscore2($_;$); sub underscore_fail($_$); sub underscore_after_at(@_); +our sub hour (@$); +my sub migh (@$); +use feature 'state'; +state sub estate (@$); +package other; +sub hour (@$); +sub migh (@$); +sub estate (@$); no warnings "syntax"; sub proto_after_array(@$); sub proto_after_hash(%$); @@ -1132,6 +1164,15 @@ Prototype after '@' for main::proto_after_array : @$ at - line 3. Prototype after '%' for main::proto_after_hash : %$ at - line 7. Illegal character after '_' in prototype for main::underscore_fail : $_$ at - line 12. Prototype after '@' for main::underscore_after_at : @_ at - line 13. +The lexical_subs feature is experimental at - line 14. +Prototype after '@' for hour : @$ at - line 14. +The lexical_subs feature is experimental at - line 15. +Prototype after '@' for migh : @$ at - line 15. +The lexical_subs feature is experimental at - line 17. +Prototype after '@' for estate : @$ at - line 17. +Prototype after '@' for hour : @$ at - line 19. +Prototype after '@' for migh : @$ at - line 20. +Prototype after '@' for estate : @$ at - line 21. ######## # toke.c use warnings "ambiguous"; @@ -1250,3 +1291,45 @@ use warnings; CORE::렏; EXPECT CORE::렏 is not a keyword at - line 5. +######## +# toke.c +# [perl #16249] +print ''; +eval this_method_is_fake (); +EXPECT +Undefined subroutine &main::this_method_is_fake called at - line 4. +######## +# toke.c +# [perl #107002] Erroneous ambiguity warnings +sub { # do not actually call require + require a::b . 1; # These used to produce erroneous + require a::b + 1; # ambiguity warnings. +} +EXPECT +######## +# toke.c +# [perl #113094] +print "aa" =~ m{^a\{1,2\}$}, "\n"; +print "aa" =~ m{^a\x\{61\}$}, "\n"; +print "aa" =~ m{^a{1,2}$}, "\n"; +print "aq" =~ m[^a\[a-z\]$], "\n"; +print "aq" =~ m(^a\(q\)$), "\n"; +no warnings 'deprecated'; +print "aa" =~ m{^a\{1,2\}$}, "\n"; +print "aa" =~ m{^a\x\{61\}$}, "\n"; +print "aq" =~ m[^a\[a-z\]$], "\n"; +print "aq" =~ m(^a\(q\)$), "\n"; +EXPECT +Useless use of '\'; doesn't escape metacharacter '{' at - line 3. +Useless use of '\'; doesn't escape metacharacter '{' at - line 4. +Useless use of '\'; doesn't escape metacharacter '[' at - line 6. +Useless use of '\'; doesn't escape metacharacter '(' at - line 7. +1 +1 +1 +1 +q +1 +1 +1 +q diff --git a/gnu/usr.bin/perl/t/lib/warnings/utf8 b/gnu/usr.bin/perl/t/lib/warnings/utf8 index 603cfa0faf4..1274cf9f2f7 100644 --- a/gnu/usr.bin/perl/t/lib/warnings/utf8 +++ b/gnu/usr.bin/perl/t/lib/warnings/utf8 @@ -170,7 +170,283 @@ chr(0x10000) =~ /\p{Any}/; chr(0x100000) =~ /\p{Any}/; chr(0x10FFFE) =~ /\p{Any}/; chr(0x10FFFF) =~ /\p{Any}/; -chr(0x110000) =~ /\p{Any}/; +chr(0x110000) =~ /[\w\p{Any}]/; +chr(0x110010) =~ /[\w\p{PosixWord}]/; +chr(0x110011) =~ /[\w\P{PosixWord}]/; +chr(0x110012) =~ /[\w\p{XPosixWord}]/; +chr(0x110013) =~ /[\w\P{XPosixWord}]/; +chr(0x110014) =~ /[\w\p{PosixAlnum}]/; +chr(0x110015) =~ /[\w\P{PosixAlnum}]/; +chr(0x110016) =~ /[\w\p{XPosixAlnum}]/; +chr(0x110017) =~ /[\w\P{XPosixAlnum}]/; +chr(0x110018) =~ /[\w\p{PosixSpace}]/; +chr(0x110019) =~ /[\w\P{PosixSpace}]/; +chr(0x11001A) =~ /[\w\p{XPosixSpace}]/; +chr(0x11001B) =~ /[\w\P{XPosixSpace}]/; +chr(0x11001C) =~ /[\w\p{PosixDigit}]/; +chr(0x11001D) =~ /[\w\P{PosixDigit}]/; +chr(0x11001E) =~ /[\w\p{XPosixDigit}]/; +chr(0x11001F) =~ /[\w\P{XPosixDigit}]/; +chr(0x110020) =~ /[\w\p{PosixAlpha}]/; +chr(0x110021) =~ /[\w\P{PosixAlpha}]/; +chr(0x110022) =~ /[\w\p{XPosixAlpha}]/; +chr(0x110023) =~ /[\w\P{XPosixAlpha}]/; +chr(0x110024) =~ /[\w\p{Ascii}]/; +chr(0x110025) =~ /[\w\P{Ascii}]/; +chr(0x110026) =~ /[\w\p{PosixCntrl}]/; +chr(0x110027) =~ /[\w\P{PosixCntrl}]/; +chr(0x110028) =~ /[\w\p{XPosixCntrl}]/; +chr(0x110029) =~ /[\w\P{XPosixCntrl}]/; +chr(0x11002A) =~ /[\w\p{PosixGraph}]/; +chr(0x11002B) =~ /[\w\P{PosixGraph}]/; +chr(0x11002C) =~ /[\w\p{XPosixGraph}]/; +chr(0x11002D) =~ /[\w\P{XPosixGraph}]/; +chr(0x11002E) =~ /[\w\p{PosixLower}]/; +chr(0x11002F) =~ /[\w\P{PosixLower}]/; +chr(0x110030) =~ /[\w\p{XPosixLower}]/; +chr(0x110031) =~ /[\w\P{XPosixLower}]/; +chr(0x110032) =~ /[\w\p{PosixPrint}]/; +chr(0x110033) =~ /[\w\P{PosixPrint}]/; +chr(0x110034) =~ /[\w\p{XPosixPrint}]/; +chr(0x110035) =~ /[\w\P{XPosixPrint}]/; +chr(0x110036) =~ /[\w\p{PosixPunct}]/; +chr(0x110037) =~ /[\w\P{PosixPunct}]/; +chr(0x110038) =~ /[\w\p{XPosixPunct}]/; +chr(0x110039) =~ /[\w\P{XPosixPunct}]/; +chr(0x11003A) =~ /[\w\p{PosixUpper}]/; +chr(0x11003B) =~ /[\w\P{PosixUpper}]/; +chr(0x11003C) =~ /[\w\p{XPosixUpper}]/; +chr(0x11003D) =~ /[\w\P{XPosixUpper}]/; +chr(0x11003E) =~ /[\w\p{PosixXdigit}]/; +chr(0x11003F) =~ /[\w\P{PosixXdigit}]/; +chr(0x110040) =~ /[\w\p{XPosixXdigit}]/; +chr(0x110041) =~ /[\w\P{XPosixXdigit}]/; +chr(0x110042) =~ /[\w\p{PerlSpace}]/; +chr(0x110043) =~ /[\w\P{PerlSpace}]/; +chr(0x110044) =~ /[\w\p{XPerlSpace}]/; +chr(0x110045) =~ /[\w\P{XPerlSpace}]/; +chr(0x110046) =~ /[\w\p{PosixBlank}]/; +chr(0x110047) =~ /[\w\P{PosixBlank}]/; +chr(0x110048) =~ /[\w\p{XPosixBlank}]/; +chr(0x110049) =~ /[\w\P{XPosixBlank}]/; +# Currently some warnings from the above are output twice +# Only Unicode properties give non-Unicode warnings, and not when something +# else in the class matches above Unicode. Below we test three ways where +# something outside the property may match non-Unicode: a code point above it, +# a class \S that we know at compile time doesn't, and a class \W whose values +# aren't (at the time of this writing) specified at compile time, but which +# wouldn't match +chr(0x110050) =~ /\w/; +chr(0x110051) =~ /\W/; +chr(0x110052) =~ /\d/; +chr(0x110053) =~ /\D/; +chr(0x110054) =~ /\s/; +chr(0x110055) =~ /\S/; +chr(0x110056) =~ /[[:word:]]/; +chr(0x110057) =~ /[[:^word:]]/; +chr(0x110058) =~ /[[:alnum:]]/; +chr(0x110059) =~ /[[:^alnum:]]/; +chr(0x11005A) =~ /[[:space:]]/; +chr(0x11005B) =~ /[[:^space:]]/; +chr(0x11005C) =~ /[[:digit:]]/; +chr(0x11005D) =~ /[[:^digit:]]/; +chr(0x11005E) =~ /[[:alpha:]]/; +chr(0x11005F) =~ /[[:^alpha:]]/; +chr(0x110060) =~ /[[:ascii:]]/; +chr(0x110061) =~ /[[:^ascii:]]/; +chr(0x110062) =~ /[[:cntrl:]]/; +chr(0x110063) =~ /[[:^cntrl:]]/; +chr(0x110064) =~ /[[:graph:]]/; +chr(0x110065) =~ /[[:^graph:]]/; +chr(0x110066) =~ /[[:lower:]]/; +chr(0x110067) =~ /[[:^lower:]]/; +chr(0x110068) =~ /[[:print:]]/; +chr(0x110069) =~ /[[:^print:]]/; +chr(0x11006A) =~ /[[:punct:]]/; +chr(0x11006B) =~ /[[:^punct:]]/; +chr(0x11006C) =~ /[[:upper:]]/; +chr(0x11006D) =~ /[[:^upper:]]/; +chr(0x11006E) =~ /[[:xdigit:]]/; +chr(0x11006F) =~ /[[:^xdigit:]]/; +chr(0x110070) =~ /[[:blank:]]/; +chr(0x110071) =~ /[[:^blank:]]/; +chr(0x111000) =~ /[\W\p{Any}]/; +chr(0x111010) =~ /[\W\p{PosixWord}]/; +chr(0x111011) =~ /[\W\P{PosixWord}]/; +chr(0x111012) =~ /[\W\p{XPosixWord}]/; +chr(0x111013) =~ /[\W\P{XPosixWord}]/; +chr(0x111014) =~ /[\W\p{PosixAlnum}]/; +chr(0x111015) =~ /[\W\P{PosixAlnum}]/; +chr(0x111016) =~ /[\W\p{XPosixAlnum}]/; +chr(0x111017) =~ /[\W\P{XPosixAlnum}]/; +chr(0x111018) =~ /[\W\p{PosixSpace}]/; +chr(0x111019) =~ /[\W\P{PosixSpace}]/; +chr(0x11101A) =~ /[\W\p{XPosixSpace}]/; +chr(0x11101B) =~ /[\W\P{XPosixSpace}]/; +chr(0x11101C) =~ /[\W\p{PosixDigit}]/; +chr(0x11101D) =~ /[\W\P{PosixDigit}]/; +chr(0x11101E) =~ /[\W\p{XPosixDigit}]/; +chr(0x11101F) =~ /[\W\P{XPosixDigit}]/; +chr(0x111020) =~ /[\W\p{PosixAlpha}]/; +chr(0x111021) =~ /[\W\P{PosixAlpha}]/; +chr(0x111022) =~ /[\W\p{XPosixAlpha}]/; +chr(0x111023) =~ /[\W\P{XPosixAlpha}]/; +chr(0x111024) =~ /[\W\p{Ascii}]/; +chr(0x111025) =~ /[\W\P{Ascii}]/; +chr(0x111026) =~ /[\W\p{PosixCntrl}]/; +chr(0x111027) =~ /[\W\P{PosixCntrl}]/; +chr(0x111028) =~ /[\W\p{XPosixCntrl}]/; +chr(0x111029) =~ /[\W\P{XPosixCntrl}]/; +chr(0x11102A) =~ /[\W\p{PosixGraph}]/; +chr(0x11102B) =~ /[\W\P{PosixGraph}]/; +chr(0x11102C) =~ /[\W\p{XPosixGraph}]/; +chr(0x11102D) =~ /[\W\P{XPosixGraph}]/; +chr(0x11102E) =~ /[\W\p{PosixLower}]/; +chr(0x11102F) =~ /[\W\P{PosixLower}]/; +chr(0x111030) =~ /[\W\p{XPosixLower}]/; +chr(0x111031) =~ /[\W\P{XPosixLower}]/; +chr(0x111032) =~ /[\W\p{PosixPrint}]/; +chr(0x111033) =~ /[\W\P{PosixPrint}]/; +chr(0x111034) =~ /[\W\p{XPosixPrint}]/; +chr(0x111035) =~ /[\W\P{XPosixPrint}]/; +chr(0x111036) =~ /[\W\p{PosixPunct}]/; +chr(0x111037) =~ /[\W\P{PosixPunct}]/; +chr(0x111038) =~ /[\W\p{XPosixPunct}]/; +chr(0x111039) =~ /[\W\P{XPosixPunct}]/; +chr(0x11103A) =~ /[\W\p{PosixUpper}]/; +chr(0x11103B) =~ /[\W\P{PosixUpper}]/; +chr(0x11103C) =~ /[\W\p{XPosixUpper}]/; +chr(0x11103D) =~ /[\W\P{XPosixUpper}]/; +chr(0x11103E) =~ /[\W\p{PosixXdigit}]/; +chr(0x11103F) =~ /[\W\P{PosixXdigit}]/; +chr(0x111040) =~ /[\W\p{XPosixXdigit}]/; +chr(0x111041) =~ /[\W\P{XPosixXdigit}]/; +chr(0x111042) =~ /[\W\p{PerlSpace}]/; +chr(0x111043) =~ /[\W\P{PerlSpace}]/; +chr(0x111044) =~ /[\W\p{XPerlSpace}]/; +chr(0x111045) =~ /[\W\P{XPerlSpace}]/; +chr(0x111046) =~ /[\W\p{PosixBlank}]/; +chr(0x111047) =~ /[\W\P{PosixBlank}]/; +chr(0x111048) =~ /[\W\p{XPosixBlank}]/; +chr(0x111049) =~ /[\W\P{XPosixBlank}]/; +chr(0x112000) =~ /[\S\p{Any}]/; +chr(0x112010) =~ /[\S\p{PosixWord}]/; +chr(0x112011) =~ /[\S\P{PosixWord}]/; +chr(0x112012) =~ /[\S\p{XPosixWord}]/; +chr(0x112013) =~ /[\S\P{XPosixWord}]/; +chr(0x112014) =~ /[\S\p{PosixAlnum}]/; +chr(0x112015) =~ /[\S\P{PosixAlnum}]/; +chr(0x112016) =~ /[\S\p{XPosixAlnum}]/; +chr(0x112017) =~ /[\S\P{XPosixAlnum}]/; +chr(0x112018) =~ /[\S\p{PosixSpace}]/; +chr(0x112019) =~ /[\S\P{PosixSpace}]/; +chr(0x11201A) =~ /[\S\p{XPosixSpace}]/; +chr(0x11201B) =~ /[\S\P{XPosixSpace}]/; +chr(0x11201C) =~ /[\S\p{PosixDigit}]/; +chr(0x11201D) =~ /[\S\P{PosixDigit}]/; +chr(0x11201E) =~ /[\S\p{XPosixDigit}]/; +chr(0x11201F) =~ /[\S\P{XPosixDigit}]/; +chr(0x112020) =~ /[\S\p{PosixAlpha}]/; +chr(0x112021) =~ /[\S\P{PosixAlpha}]/; +chr(0x112022) =~ /[\S\p{XPosixAlpha}]/; +chr(0x112023) =~ /[\S\P{XPosixAlpha}]/; +chr(0x112024) =~ /[\S\p{Ascii}]/; +chr(0x112025) =~ /[\S\P{Ascii}]/; +chr(0x112026) =~ /[\S\p{PosixCntrl}]/; +chr(0x112027) =~ /[\S\P{PosixCntrl}]/; +chr(0x112028) =~ /[\S\p{XPosixCntrl}]/; +chr(0x112029) =~ /[\S\P{XPosixCntrl}]/; +chr(0x11202A) =~ /[\S\p{PosixGraph}]/; +chr(0x11202B) =~ /[\S\P{PosixGraph}]/; +chr(0x11202C) =~ /[\S\p{XPosixGraph}]/; +chr(0x11202D) =~ /[\S\P{XPosixGraph}]/; +chr(0x11202E) =~ /[\S\p{PosixLower}]/; +chr(0x11202F) =~ /[\S\P{PosixLower}]/; +chr(0x112030) =~ /[\S\p{XPosixLower}]/; +chr(0x112031) =~ /[\S\P{XPosixLower}]/; +chr(0x112032) =~ /[\S\p{PosixPrint}]/; +chr(0x112033) =~ /[\S\P{PosixPrint}]/; +chr(0x112034) =~ /[\S\p{XPosixPrint}]/; +chr(0x112035) =~ /[\S\P{XPosixPrint}]/; +chr(0x112036) =~ /[\S\p{PosixPunct}]/; +chr(0x112037) =~ /[\S\P{PosixPunct}]/; +chr(0x112038) =~ /[\S\p{XPosixPunct}]/; +chr(0x112039) =~ /[\S\P{XPosixPunct}]/; +chr(0x11203A) =~ /[\S\p{PosixUpper}]/; +chr(0x11203B) =~ /[\S\P{PosixUpper}]/; +chr(0x11203C) =~ /[\S\p{XPosixUpper}]/; +chr(0x11203D) =~ /[\S\P{XPosixUpper}]/; +chr(0x11203E) =~ /[\S\p{PosixXdigit}]/; +chr(0x11203F) =~ /[\S\P{PosixXdigit}]/; +chr(0x112040) =~ /[\S\p{XPosixXdigit}]/; +chr(0x112041) =~ /[\S\P{XPosixXdigit}]/; +chr(0x112042) =~ /[\S\p{PerlSpace}]/; +chr(0x112043) =~ /[\S\P{PerlSpace}]/; +chr(0x112044) =~ /[\S\p{XPerlSpace}]/; +chr(0x112045) =~ /[\S\P{XPerlSpace}]/; +chr(0x112046) =~ /[\S\p{PosixBlank}]/; +chr(0x112047) =~ /[\S\P{PosixBlank}]/; +chr(0x112048) =~ /[\S\p{XPosixBlank}]/; +chr(0x112049) =~ /[\S\P{XPosixBlank}]/; +chr(0x113000) =~ /[\x{110000}\p{Any}]/; +chr(0x113010) =~ /[\x{110000}\p{PosixWord}]/; +chr(0x113011) =~ /[\x{110000}\P{PosixWord}]/; +chr(0x113012) =~ /[\x{110000}\p{XPosixWord}]/; +chr(0x113013) =~ /[\x{110000}\P{XPosixWord}]/; +chr(0x113014) =~ /[\x{110000}\p{PosixAlnum}]/; +chr(0x113015) =~ /[\x{110000}\P{PosixAlnum}]/; +chr(0x113016) =~ /[\x{110000}\p{XPosixAlnum}]/; +chr(0x113017) =~ /[\x{110000}\P{XPosixAlnum}]/; +chr(0x113018) =~ /[\x{110000}\p{PosixSpace}]/; +chr(0x113019) =~ /[\x{110000}\P{PosixSpace}]/; +chr(0x11301A) =~ /[\x{110000}\p{XPosixSpace}]/; +chr(0x11301B) =~ /[\x{110000}\P{XPosixSpace}]/; +chr(0x11301C) =~ /[\x{110000}\p{PosixDigit}]/; +chr(0x11301D) =~ /[\x{110000}\P{PosixDigit}]/; +chr(0x11301E) =~ /[\x{110000}\p{XPosixDigit}]/; +chr(0x11301F) =~ /[\x{110000}\P{XPosixDigit}]/; +chr(0x113020) =~ /[\x{110000}\p{PosixAlpha}]/; +chr(0x113021) =~ /[\x{110000}\P{PosixAlpha}]/; +chr(0x113022) =~ /[\x{110000}\p{XPosixAlpha}]/; +chr(0x113023) =~ /[\x{110000}\P{XPosixAlpha}]/; +chr(0x113024) =~ /[\x{110000}\p{Ascii}]/; +chr(0x113025) =~ /[\x{110000}\P{Ascii}]/; +chr(0x113026) =~ /[\x{110000}\p{PosixCntrl}]/; +chr(0x113027) =~ /[\x{110000}\P{PosixCntrl}]/; +chr(0x113028) =~ /[\x{110000}\p{XPosixCntrl}]/; +chr(0x113029) =~ /[\x{110000}\P{XPosixCntrl}]/; +chr(0x11302A) =~ /[\x{110000}\p{PosixGraph}]/; +chr(0x11302B) =~ /[\x{110000}\P{PosixGraph}]/; +chr(0x11302C) =~ /[\x{110000}\p{XPosixGraph}]/; +chr(0x11302D) =~ /[\x{110000}\P{XPosixGraph}]/; +chr(0x11302E) =~ /[\x{110000}\p{PosixLower}]/; +chr(0x11302F) =~ /[\x{110000}\P{PosixLower}]/; +chr(0x113030) =~ /[\x{110000}\p{XPosixLower}]/; +chr(0x113031) =~ /[\x{110000}\P{XPosixLower}]/; +chr(0x113032) =~ /[\x{110000}\p{PosixPrint}]/; +chr(0x113033) =~ /[\x{110000}\P{PosixPrint}]/; +chr(0x113034) =~ /[\x{110000}\p{XPosixPrint}]/; +chr(0x113035) =~ /[\x{110000}\P{XPosixPrint}]/; +chr(0x113036) =~ /[\x{110000}\p{PosixPunct}]/; +chr(0x113037) =~ /[\x{110000}\P{PosixPunct}]/; +chr(0x113038) =~ /[\x{110000}\p{XPosixPunct}]/; +chr(0x113039) =~ /[\x{110000}\P{XPosixPunct}]/; +chr(0x11303A) =~ /[\x{110000}\p{PosixUpper}]/; +chr(0x11303B) =~ /[\x{110000}\P{PosixUpper}]/; +chr(0x11303C) =~ /[\x{110000}\p{XPosixUpper}]/; +chr(0x11303D) =~ /[\x{110000}\P{XPosixUpper}]/; +chr(0x11303E) =~ /[\x{110000}\p{PosixXdigit}]/; +chr(0x11303F) =~ /[\x{110000}\P{PosixXdigit}]/; +chr(0x113040) =~ /[\x{110000}\p{XPosixXdigit}]/; +chr(0x113041) =~ /[\x{110000}\P{XPosixXdigit}]/; +chr(0x113042) =~ /[\x{110000}\p{PerlSpace}]/; +chr(0x113043) =~ /[\x{110000}\P{PerlSpace}]/; +chr(0x113044) =~ /[\x{110000}\p{XPerlSpace}]/; +chr(0x113045) =~ /[\x{110000}\P{XPerlSpace}]/; +chr(0x113046) =~ /[\x{110000}\p{PosixBlank}]/; +chr(0x113047) =~ /[\x{110000}\P{PosixBlank}]/; +chr(0x113048) =~ /[\x{110000}\p{XPosixBlank}]/; +chr(0x113049) =~ /[\x{110000}\P{XPosixBlank}]/; no warnings 'utf8'; chr(0xD7FF) =~ /\p{Any}/; chr(0xD800) =~ /\p{Any}/; @@ -185,8 +461,187 @@ chr(0x100000) =~ /\p{Any}/; chr(0x10FFFE) =~ /\p{Any}/; chr(0x10FFFF) =~ /\p{Any}/; chr(0x110000) =~ /\p{Any}/; +chr(0x110010) =~ /\p{PosixWord}/; +chr(0x110011) =~ /\P{PosixWord}/; +chr(0x110012) =~ /\p{XPosixWord}/; +chr(0x110013) =~ /\P{XPosixWord}/; +chr(0x110014) =~ /\p{PosixAlnum}/; +chr(0x110015) =~ /\P{PosixAlnum}/; +chr(0x110016) =~ /\p{XPosixAlnum}/; +chr(0x110017) =~ /\P{XPosixAlnum}/; +chr(0x110018) =~ /\p{PosixSpace}/; +chr(0x110019) =~ /\P{PosixSpace}/; +chr(0x11001A) =~ /\p{XPosixSpace}/; +chr(0x11001B) =~ /\P{XPosixSpace}/; +chr(0x11001C) =~ /\p{PosixDigit}/; +chr(0x11001D) =~ /\P{PosixDigit}/; +chr(0x11001E) =~ /\p{XPosixDigit}/; +chr(0x11001F) =~ /\P{XPosixDigit}/; +chr(0x110020) =~ /\p{PosixAlpha}/; +chr(0x110021) =~ /\P{PosixAlpha}/; +chr(0x110022) =~ /\p{XPosixAlpha}/; +chr(0x110023) =~ /\P{XPosixAlpha}/; +chr(0x110024) =~ /\p{Ascii}/; +chr(0x110025) =~ /\P{Ascii}/; +chr(0x110026) =~ /\p{PosixCntrl}/; +chr(0x110027) =~ /\P{PosixCntrl}/; +chr(0x110028) =~ /\p{XPosixCntrl}/; +chr(0x110029) =~ /\P{XPosixCntrl}/; +chr(0x11002A) =~ /\p{PosixGraph}/; +chr(0x11002B) =~ /\P{PosixGraph}/; +chr(0x11002C) =~ /\p{XPosixGraph}/; +chr(0x11002D) =~ /\P{XPosixGraph}/; +chr(0x11002E) =~ /\p{PosixLower}/; +chr(0x11002F) =~ /\P{PosixLower}/; +chr(0x110030) =~ /\p{XPosixLower}/; +chr(0x110031) =~ /\P{XPosixLower}/; +chr(0x110032) =~ /\p{PosixPrint}/; +chr(0x110033) =~ /\P{PosixPrint}/; +chr(0x110034) =~ /\p{XPosixPrint}/; +chr(0x110035) =~ /\P{XPosixPrint}/; +chr(0x110036) =~ /\p{PosixPunct}/; +chr(0x110037) =~ /\P{PosixPunct}/; +chr(0x110038) =~ /\p{XPosixPunct}/; +chr(0x110039) =~ /\P{XPosixPunct}/; +chr(0x11003A) =~ /\p{PosixUpper}/; +chr(0x11003B) =~ /\P{PosixUpper}/; +chr(0x11003C) =~ /\p{XPosixUpper}/; +chr(0x11003D) =~ /\P{XPosixUpper}/; +chr(0x11003E) =~ /\p{PosixXdigit}/; +chr(0x11003F) =~ /\P{PosixXdigit}/; +chr(0x110040) =~ /\p{XPosixXdigit}/; +chr(0x110041) =~ /\P{XPosixXdigit}/; +chr(0x110042) =~ /\p{PerlSpace}/; +chr(0x110043) =~ /\P{PerlSpace}/; +chr(0x110044) =~ /\p{XPerlSpace}/; +chr(0x110045) =~ /\P{XPerlSpace}/; +chr(0x110046) =~ /\p{PosixBlank}/; +chr(0x110047) =~ /\P{PosixBlank}/; +chr(0x110048) =~ /\p{XPosixBlank}/; +chr(0x110049) =~ /\P{XPosixBlank}/; +chr(0x110050) =~ /\w/; +chr(0x110051) =~ /\W/; +chr(0x110052) =~ /\d/; +chr(0x110053) =~ /\D/; +chr(0x110054) =~ /\s/; +chr(0x110055) =~ /\S/; +chr(0x110056) =~ /[[:word:]]/; +chr(0x110057) =~ /[[:^word:]]/; +chr(0x110058) =~ /[[:alnum:]]/; +chr(0x110059) =~ /[[:^alnum:]]/; +chr(0x11005A) =~ /[[:space:]]/; +chr(0x11005B) =~ /[[:^space:]]/; +chr(0x11005C) =~ /[[:digit:]]/; +chr(0x11005D) =~ /[[:^digit:]]/; +chr(0x11005E) =~ /[[:alpha:]]/; +chr(0x11005F) =~ /[[:^alpha:]]/; +chr(0x110060) =~ /[[:ascii:]]/; +chr(0x110061) =~ /[[:^ascii:]]/; +chr(0x110062) =~ /[[:cntrl:]]/; +chr(0x110063) =~ /[[:^cntrl:]]/; +chr(0x110064) =~ /[[:graph:]]/; +chr(0x110065) =~ /[[:^graph:]]/; +chr(0x110066) =~ /[[:lower:]]/; +chr(0x110067) =~ /[[:^lower:]]/; +chr(0x110068) =~ /[[:print:]]/; +chr(0x110069) =~ /[[:^print:]]/; +chr(0x11006A) =~ /[[:punct:]]/; +chr(0x11006B) =~ /[[:^punct:]]/; +chr(0x11006C) =~ /[[:upper:]]/; +chr(0x11006D) =~ /[[:^upper:]]/; +chr(0x11006E) =~ /[[:xdigit:]]/; +chr(0x11006F) =~ /[[:^xdigit:]]/; +chr(0x110070) =~ /[[:blank:]]/; +chr(0x110071) =~ /[[:^blank:]]/; EXPECT Code point 0x110000 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 14. +Code point 0x110010 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 15. +Code point 0x110011 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 16. +Code point 0x110011 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 16. +Code point 0x110012 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 17. +Code point 0x110013 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 18. +Code point 0x110013 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 18. +Code point 0x110014 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 19. +Code point 0x110015 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 20. +Code point 0x110015 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 20. +Code point 0x110016 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 21. +Code point 0x110017 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 22. +Code point 0x110017 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 22. +Code point 0x110018 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 23. +Code point 0x110019 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 24. +Code point 0x110019 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 24. +Code point 0x11001A is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 25. +Code point 0x11001B is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 26. +Code point 0x11001B is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 26. +Code point 0x11001C is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 27. +Code point 0x11001D is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 28. +Code point 0x11001D is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 28. +Code point 0x11001E is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 29. +Code point 0x11001F is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 30. +Code point 0x11001F is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 30. +Code point 0x110020 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 31. +Code point 0x110021 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 32. +Code point 0x110021 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 32. +Code point 0x110022 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 33. +Code point 0x110023 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 34. +Code point 0x110023 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 34. +Code point 0x110024 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 35. +Code point 0x110025 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 36. +Code point 0x110025 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 36. +Code point 0x110026 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 37. +Code point 0x110027 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 38. +Code point 0x110027 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 38. +Code point 0x110028 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 39. +Code point 0x110029 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 40. +Code point 0x110029 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 40. +Code point 0x11002A is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 41. +Code point 0x11002B is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 42. +Code point 0x11002B is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 42. +Code point 0x11002C is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 43. +Code point 0x11002D is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 44. +Code point 0x11002D is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 44. +Code point 0x11002E is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 45. +Code point 0x11002F is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 46. +Code point 0x11002F is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 46. +Code point 0x110030 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 47. +Code point 0x110031 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 48. +Code point 0x110031 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 48. +Code point 0x110032 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 49. +Code point 0x110033 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 50. +Code point 0x110033 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 50. +Code point 0x110034 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 51. +Code point 0x110035 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 52. +Code point 0x110035 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 52. +Code point 0x110036 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 53. +Code point 0x110037 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 54. +Code point 0x110037 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 54. +Code point 0x110038 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 55. +Code point 0x110039 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 56. +Code point 0x110039 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 56. +Code point 0x11003A is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 57. +Code point 0x11003B is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 58. +Code point 0x11003B is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 58. +Code point 0x11003C is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 59. +Code point 0x11003D is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 60. +Code point 0x11003D is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 60. +Code point 0x11003E is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 61. +Code point 0x11003F is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 62. +Code point 0x11003F is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 62. +Code point 0x110040 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 63. +Code point 0x110041 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 64. +Code point 0x110041 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 64. +Code point 0x110042 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 65. +Code point 0x110043 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 66. +Code point 0x110043 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 66. +Code point 0x110044 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 67. +Code point 0x110045 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 68. +Code point 0x110045 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 68. +Code point 0x110046 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 69. +Code point 0x110047 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 70. +Code point 0x110047 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 70. +Code point 0x110048 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 71. +Code point 0x110049 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 72. +Code point 0x110049 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 72. ######## use warnings 'utf8'; chr(0x110000) =~ /\p{Any}/; @@ -195,6 +650,14 @@ chr(0x110000) =~ /\p{Any}/; EXPECT Code point 0x110000 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 2. ######## +# TODO optimized regnode should still give warnings +use warnings 'utf8'; +chr(0x110000) =~ /lb=cr/; +no warnings 'non_unicode'; +chr(0x110000) =~ /lb=cr/; +EXPECT +Code point 0x110000 is not Unicode, all \p{} matches fail; all \P{} matches succeed at - line 2. +######## require "../test.pl"; use warnings 'utf8'; sub Is_Super { return '!utf8::Any' } |