summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorRobin Barker <RMBarker@cpan.org>2008-02-27 19:19:54 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2008-03-02 07:24:18 +0000
commit0544e6df68c5534300178fdd73628d687be1a6b2 (patch)
tree2ea7f62b7bfdd42e9073002710024ca1a9bf9270 /t
parent2b021c53857fc8f84c88814fb57222878208d85f (diff)
downloadperl-0544e6df68c5534300178fdd73628d687be1a6b2.tar.gz
for -M:Foo, extended and revised
From: "Robin Barker" <Robin.Barker@npl.co.uk> Message-ID: <46A0F33545E63740BC7563DE59CA9C6D093A61@exchsvr2.npl.ad.local> p4raw-id: //depot/perl@33407
Diffstat (limited to 't')
-rw-r--r--t/run/switches.t30
1 files changed, 29 insertions, 1 deletions
diff --git a/t/run/switches.t b/t/run/switches.t
index 4af3141fd7..b3fd9347e6 100644
--- a/t/run/switches.t
+++ b/t/run/switches.t
@@ -11,7 +11,7 @@ BEGIN {
BEGIN { require "./test.pl"; }
-plan(tests => 62);
+plan(tests => 68);
use Config;
@@ -194,6 +194,34 @@ SWTESTPM
);
is( $r, '<swtest><foo><bar>', '-m with import parameters' );
push @tmpfiles, $filename;
+
+ is( runperl( switches => [ '-MTie::Hash' ], stderr => 1, prog => 1 ),
+ '', "-MFoo::Bar allowed" );
+
+ like( runperl( switches => [ '-M:swtest' ], stderr => 1,
+ prog => 'die "oops"' ),
+ qr/Invalid module name [\w:]+ with -M option\b/,
+ "-M:Foo not allowed" );
+
+ like( runperl( switches => [ '-mA:B:C' ], stderr => 1,
+ prog => 'die "oops"' ),
+ qr/Invalid module name [\w:]+ with -m option\b/,
+ "-mFoo:Bar not allowed" );
+
+ like( runperl( switches => [ '-m-A:B:C' ], stderr => 1,
+ prog => 'die "oops"' ),
+ qr/Invalid module name [\w:]+ with -m option\b/,
+ "-m-Foo:Bar not allowed" );
+
+ like( runperl( switches => [ '-m-' ], stderr => 1,
+ prog => 'die "oops"' ),
+ qr/Module name required with -m option\b/,
+ "-m- not allowed" );
+
+ like( runperl( switches => [ '-M-=' ], stderr => 1,
+ prog => 'die "oops"' ),
+ qr/Module name required with -M option\b/,
+ "-M- not allowed" );
}
# Tests for -V