Commit | Line | Data |
---|---|---|
518618af FC |
1 | #!perl |
2 | BEGIN { | |
a817e89d | 3 | chdir 't' if -d 't'; |
518618af FC |
4 | require './test.pl'; |
5 | } | |
6 | ||
7 | plan 5; | |
8 | ||
9 | sub notdef { undef } | |
10 | ||
11 | # [perl #97466] | |
12 | # These should actually call the sub, instead of testing the sub itself | |
13 | ok !defined do { ¬def }, 'defined do { &sub }'; | |
14 | ok !defined(scalar(42,¬def)), 'defined(scalar(42,&sub))'; | |
15 | ok !defined do{();¬def}, '!defined do{();&sub}'; | |
16 | ||
17 | # Likewise, these should evaluate @array in scalar context | |
18 | no warnings "deprecated"; | |
19 | ok defined($false ? $scalar : @array), 'defined( ... ? ... : @array)'; | |
20 | ok defined(scalar @array), 'defined(scalar @array)'; |