diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-31 15:03:42 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-08-31 15:03:42 +0000 |
commit | ceda46a1c0a98bad243238d3009e5242fa9ed075 (patch) | |
tree | 1fe3cb24a4e50cb190084e4f4a25bfc026403eb8 /t | |
parent | 48eaf8044c031196cf6457fdc7b9a3f381837bc0 (diff) | |
download | perl-ceda46a1c0a98bad243238d3009e5242fa9ed075.tar.gz |
Add test for -v.
p4raw-id: //depot/perl@20971
Diffstat (limited to 't')
-rw-r--r-- | t/run/switches.t | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/t/run/switches.t b/t/run/switches.t index 8d9cd89c66..35317cad9c 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 +# 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 @@ 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 @@ -183,10 +183,14 @@ 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 + # 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'); @@ -206,3 +210,18 @@ SWTESTPM # 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' ); + +} |