diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-31 15:12:10 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-31 15:12:10 +0000 |
commit | b8e3af44af1f06db397d2edf1cfbc2035e8624c1 (patch) | |
tree | fa4ec0483fe8587aac0caec58ec3009c8ca015ec /t/run | |
parent | ceda46a1c0a98bad243238d3009e5242fa9ed075 (diff) | |
download | perl-b8e3af44af1f06db397d2edf1cfbc2035e8624c1.tar.gz |
Add tests for -h and (unknown) -z.
p4raw-id: //depot/perl@20972
Diffstat (limited to 't/run')
-rw-r--r-- | t/run/switches.t | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/t/run/switches.t b/t/run/switches.t index 35317cad9c..0aff31cfbc 100644 --- a/t/run/switches.t +++ b/t/run/switches.t @@ -1,6 +1,6 @@ #!./perl -w -# Tests for the command-line switches -0, -c, -l, -s, -m, -M, -V, -v +# Tests for the command-line switches -0, -c, -l, -s, -m, -M, -V, -v, -h, -z # Some switches have their own tests, see MANIFEST. BEGIN { @@ -10,7 +10,7 @@ BEGIN { require "./test.pl"; -plan(tests => 22); +plan(tests => 24); # due to a bug in VMS's piping which makes it impossible for runperl() # to emulate echo -n (ie. stdin always winds up with a newline), these @@ -216,8 +216,6 @@ SWTESTPM { local $TODO = ''; # these ones should work on VMS - # basic perl -V should generate significant output. - # we don't test actual format since it could change my $v = sprintf "%vd", $^V; use Config; like( runperl( switches => ['-v'] ), @@ -225,3 +223,25 @@ SWTESTPM '-v looks okay' ); } + +# Tests for -h + +{ + local $TODO = ''; # these ones should work on VMS + + like( runperl( switches => ['-h'] ), + qr/Usage: .+perl.+switches.+programfile.+arguments/, + '-h looks okay' ); + +} + +# Tests for -z (which does not exist) + +{ + local $TODO = ''; # these ones should work on VMS + + like( runperl( switches => ['-z'], stderr => 1 ), + qr/\QUnrecognized switch: -z (-h will show valid options)./, + '-z correctly unknown' ); + +} |