Skip to content

Commit

Permalink
fix 'perl -le"exit 2"' typoed as 'perl "exit 2"' but were both result…
Browse files Browse the repository at this point in the history
…ing in exit status 2
  • Loading branch information
karenetheridge committed Aug 15, 2016
1 parent 4f7f5d5 commit e4c35e9
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
18 changes: 9 additions & 9 deletions t/80-fatal-errors.t
Expand Up @@ -15,7 +15,7 @@ use Test::Fatal;
path(qw(source dist.ini)) => simple_ini(
[ GatherDir => ],
[ MetaConfig => ],
[ 'Run::BeforeBuild' => { run => [ qq{"$^X" -le"exit 2"} ] } ],
[ 'Run::BeforeBuild' => { run => [ qq{"$^X" -le"exit 42"} ] } ],
),
path(qw(source lib Foo.pm)) => "package Foo;\n1;\n",
},
Expand All @@ -25,15 +25,15 @@ use Test::Fatal;
$tzil->chrome->logger->set_debug(1);
like(
exception { $tzil->build },
qr/command exited with status 2 \(512\)/,
qr/command exited with status 42 \(10752\)/,
'build failed, reporting the error from the run command',
);

cmp_deeply(
$tzil->log_messages,
superbagof(
qq{[Run::BeforeBuild] executing: "$^X" -le"exit 2"},
'[Run::BeforeBuild] command exited with status 2 (512)',
qq{[Run::BeforeBuild] executing: "$^X" -le"exit 42"},
'[Run::BeforeBuild] command exited with status 42 (10752)',
),
'log messages list what happened',
);
Expand All @@ -47,7 +47,7 @@ use Test::Fatal;
class => 'Dist::Zilla::Plugin::Run::BeforeBuild',
config => {
'Dist::Zilla::Plugin::Run::Role::Runner' => {
run => [ qq{"$^X" -le"exit 2"} ],
run => [ qq{"$^X" -le"exit 42"} ],
fatal_errors => 1,
quiet => 0,
version => Dist::Zilla::Plugin::Run::Role::Runner->VERSION,
Expand Down Expand Up @@ -134,7 +134,7 @@ use Test::Fatal;
path(qw(source dist.ini)) => simple_ini(
[ GatherDir => ],
[ MetaConfig => ],
[ 'Run::BeforeBuild' => { run => [ qq{"$^X" "exit 2"} ], fatal_errors => 0, } ],
[ 'Run::BeforeBuild' => { run => [ qq{"$^X" -le"exit 42"} ], fatal_errors => 0, } ],
),
path(qw(source lib Foo.pm)) => "package Foo;\n1;\n",
},
Expand All @@ -151,8 +151,8 @@ use Test::Fatal;
cmp_deeply(
$tzil->log_messages,
superbagof(
qq{[Run::BeforeBuild] executing: "$^X" "exit 2"},
'[Run::BeforeBuild] command exited with status 2 (512)',
qq{[Run::BeforeBuild] executing: "$^X" -le"exit 42"},
'[Run::BeforeBuild] command exited with status 42 (10752)',
),
'log messages list what happened',
);
Expand All @@ -166,7 +166,7 @@ use Test::Fatal;
class => 'Dist::Zilla::Plugin::Run::BeforeBuild',
config => {
'Dist::Zilla::Plugin::Run::Role::Runner' => {
run => [ qq{"$^X" "exit 2"} ],
run => [ qq{"$^X" -le"exit 42"} ],
fatal_errors => 0,
quiet => 0,
version => Dist::Zilla::Plugin::Run::Role::Runner->VERSION,
Expand Down
14 changes: 7 additions & 7 deletions t/92-quiet.t
Expand Up @@ -13,7 +13,7 @@ my @configs = (
eval => [ qq{die "oh noes"} ],
},
{
run => [ qq{"$^X" -le"exit 2"} ],
run => [ qq{"$^X" -le"exit 42"} ],
eval => [ qq{print "# hello this is an eval command\\xa"} ],
}
);
Expand Down Expand Up @@ -78,7 +78,7 @@ foreach my $quiet (0, 1)
superbagof(
@run_messages,
re(qr/^\[plugin 0\] evaluation died: oh noes/),
'[plugin 1] command exited with status 2 (512)',
'[plugin 1] command exited with status 42 (10752)',
),
"saw expected log messages when quiet=$quiet, verbose=$verbose",
);
Expand Down Expand Up @@ -123,7 +123,7 @@ foreach my $quiet (0, 1)
path(qw(source dist.ini)) => simple_ini(
[ GatherDir => ],
[ MetaConfig => ],
[ 'Run::BeforeBuild' => { quiet => 1, run => [ qq{"$^X" -le"print q/hi/; exit 2"} ] } ],
[ 'Run::BeforeBuild' => { quiet => 1, run => [ qq{"$^X" -le"print q/hi/; exit 42"} ] } ],
),
path(qw(source lib Foo.pm)) => "package Foo;\n1;\n",
},
Expand All @@ -133,16 +133,16 @@ foreach my $quiet (0, 1)
$tzil->chrome->logger->set_debug(0); # explicitly *not* --verbose mode!
like(
exception { $tzil->build },
qr/command exited with status 2 \(512\)/,
qr/command exited with status 42 \(10752\)/,
'build failed, reporting the error from the run command',
);

cmp_deeply(
$tzil->log_messages,
superbagof(
qq{[Run::BeforeBuild] executed: "$^X" -le"print q/hi/; exit 2"},
qq{[Run::BeforeBuild] executed: "$^X" -le"print q/hi/; exit 42"},
'[Run::BeforeBuild] hi',
'[Run::BeforeBuild] command exited with status 2 (512)',
'[Run::BeforeBuild] command exited with status 42 (10752)',
),
'log messages list what happened, after the fact',
);
Expand All @@ -156,7 +156,7 @@ foreach my $quiet (0, 1)
class => 'Dist::Zilla::Plugin::Run::BeforeBuild',
config => {
'Dist::Zilla::Plugin::Run::Role::Runner' => {
run => [ qq{"$^X" -le"print q/hi/; exit 2"} ],
run => [ qq{"$^X" -le"print q/hi/; exit 42"} ],
fatal_errors => 1,
quiet => 1,
version => Dist::Zilla::Plugin::Run::Role::Runner->VERSION,
Expand Down

0 comments on commit e4c35e9

Please sign in to comment.