| 1 |
use strict; |
| 2 |
use warnings; |
| 3 |
use FindBin; |
| 4 |
use lib "$FindBin::Bin/../../"; |
| 5 |
use Test::More; |
| 6 |
use t::Util; |
| 7 |
|
| 8 |
local $t::Util::EVAL = 1; |
| 9 |
|
| 10 |
test('if cond => namespace', <<'END', {if => 0}, {}, {Exporter => 0}); |
| 11 |
use if $] => Exporter; |
| 12 |
END |
| 13 |
|
| 14 |
test('if cond => string', <<'END', {if => 0}, {}, {Exporter => 0}); |
| 15 |
use if $] => "Exporter"; |
| 16 |
END |
| 17 |
|
| 18 |
test('if cond => namespace', <<'END', {if => 0}, {}, {'Test::More' => 0}); |
| 19 |
use if $] => Test::More; |
| 20 |
END |
| 21 |
|
| 22 |
test('if cond => string', <<'END', {if => 0}, {}, {'Test::More' => 0}); |
| 23 |
use if $] => "Test::More"; |
| 24 |
END |
| 25 |
|
| 26 |
test('cond may have commas', <<'END', {if => 0}, {}, {'Test::More' => 0}); |
| 27 |
use if [1, 2 => 3] => "Test::More"; |
| 28 |
END |
| 29 |
|
| 30 |
test('cond may have commas', <<'END', {if => 0}, {}, {'Test::More' => 0}); |
| 31 |
use if [1, 2 => qw/foo/] => "Test::More"; |
| 32 |
END |
| 33 |
|
| 34 |
local $t::Util::EVAL = 0; |
| 35 |
|
| 36 |
test('with open pragma', <<'END', {if => 0}, {}, {open => 0}); # AUDREYT/OurNet-BBS-1.67/lib/OurNet/BBS/ScalarFile.pm |
| 37 |
use if ($^O eq 'MSWin32'), open => (IN => ':bytes', OUT => ':bytes'); |
| 38 |
END |
| 39 |
|
| 40 |
test('with open pragma', <<'END', {if => 0}, {}, {open => 0}); # AUDREYT/OurNet-BBS-1.67/lib/OurNet/BBS/ScalarFile.pm |
| 41 |
use if $OurNet::BBS::Encoding, open => ":encoding($OurNet::BBS::Encoding)"; |
| 42 |
END |
| 43 |
|
| 44 |
done_testing; |