From: Jarkko Hietaniemi Date: Thu, 2 Mar 2006 20:21:26 +0000 (+0200) Subject: Re: [perl #38657] -d:Foo=bar broke in 5.8.8 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=964b4e64c4d43990c57a48ba8eca4e6454ba5693;p=p5sagit%2Fp5-mst-13.2.git Re: [perl #38657] -d:Foo=bar broke in 5.8.8 Message-ID: <440737A6.4060606@gmail.com> p4raw-id: //depot/perl@27368 --- diff --git a/t/lib/Devel/switchd.pm b/t/lib/Devel/switchd.pm index 4a657be..e5b0629 100644 --- a/t/lib/Devel/switchd.pm +++ b/t/lib/Devel/switchd.pm @@ -1,6 +1,8 @@ package Devel::switchd; use strict; BEGIN { } # use strict; BEGIN { ... } to incite [perl #21890] +sub import { print "import<@_>;" } package DB; -sub DB { print join(",", caller), ";" } +sub DB { print "DB<", join(",", caller), ">;" } +sub sub { print "sub<$DB::sub>;"; goto &$DB::sub } 1; diff --git a/t/run/switchd.t b/t/run/switchd.t index 160ea99..b840a98 100644 --- a/t/run/switchd.t +++ b/t/run/switchd.t @@ -7,7 +7,9 @@ BEGIN { require "./test.pl"; -plan(tests => 1); +# This test depends on t/lib/Devel/switchd.pm. + +plan(tests => 2); my $r; my @tmpfiles = (); @@ -34,7 +36,14 @@ __SWDTEST__ $r = runperl( switches => [ '-Ilib', '-d:switchd' ], progfile => $filename, + args => ['3'], + ); + like($r, qr/^sub;import;DB;sub;DB;DB;DB;sub;DB;sub;DB;sub;DB;$/); + $r = runperl( + switches => [ '-Ilib', '-d:switchd=a,42' ], + progfile => $filename, + args => ['4'], ); - like($r, qr/^main,swdtest.tmp,9;Foo,swdtest.tmp,5;Foo,swdtest.tmp,6;Foo,swdtest.tmp,6;Bar,swdtest.tmp,2;Bar,swdtest.tmp,2;Bar,swdtest.tmp,2;$/i); + like($r, qr/^sub;import;DB;sub;DB;DB;DB;sub;DB;sub;DB;sub;DB;$/); }