diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-05-02 08:41:40 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-05-02 08:41:40 +0000 |
commit | d7aa4417de5aebb1d2374018c62148692ef32d8b (patch) | |
tree | 0caf2890368b5edbc2c2a4d131a62eb7f4b7e198 | |
parent | d139edd66f0b258762aab6209968ebbac6390a47 (diff) | |
download | perl-d7aa4417de5aebb1d2374018c62148692ef32d8b.tar.gz |
The [perl #21890] (Devel::Coverage breakage) has been fixed
by change #18589 (it was broken by change #9754); add test case.
p4raw-link: @18589 on //depot/perl: 5df8de69806210bf48dc2e451e3db37c6f274c6e
p4raw-link: @9754 on //depot/perl: 9d43a7557743d779c74d69ffc6df7fc17711f3ec
p4raw-id: //depot/perl@19378
-rw-r--r-- | MANIFEST | 1 | ||||
-rw-r--r-- | t/run/switchd.t | 40 |
2 files changed, 41 insertions, 0 deletions
@@ -2737,6 +2737,7 @@ t/run/fresh_perl.t Tests that require a fresh perl. t/run/noswitch.t Test aliasing ARGV for other switch tests t/run/runenv.t Test if perl honors its environment variables. t/run/switcha.t Test the -a switch +t/run/switchd.t Test the -d switch t/run/switchC.t Test the -C switch t/run/switches.t Tests for the other switches (-0, -l, -c, -s, -M, -m, -V) t/run/switchF.t Test the -F switch diff --git a/t/run/switchd.t b/t/run/switchd.t new file mode 100644 index 0000000000..83d4976b71 --- /dev/null +++ b/t/run/switchd.t @@ -0,0 +1,40 @@ +#!./perl -w + +BEGIN { + chdir 't' if -d 't'; + @INC = qw(../lib lib); +} + +require "./test.pl"; + +plan(tests => 1); + +my $r; +my @tmpfiles = (); +END { unlink @tmpfiles } + +my $filename = 'swdtest.tmp'; +SKIP: { + open my $f, ">$filename" + or skip( "Can't write temp file $filename: $!" ); + print $f <<'__SWDTEST__'; +package Bar; +sub bar { $_[0] * $_[0] } +package Foo; +sub foo { + my $s; + $s += Bar::bar($_) for 1..$_[0]; +} +package main; +Foo::foo(3); +__SWDTEST__ + close $f; + push @tmpfiles, $filename; + $| = 1; # Unbufferize. + $r = runperl( + switches => [ '-Ilib', '-d:DevelTest' ], + progfile => $filename, + ); + like($r, qr/^main,swdtest.tmp,9;Foo,swdtest.tmp,5;Foo,swdtest.tmp,6;Foo,swdtest.tmp,6;Bar,swdtest.tmp,2;Foo,swdtest.tmp,6;Bar,swdtest.tmp,2;Foo,swdtest.tmp,6;Bar,swdtest.tmp,2;Foo,swdtest.tmp,6;$/i); +} + |