diff options
Diffstat (limited to 'libtests/qtest/arg_parser.test')
-rw-r--r-- | libtests/qtest/arg_parser.test | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/libtests/qtest/arg_parser.test b/libtests/qtest/arg_parser.test index 1d24d507..5079289a 100644 --- a/libtests/qtest/arg_parser.test +++ b/libtests/qtest/arg_parser.test @@ -101,4 +101,30 @@ $td->runtest("args from stdin", {$td->FILE => "stdin.out", $td->EXIT_STATUS => 0}, $td->NORMALIZE_NEWLINES); -$td->report(2 + (2 * scalar(@completion_tests)) + scalar(@arg_tests)); +my @help_tests = ( + '', + '=all', + '=--ewe', + '=quack', + ); +foreach my $i (@help_tests) +{ + my $out = $i; + $out =~ s/[=-]//g; + if ($out ne '') + { + $out = "-$out"; + } + $td->runtest("--help$i", + {$td->COMMAND => "arg_parser --help$i"}, + {$td->FILE => "help$out.out", $td->EXIT_STATUS => 0}, + $td->NORMALIZE_NEWLINES); +} + +$td->runtest("bad help option", + {$td->COMMAND => 'arg_parser --help=--oops'}, + {$td->FILE => "help-bad.out", $td->EXIT_STATUS => 2}, + $td->NORMALIZE_NEWLINES); + +$td->report(3 + (2 * scalar(@completion_tests)) + + scalar(@arg_tests) + scalar(@help_tests)); |