diff options
author | Gisle Aas <gisle@activestate.com> | 2006-01-06 10:54:18 +0000 |
---|---|---|
committer | Gisle Aas <gisle@activestate.com> | 2006-01-06 10:54:18 +0000 |
commit | 59e235cb8daec2c43b3d74772367e9ea06c2ce9b (patch) | |
tree | 84e79ea3e5851dcab978642fc7627f7dc15dcdcf /t | |
parent | 74ac850a5ee417afa60a477ea52af7a8f46a7e5a (diff) | |
download | perl-59e235cb8daec2c43b3d74772367e9ea06c2ce9b.tar.gz |
Make '-s' on the shebang line able to parse -foo=bar switches again.
This feature was broken by change 19695 some years ago
and integrated into perl-5.8.1. perl-5.8.0 was fine.
Ref http://bugs.activestate.com/show_bug.cgi?id=43483
p4raw-id: //depot/perl@26670
Diffstat (limited to 't')
-rw-r--r-- | t/run/switches.t | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/t/run/switches.t b/t/run/switches.t index f654486467..a81a962fb1 100644 --- a/t/run/switches.t +++ b/t/run/switches.t @@ -11,7 +11,7 @@ BEGIN { require "./test.pl"; -plan(tests => 30); +plan(tests => 31); use Config; @@ -125,11 +125,27 @@ $r = runperl( ); is( $r, '21-', '-s switch parsing' ); -# Bug ID 20011106.084 $filename = 'swstest.tmp'; SKIP: { open my $f, ">$filename" or skip( "Can't write temp file $filename: $!" ); print $f <<'SWTEST'; +#!perl -s +BEGIN { print $x,$y; exit } +SWTEST + close $f or die "Could not close: $!"; + $r = runperl( + progfile => $filename, + args => [ '-x=foo -y' ], + ); + is( $r, 'foo1', '-s on the shebang line' ); + push @tmpfiles, $filename; +} + +# Bug ID 20011106.084 +$filename = 'swsntest.tmp'; +SKIP: { + open my $f, ">$filename" or skip( "Can't write temp file $filename: $!" ); + print $f <<'SWTEST'; #!perl -sn BEGIN { print $x; exit } SWTEST @@ -138,7 +154,7 @@ SWTEST progfile => $filename, args => [ '-x=foo' ], ); - is( $r, 'foo', '-s on the shebang line' ); + is( $r, 'foo', '-sn on the shebang line' ); push @tmpfiles, $filename; } |