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)
+t/run/switches.t Tests for the other switches (-0, -l, -c, -s, -M, -m, -V, -v)
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
+# Tests for the command-line switches -0, -c, -l, -s, -m, -M, -V, -v
# Some switches have their own tests, see MANIFEST.
BEGIN {
require "./test.pl";
-plan(tests => 20);
+plan(tests => 22);
# 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
+ # we don't test actual format too much since it could change
like( runperl( switches => ['-V'] ), qr/(\n.*){20}/,
'-V generates 20+ lines' );
+ like( runperl( switches => ['-V'] ),
+ qr/\ASummary of my perl5 .*configuration:/,
+ '-V looks okay' );
+
# lookup a known config var
chomp( $r=runperl( switches => ['-V:osname'] ) );
is( $r, "osname='$^O';", 'perl -V:osname');
# make sure each line we got matches the re
ok( !( grep !/^i\D+size=/, split /^/, $r ), '-V:re correct' );
}
+
+# Tests for -v
+
+{
+ 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'] ),
+ qr/This is perl, v$v built for $Config{archname}.+Copyright.+Larry Wall.+Artistic License.+GNU General Public License/s,
+ '-v looks okay' );
+
+}