queued errors may not be displayed after the PL_error_count limit
[p5sagit/p5-mst-13.2.git] / t / pragma / strict-subs
index 6864a3a..ed4fe7a 100644 (file)
@@ -33,6 +33,24 @@ Execution of - aborted due to compilation errors.
 ########
 
 # strict subs - error
+use strict 'subs' ;
+my @a = (A..Z);
+EXPECT
+Bareword "Z" not allowed while "strict subs" in use at - line 4.
+Bareword "A" not allowed while "strict subs" in use at - line 4.
+Execution of - aborted due to compilation errors.
+########
+
+# strict subs - error
+use strict 'subs' ;
+my $a = (B..Y);
+EXPECT
+Bareword "Y" not allowed while "strict subs" in use at - line 4.
+Bareword "B" not allowed while "strict subs" in use at - line 4.
+Execution of - aborted due to compilation errors.
+########
+
+# strict subs - error
 use strict ;
 Fred ;
 EXPECT
@@ -81,7 +99,7 @@ use strict 'vars' ;
 $joe = 1 ;
 EXPECT
 Variable "$joe" is not imported at - line 8.
-Global symbol "joe" requires explicit package name at - line 8.
+Global symbol "$joe" requires explicit package name at - line 8.
 Execution of - aborted due to compilation errors.
 ########
 
@@ -93,7 +111,7 @@ no strict;
 }
 $joe = 1 ;
 EXPECT
-Global symbol "joe" requires explicit package name at - line 6.
+Global symbol "$joe" requires explicit package name at - line 6.
 Execution of - aborted due to compilation errors.
 ########
 
@@ -172,7 +190,7 @@ Fred ;
 require "./abc";
 EXPECT
 Bareword "Fred" not allowed while "strict subs" in use at ./abc line 2.
- at - line 2.
+Compilation failed in require at - line 2.
 ########
 
 --FILE-- abc.pm
@@ -184,7 +202,7 @@ Fred ;
 use abc;
 EXPECT
 Bareword "Fred" not allowed while "strict subs" in use at abc.pm line 2.
- at - line 2.
+Compilation failed in require at - line 2.
 BEGIN failed--compilation aborted at - line 2.
 ########
 
@@ -277,3 +295,25 @@ my $a = Fred ;
 EXPECT
 Bareword "Fred" not allowed while "strict subs" in use at - line 8.
 Execution of - aborted due to compilation errors.
+########
+
+# see if Foo->Bar(...) etc work under strictures
+use strict;
+package Foo; sub Bar { print "@_\n" }
+Foo->Bar('a',1);
+Bar Foo ('b',2);
+Foo->Bar(qw/c 3/);
+Bar Foo (qw/d 4/);
+Foo::->Bar('A',1);
+Bar Foo:: ('B',2);
+Foo::->Bar(qw/C 3/);
+Bar Foo:: (qw/D 4/);
+EXPECT
+Foo a 1
+Foo b 2
+Foo c 3
+Foo d 4
+Foo A 1
+Foo B 2
+Foo C 3
+Foo D 4