Change 20971 by [EMAIL PROTECTED] on 2003/08/31 15:03:42
Add test for -v.
Affected files ...
... //depot/perl/MANIFEST#1083 edit
... //depot/perl/t/run/switches.t#10 edit
Differences ...
==== //depot/perl/MANIFEST#1083 (text) ====
Index: perl/MANIFEST
--- perl/MANIFEST#1082~20965~ Sun Aug 31 01:55:59 2003
+++ perl/MANIFEST Sun Aug 31 08:03:42 2003
@@ -2843,7 +2843,7 @@
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
==== //depot/perl/t/run/switches.t#10 (text) ====
Index: perl/t/run/switches.t
--- perl/t/run/switches.t#9~20970~ Sun Aug 31 07:55:54 2003
+++ perl/t/run/switches.t Sun Aug 31 08:03:42 2003
@@ -1,6 +1,6 @@
#!./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 {
@@ -10,7 +10,7 @@
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
@@ -183,10 +183,14 @@
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');
@@ -205,4 +209,19 @@
# 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' );
+
}
End of Patch.