diff options
author | Nicholas Clark <nick@ccl4.org> | 2007-08-25 22:04:06 +0000 |
---|---|---|
committer | Nicholas Clark <nick@ccl4.org> | 2007-08-25 22:04:06 +0000 |
commit | fed0ca7f5100fe80067cf8ec5732417aa7f8f903 (patch) | |
tree | 21bfbd98987621ef3e8d0afed4147ab65ec1828f /t | |
parent | 4fc4d78070e97573058938fbb191d008beef4f48 (diff) | |
download | perl-fed0ca7f5100fe80067cf8ec5732417aa7f8f903.tar.gz |
Test that all the unknown command line flags are unknown.
p4raw-id: //depot/perl@31754
Diffstat (limited to 't')
-rw-r--r-- | t/run/switches.t | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/t/run/switches.t b/t/run/switches.t index 7a778a470c..7312e1e64f 100644 --- a/t/run/switches.t +++ b/t/run/switches.t @@ -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 { BEGIN { require "./test.pl"; } -plan(tests => 31); +plan(tests => 62); use Config; @@ -253,14 +253,16 @@ SWTESTPM } -# 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" ); } |