X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=t%2F20-good.t;h=12a4a76bb6b5adcddd4bdceba487f8ced4120cc5;hp=4a7c3a0fa0fa6e7860787e759ac4e0725860e5de;hb=ce2df2b3143e49d1d1531f6f76e270b973dffad2;hpb=c7b10fa5c0fe7243236bf0efa9a33776bafdc5c1 diff --git a/t/20-good.t b/t/20-good.t index 4a7c3a0..12a4a76 100644 --- a/t/20-good.t +++ b/t/20-good.t @@ -9,10 +9,12 @@ package main; use strict; use warnings; -use Test::More tests => 56 * 8; +use Test::More tests => 74 * 8; + +BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} } my ($obj, $pkg, $cb, $x, @a); -our $y; +our ($y, $meth); sub meh; sub zap (&); @@ -122,6 +124,12 @@ $obj = Hlagh->$cb($pkg); #### $obj = Hlagh->$cb(sub { 'foo' }, bar => $obj); #### +$obj = Hlagh->$meth; +#### +$obj = Hlagh + -> + $meth ( 1, 2 ); +#### $obj = $pkg->new ; #### $obj = $pkg -> new ( ); @@ -149,6 +157,30 @@ $obj = $pkg->$cb( $obj ); #### $obj = $pkg->$cb(qw/foo bar baz/); #### +$obj = $pkg->$meth; +#### +$obj + = + $pkg + -> + $meth + ( 1 .. 10 ); +#### +$obj = $y->$cb; +#### +$obj = $y + -> $cb ( + 'foo', 1, 2, 'bar' +); +#### +$obj = $y->$meth; +#### +$obj = + $y-> + $meth ( + qr(hello), +); +#### meh; #### meh $_; @@ -185,9 +217,29 @@ print STDOUT "bananananananana\n"; #### $x->foo($pkg->$cb) #### -$obj = "apple ${\(new Hlagh)} pear" +$obj = "apple ${\($x->new)} pear" +#### +$obj = "apple @{[$x->new]} pear" +#### +$obj = "apple ${\($y->new)} pear" +#### +$obj = "apple @{[$y->new]} pear" +#### +$obj = "apple ${\($x->$cb)} pear" +#### +$obj = "apple @{[$x->$cb]} pear" +#### +$obj = "apple ${\($y->$cb)} pear" +#### +$obj = "apple @{[$y->$cb]} pear" +#### +$obj = "apple ${\($x->$meth)} pear" +#### +$obj = "apple @{[$x->$meth]} pear" +#### +$obj = "apple ${\($y->$meth)} pear" #### -$obj = "apple @{[new Hlagh]} pear" +$obj = "apple @{[$y->$meth]} pear" #### exec $x $x, @a; ####