From: Nicholas Clark Date: Sun, 26 Jul 2009 10:30:32 +0000 (+0100) Subject: Add tests for where -C differs between then #! and command lines. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=74b2b4b1788882713af5484605612fc6ec67405d;p=p5sagit%2Fp5-mst-13.2.git Add tests for where -C differs between then #! and command lines. --- diff --git a/t/run/switchC.t b/t/run/switchC.t index 9e52ad3..38e79a1 100644 --- a/t/run/switchC.t +++ b/t/run/switchC.t @@ -13,7 +13,7 @@ BEGIN { BEGIN { require "./test.pl"; } -plan(tests => 7); +plan(tests => 9); my $r; @@ -63,3 +63,15 @@ $r = runperl( switches => [ '-CS', '-w' ], prog => "#!perl -CS\nprint chr(256)", stderr => 1, ); like( $r, qr/^$b(?:\r?\n)?$/s, '#!perl -C' ); + +$r = runperl( switches => [ '-CA', '-w' ], + prog => "#!perl -CS\nprint chr(256)", + stderr => 1, ); +like( $r, qr/^Too late for "-CS" option at -e line 1\.$/s, + '#!perl -C with different -C on command line' ); + +$r = runperl( switches => [ '-w' ], + prog => "#!perl -CS\nprint chr(256)", + stderr => 1, ); +like( $r, qr/^Too late for "-CS" option at -e line 1\.$/s, + '#!perl -C but not command line' );