Revision 18450,
700 bytes
checked in by zacheiss, 21 years ago
(diff) |
This commit was generated by cvs2svn to compensate for changes in r18449,
which included commits to RCS files with non-trunk default branches.
|
-
Property svn:executable set to
*
|
Line | |
---|
1 | #!./perl |
---|
2 | |
---|
3 | BEGIN { |
---|
4 | chdir 't' if -d 't'; |
---|
5 | @INC = '../lib'; |
---|
6 | } |
---|
7 | |
---|
8 | use Test::More tests => 4; |
---|
9 | |
---|
10 | my $v_plus = $] + 1; |
---|
11 | my $v_minus = $] - 1; |
---|
12 | |
---|
13 | |
---|
14 | ok( eval "use if ($v_minus > \$]), strict => 'subs'; \${'f'} = 12" eq 12, |
---|
15 | '"use if" with a false condition, fake pragma'); |
---|
16 | |
---|
17 | ok( eval "use if ($v_minus > \$]), strict => 'refs'; \${'f'} = 12" eq 12, |
---|
18 | '"use if" with a false condition and a pragma'); |
---|
19 | |
---|
20 | ok( eval "use if ($v_plus > \$]), strict => 'subs'; \${'f'} = 12" eq 12, |
---|
21 | '"use if" with a true condition, fake pragma'); |
---|
22 | |
---|
23 | ok( (not defined eval "use if ($v_plus > \$]), strict => 'refs'; \${'f'} = 12" |
---|
24 | and $@ =~ /while "strict refs" in use/), |
---|
25 | '"use if" with a true condition and a pragma'); |
---|
26 | |
---|
Note: See
TracBrowser
for help on using the repository browser.