Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the App-Cmd CPAN distribution.

Report information
The Basics
Id: 73084
Status: resolved
Priority: 0/
Queue: App-Cmd

People
Owner: Nobody in particular
Requestors: dagolden [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.312
Fixed in: (no value)



Subject: App::Cmd::Tester does not report error when a command is missing
my $result = test_app( 'MyApp' => [qw(bogus)] ); is( $result->error, undef, "Ran without error" ); is( $result->exit_code, 0, "Ran without error" ); When there is no MyApp::Command::bogus, the tests still pass. Running 'perl -Ilib bin/myapp bogus' results in exit code 1. Conceptually, it seems like a missing command should be considered an error by the result object (even if it's not a thrown exception). And regardless, the exit_code should match what the command line program would do. Possibly you should have $result contain an "exception" field for any thrown exceptions and "error" then becomes "exception" // "exit_code". -- David
Ironically, I just hit this again and thought I should file a bug report... and lo, I already did. (Bump?)
exit code is now reported as 1 I agree that this should be done with exceptions. There are a few similar things to be done, but they're not going to happen right now, and this should solve the immediate problem. Thanks for the bump. ;) -- rjbs