1N/A#!./perl
1N/A
1N/ABEGIN {
1N/A chdir 't' if -d 't';
1N/A @INC = '../lib';
1N/A}
1N/A
1N/Ause Test::More tests => 6;
1N/A
1N/Amy $v_plus = $] + 1;
1N/Amy $v_minus = $] - 1;
1N/A
1N/A
1N/Aok( eval "use if ($v_minus > \$]), strict => 'subs'; \${'f'} = 12" eq 12,
1N/A '"use if" with a false condition, fake pragma');
1N/A
1N/Aok( eval "use if ($v_minus > \$]), strict => 'refs'; \${'f'} = 12" eq 12,
1N/A '"use if" with a false condition and a pragma');
1N/A
1N/Aok( eval "use if ($v_plus > \$]), strict => 'subs'; \${'f'} = 12" eq 12,
1N/A '"use if" with a true condition, fake pragma');
1N/A
1N/Aok( (not defined eval "use if ($v_plus > \$]), strict => 'refs'; \${'f'} = 12"
1N/A and $@ =~ /while "strict refs" in use/),
1N/A '"use if" with a true condition and a pragma');
1N/A
1N/Aok( eval "use if 1, Cwd; cwd() || 1;",
1N/A '"use if" with a true condition, module, no arguments, exports');
1N/A
1N/Aok( eval "use if qw/ 1 if 1 strict subs /; \${'f'} = 12" eq 12,
1N/A '"use if" with a module named after keyword');