| 1 |
use Test2::V0; |
| 2 |
use IPC::Cmd qw/can_run/; |
| 3 |
|
| 4 |
use File::Spec; |
| 5 |
|
| 6 |
use App::Yath::Tester qw/yath/; |
| 7 |
|
| 8 |
use App::Yath::Util qw/find_yath/; |
| 9 |
find_yath(); # cache result before we chdir |
| 10 |
|
| 11 |
my $dir = __FILE__; |
| 12 |
$dir =~ s{\.t$}{}g; |
| 13 |
$dir =~ s{^\./}{}; |
| 14 |
|
| 15 |
chdir($dir); |
| 16 |
$ENV{OLD_PERL5LIB} = $ENV{PERL5LIB}; |
| 17 |
|
| 18 |
yath( |
| 19 |
command => 'test', |
| 20 |
args => ['default.tx'], |
| 21 |
exit => 0, |
| 22 |
); |
| 23 |
|
| 24 |
yath( |
| 25 |
command => 'test', |
| 26 |
args => ['-Ixyz', 'default-i.tx'], |
| 27 |
exit => 0, |
| 28 |
); |
| 29 |
|
| 30 |
yath( |
| 31 |
command => 'test', |
| 32 |
args => ['-Ia', '-b', '-Ib', '-l', '-Ic', 'order-ibili.tx'], |
| 33 |
exit => 0, |
| 34 |
); |
| 35 |
|
| 36 |
yath( |
| 37 |
command => 'test', |
| 38 |
args => ['-Ia', '-l', '-Ib', '-b', '-Ic', 'order-ilibi.tx'], |
| 39 |
exit => 0, |
| 40 |
); |
| 41 |
|
| 42 |
yath( |
| 43 |
command => 'test', |
| 44 |
args => ['-Ixyz', '--unsafe-inc', 'dot-last.tx'], |
| 45 |
exit => 0, |
| 46 |
); |
| 47 |
|
| 48 |
$ENV{YATH_PERL} = $^X; |
| 49 |
yath( |
| 50 |
command => 'test', |
| 51 |
args => ['-Ixyz', './not-perl.sh'], |
| 52 |
exit => 0, |
| 53 |
) if can_run('bash'); |
| 54 |
|
| 55 |
done_testing; |