summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2006-03-02 22:21:26 +0200
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-03-03 15:45:32 +0000
commit964b4e64c4d43990c57a48ba8eca4e6454ba5693 (patch)
tree5fc32594fd735cb4da122226dedebaf59c696d85 /t
parentb6a7163e84fec2ee27fc3d0c252e50424d27241f (diff)
downloadperl-964b4e64c4d43990c57a48ba8eca4e6454ba5693.tar.gz
Re: [perl #38657] -d:Foo=bar broke in 5.8.8
Message-ID: <440737A6.4060606@gmail.com> p4raw-id: //depot/perl@27368
Diffstat (limited to 't')
-rw-r--r--t/lib/Devel/switchd.pm4
-rw-r--r--t/run/switchd.t13
2 files changed, 14 insertions, 3 deletions
diff --git a/t/lib/Devel/switchd.pm b/t/lib/Devel/switchd.pm
index 4a657bef91..e5b062911d 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 160ea9970d..b840a98b26 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<Devel::switchd::import>;import<Devel::switchd>;DB<main,swdtest.tmp,9>;sub<Foo::foo>;DB<Foo,swdtest.tmp,5>;DB<Foo,swdtest.tmp,6>;DB<Foo,swdtest.tmp,6>;sub<Bar::bar>;DB<Bar,swdtest.tmp,2>;sub<Bar::bar>;DB<Bar,swdtest.tmp,2>;sub<Bar::bar>;DB<Bar,swdtest.tmp,2>;$/);
+ $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<Devel::switchd::import>;import<Devel::switchd a 42>;DB<main,swdtest.tmp,9>;sub<Foo::foo>;DB<Foo,swdtest.tmp,5>;DB<Foo,swdtest.tmp,6>;DB<Foo,swdtest.tmp,6>;sub<Bar::bar>;DB<Bar,swdtest.tmp,2>;sub<Bar::bar>;DB<Bar,swdtest.tmp,2>;sub<Bar::bar>;DB<Bar,swdtest.tmp,2>;$/);
}