From: Jarkko Hietaniemi Date: Sun, 31 Aug 2003 15:12:10 +0000 (+0000) Subject: Add tests for -h and (unknown) -z. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b8e3af44af1f06db397d2edf1cfbc2035e8624c1;p=p5sagit%2Fp5-mst-13.2.git Add tests for -h and (unknown) -z. p4raw-id: //depot/perl@20972 --- diff --git a/MANIFEST b/MANIFEST index a308683..c074617 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2843,7 +2843,7 @@ t/run/switcha.t Test the -a switch t/run/switch_A.t Test the -A switch t/run/switchC.t Test the -C switch t/run/switchd.t Test the -d switch -t/run/switches.t Tests for the other switches (-0, -l, -c, -s, -M, -m, -V, -v) +t/run/switches.t Tests for the other switches (-0, -l, -c, -s, -M, -m, -V, -v, -h, -z) t/run/switchF.t Test the -F switch t/run/switchI.t Test the -I switch t/run/switchn.t Test the -n switch diff --git a/t/run/switches.t b/t/run/switches.t index 35317ca..0aff31c 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' ); + +}