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
#!./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 {
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
{
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'] ),
'-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' );
+
+}