Change 31754 by [EMAIL PROTECTED] on 2007/08/25 22:04:06

        Test that all the unknown command line flags are unknown.

Affected files ...

... //depot/perl/t/run/switches.t#21 edit

Differences ...

==== //depot/perl/t/run/switches.t#21 (text) ====
Index: perl/t/run/switches.t
--- perl/t/run/switches.t#20~29056~     2006-10-19 13:47:53.000000000 -0700
+++ perl/t/run/switches.t       2007-08-25 15:04:06.000000000 -0700
@@ -1,7 +1,7 @@
 #!./perl -w
 
 # Tests for the command-line switches:
-# -0, -c, -l, -s, -m, -M, -V, -v, -h, -z, -i, -E
+# -0, -c, -l, -s, -m, -M, -V, -v, -h, -i, -E and all unknown
 # Some switches have their own tests, see MANIFEST.
 
 BEGIN {
@@ -11,7 +11,7 @@
 
 BEGIN { require "./test.pl"; }
 
-plan(tests => 31);
+plan(tests => 62);
 
 use Config;
 
@@ -253,14 +253,16 @@
 
 }
 
-# Tests for -z (which does not exist)
+# Tests for switches which do not exist
 
+foreach my $switch (split //, "ABbGgHJjKkLNOoQqRrYyZz123456789_")
 {
     local $TODO = '';   # these ones should work on VMS
 
-    like( runperl( switches => ['-z'], stderr => 1 ),
-         qr/\QUnrecognized switch: -z  (-h will show valid options)./,
-          '-z correctly unknown' );
+    like( runperl( switches => ["-$switch"], stderr => 1,
+                  prog => 'die "oops"' ),
+         qr/\QUnrecognized switch: -$switch  (-h will show valid options)./,
+          "-$switch correctly unknown" );
 
 }
 
End of Patch.

Reply via email to