Test cases.

This commit is contained in:
Daniel Nichter
2012-10-22 12:16:42 -06:00
parent 289366ebdf
commit af1240b6f6
2 changed files with 36 additions and 1 deletions

View File

@@ -2057,6 +2057,28 @@ is(
"..and has the specified value",
);
# #############################################################################
# Bug 1039074: Tools exit 0 on error parsing options, should exit non-zero
# #############################################################################
# pt-archiver requires at least one of --dest, --file or --purge, as well as
# --where and --source. So specifying no options should cause errors.
@ARGV = qw();
$o = new OptionParser(file => "$trunk/bin/pt-archiver");
$o->get_specs();
$o->get_opts();
my $exit_status = 0;
($output, $exit_status) = full_output(
sub { $o->usage_or_errors("$trunk/bin/pt-archiver"); },
);
is(
$exit_status,
1,
"Non-zero exit status on error parsing options (bug 1039074)"
);
# #############################################################################
# Done.
# #############################################################################