diff options
author | Tim Bunce <Tim.Bunce@pobox.com> | 2010-11-11 04:13:52 -0800 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-11-11 04:14:57 -0800 |
commit | fc6b470a9b3c7b9e095c3bac75416cf4c5dca0d3 (patch) | |
tree | da205eb38f834e29d15a903ff222037494e1e583 /t/run | |
parent | 90a8a7775b5e3d74ebe82bcba2072fe50a56700c (diff) | |
download | perl-fc6b470a9b3c7b9e095c3bac75416cf4c5dca0d3.tar.gz |
Test for [perl #78586]
Diffstat (limited to 't/run')
-rw-r--r-- | t/run/switchd-78586.t | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/t/run/switchd-78586.t b/t/run/switchd-78586.t new file mode 100644 index 0000000000..6dbf045e80 --- /dev/null +++ b/t/run/switchd-78586.t @@ -0,0 +1,40 @@ +#!perl -Ilib -d:switchd_empty + +BEGIN { $^P = 0x122; chdir 't'; require './test.pl'; } +use strict; +use warnings; +no warnings 'redefine'; + +plan 2; + +our @lines; +sub DB::DB { + my ($p, $f, $l) = caller; + return unless $f =~ /^\(eval \d+\)\[.*78586\.t:\d+\]/; + push @lines, $l; +} + +sub trace_lines { + my ($src) = @_; + local @lines; + eval $src; + die if $@; + return join " ", @lines; +} + +is trace_lines(<<'END'), "1 3 3 5"; + ++$b; + { + ++$b; + } + ++$b; +END + +is trace_lines(<<'END'), "1 2 3 3 5"; + ++$b; + for (my $a=1; $a <= 2; ++$a) { + ++$b; + } + ++$b; +END + |