X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=t%2F10-good.t;h=964cafe4fd66738ef68dc993267007d209974ce6;hb=b99dacb6b9a2fbdce5c91be542fff546f4c02fd9;hp=b88d721779fd773545a194f9451235b45b573cf2;hpb=c21777a35a9cee9151b6b2f6dcf5e16e17751c48;p=perl%2Fmodules%2Findirect.git diff --git a/t/10-good.t b/t/10-good.t index b88d721..964cafe 100644 --- a/t/10-good.t +++ b/t/10-good.t @@ -1,29 +1,45 @@ #!perl -T +package Dongs; + +sub new; + +package main; + use strict; use warnings; -use Test::More tests => 36 * 2; +use Test::More tests => 40 * 4; -my ($obj, $pkg, $cb, $x); +my ($obj, $pkg, $cb, $x, @a); sub meh; { local $/ = "####\n"; while () { chomp; + local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) }; { use indirect; - local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) }; eval "die qq{ok\\n}; $_"; } - is($@, "ok\n", $_); + is($@, "ok\n", "use indirect: $_"); { no indirect; - local $SIG{__WARN__} = sub { die 'warn:' . join(' ', @_) }; eval "die qq{ok\n}; $_"; } - is($@, "ok\n", $_); + is($@, "ok\n", "no indirect: $_"); + s/Hlagh/Dongs/g; + { + use indirect; + eval "die qq{ok\\n}; $_"; + } + is($@, "ok\n", "use indirect, defined: $_"); + { + no indirect; + eval "die qq{ok\\n}; $_"; + } + is($@, "ok\n", "no indirect, defined: $_"); } } @@ -128,3 +144,11 @@ $obj = "apple ${\(new Hlagh)} pear" $obj = "apple @{[new Hlagh]} pear" #### s/dongs/new Hlagh/e; +#### +exec $x $x, @a; +#### +exec { $a[0] } @a; +#### +system $x $x, @a; +#### +system { $a[0] } @a;