diff options
Diffstat (limited to 't/lib/warnings')
-rw-r--r-- | t/lib/warnings/op | 20 | ||||
-rw-r--r-- | t/lib/warnings/toke | 132 |
2 files changed, 149 insertions, 3 deletions
diff --git a/t/lib/warnings/op b/t/lib/warnings/op index f2270dc01a..de74d2e360 100644 --- a/t/lib/warnings/op +++ b/t/lib/warnings/op @@ -857,7 +857,7 @@ use open qw( :utf8 :std ); use warnings; eval "sub fòò (\$\0) {}"; EXPECT -Illegal character in prototype for main::fòò : $\x{0} at (eval 1) line 1. +Illegal character in prototype for main::fòò : $\0 at (eval 1) line 1. ######## # op.c use utf8; @@ -865,7 +865,7 @@ use open qw( :utf8 :std ); use warnings; eval "sub foo (\0) {}"; EXPECT -Illegal character in prototype for main::foo : \x{0} at (eval 1) line 1. +Illegal character in prototype for main::foo : \0 at (eval 1) line 1. ######## # op.c use utf8; @@ -882,7 +882,21 @@ use open qw( :utf8 :std ); use warnings; BEGIN { eval "sub foo (\0) {}"; } EXPECT -Illegal character in prototype for main::foo : \x{0} at (eval 1) line 1. +Illegal character in prototype for main::foo : \0 at (eval 1) line 1. +######## +# op.c +use warnings; +eval "sub foo (\xAB) {}"; +EXPECT +Illegal character in prototype for main::foo : \x{ab} at (eval 1) line 1. +######## +# op.c +use utf8; +use open qw( :utf8 :std ); +use warnings; +BEGIN { eval "sub foo (\x{30cb}) {}"; } +EXPECT +Illegal character in prototype for main::foo : \x{30cb} at (eval 1) line 1. ######## # op.c use utf8; diff --git a/t/lib/warnings/toke b/t/lib/warnings/toke index a6841d2d09..dd8dc3d517 100644 --- a/t/lib/warnings/toke +++ b/t/lib/warnings/toke @@ -616,6 +616,30 @@ EXPECT Bareword "FRED::" refers to nonexistent package at bar line 25. ######## # toke.c +use utf8; +use open qw( :utf8 :std ); +use warnings 'bareword' ; +#line 25 "bar" +$a = FRÈD:: ; +no warnings 'bareword' ; +#line 25 "bar" +$a = FRÈD:: ; +EXPECT +Bareword "FRÈD::" refers to nonexistent package at bar line 25. +######## +# toke.c +use utf8; +use open qw( :utf8 :std ); +use warnings 'bareword' ; +#line 25 "bar" +$a = ϞϞϞ:: ; +no warnings 'bareword' ; +#line 25 "bar" +$a = ϞϞϞ:: ; +EXPECT +Bareword "ϞϞϞ::" refers to nonexistent package at bar line 25. +######## +# toke.c use warnings 'ambiguous' ; sub time {} my $a = time() ; @@ -692,11 +716,77 @@ Ambiguous use of -fred resolved as -&fred() at - line 9. Ambiguous use of -fred resolved as -&fred() at - line 11. ######## # toke.c +use utf8; +use open qw( :utf8 :std ); +sub frèd {}; +-frèd ; +EXPECT +Ambiguous use of -frèd resolved as -&frèd() at - line 5. +######## +# toke.c +$^W = 0 ; +use utf8; +use open qw( :utf8 :std ); +sub frèd {} ; +-frèd ; +{ + no warnings 'ambiguous' ; + -frèd ; + use warnings 'ambiguous' ; + -frèd ; +} +-frèd ; +EXPECT +Ambiguous use of -frèd resolved as -&frèd() at - line 6. +Ambiguous use of -frèd resolved as -&frèd() at - line 11. +Ambiguous use of -frèd resolved as -&frèd() at - line 13. +######## +# toke.c +use utf8; +use open qw( :utf8 :std ); +sub ᒍᒘᒊ {}; +-ᒍᒘᒊ ; +EXPECT +Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 5. +######## +# toke.c +$^W = 0 ; +use utf8; +use open qw( :utf8 :std ); +sub ᒍᒘᒊ {} ; +-ᒍᒘᒊ ; +{ + no warnings 'ambiguous' ; + -ᒍᒘᒊ ; + use warnings 'ambiguous' ; + -ᒍᒘᒊ ; +} +-ᒍᒘᒊ ; +EXPECT +Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 6. +Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 11. +Ambiguous use of -ᒍᒘᒊ resolved as -&ᒍᒘᒊ() at - line 13. +######## +# toke.c open FOO || time; open local *FOO; # should be ok EXPECT Precedence problem: open FOO should be open(FOO) at - line 2. ######## +# toke.c +use utf8; +use open qw( :utf8 :std ); +open FÒÒ || time; +EXPECT +Precedence problem: open FÒÒ should be open(FÒÒ) at - line 4. +######## +# toke.c +use utf8; +use open qw( :utf8 :std ); +open ᒍOO || time; +EXPECT +Precedence problem: open ᒍOO should be open(ᒍOO) at - line 4. +######## # toke.c (and [perl #16184]) open FOO => "<&0"; close FOO; EXPECT @@ -719,6 +809,40 @@ Precedence problem: open FOO should be open(FOO) at - line 10. ######## # toke.c $^W = 0 ; +use utf8; +use open qw( :utf8 :std ); +open FÒÒ || time; +{ + no warnings 'precedence' ; + open FÒÒ || time; + use warnings 'precedence' ; + open FÒÒ || time; +} +open FÒÒ || time; +EXPECT +Precedence problem: open FÒÒ should be open(FÒÒ) at - line 5. +Precedence problem: open FÒÒ should be open(FÒÒ) at - line 10. +Precedence problem: open FÒÒ should be open(FÒÒ) at - line 12. +######## +# toke.c +use utf8; +use open qw( :utf8 :std ); +$^W = 0 ; +open ᒍÒÒ || time; +{ + no warnings 'precedence' ; + open ᒍÒÒ || time; + use warnings 'precedence' ; + open ᒍÒÒ || time; +} +open ᒍÒÒ || time; +EXPECT +Precedence problem: open ᒍÒÒ should be open(ᒍÒÒ) at - line 5. +Precedence problem: open ᒍÒÒ should be open(ᒍÒÒ) at - line 10. +Precedence problem: open ᒍÒÒ should be open(ᒍÒÒ) at - line 12. +######## +# toke.c +$^W = 0 ; *foo *foo ; { no warnings 'ambiguous' ; @@ -1118,3 +1242,11 @@ no warnings 'ambiguous' ; $a = ${f렏} ; EXPECT Ambiguous use of ${f렏} resolved to $f렏 at - line 6. +######## +# toke.c +use utf8; +use open qw( :utf8 :std ); +use warnings; +CORE::렏; +EXPECT +CORE::렏 is not a keyword at - line 5. |