summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Rinaldo <toddr@cpan.org>2017-11-10 11:13:09 -0600
committerTodd Rinaldo <toddr@cpan.org>2017-11-10 15:25:07 -0600
commit7b1af8a66568cbb1b215ecb17fa5f19059208f55 (patch)
tree02a855bee71264a4d67460981998f93d610256d5 /lib
parent4f8ef02eaa8580534cef12a44dbfc822b26786be (diff)
downloadperl-7b1af8a66568cbb1b215ecb17fa5f19059208f55.tar.gz
Add support for --help and --version in perlbug
RT 130032: Thanks to Houston Perl Mongers for contributing to this work at our monthly meeting! NPD
Diffstat (limited to 'lib')
-rw-r--r--lib/perlbug.t12
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/perlbug.t b/lib/perlbug.t
index ed32c044f3..d4f1116972 100644
--- a/lib/perlbug.t
+++ b/lib/perlbug.t
@@ -42,7 +42,7 @@ sub _dump {
return 1;
}
-plan(22);
+plan(25);
# check -d
@@ -153,3 +153,13 @@ for (split(/\n/, $contents)) {
}
ok($maxlen1 < 1000, "[perl #128020] long body lines are wrapped: maxlen $maxlen1");
ok($maxlen2 > 1000, "long attachment lines are not wrapped: maxlen $maxlen2");
+
+$result = runperl( progfile => $extracted_program, stderr => 1, args => ['-o'] ); # Invalid option
+like($result, qr/^\s*This program is designed/, "No leading error messages with help from invalid arg.");
+
+$result = runperl( progfile => $extracted_program, stderr => 1, args => ['--help'] ); # Invalid option
+like($result, qr/^\s*perlbug version \d+\.\d+\n\nThis program is designed/, "No leading error messages with help from --help and version is displayed.");
+
+$result = runperl( progfile => $extracted_program, stderr => 1, args => ['--version'] ); # Invalid option
+like($result, qr/^perlbug version \d+\.\d+\n$/, "No leading error messages with --version");
+#print $result;