X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2Findirect.git;a=blobdiff_plain;f=t%2F20-good.t;h=f883537209281af88d55b32ce0e2bde45a3ed6d6;hp=353949893fe4d9fdb2117ba5b4c393638fe5e9ec;hb=refs%2Ftags%2Frt60378;hpb=e3cc63669e7d84f338348281f313709bae0be8af diff --git a/t/20-good.t b/t/20-good.t index 3539498..f883537 100644 --- a/t/20-good.t +++ b/t/20-good.t @@ -9,12 +9,12 @@ package main; use strict; use warnings; -use Test::More tests => 56 * 8; +use Test::More tests => 80 * 8; BEGIN { delete $ENV{PERL_INDIRECT_PM_DISABLE} } my ($obj, $pkg, $cb, $x, @a); -our $y; +our ($y, $meth); sub meh; sub zap (&); @@ -124,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 ( ); @@ -151,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 $_; @@ -187,10 +217,42 @@ print STDOUT "bananananananana\n"; #### $x->foo($pkg->$cb) #### +$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 @{[$y->$meth]} pear" +#### $obj = "apple ${\(new Hlagh)} pear" #### $obj = "apple @{[new Hlagh]} pear" #### +$obj = "apple ${\(new $x)} pear" +#### +$obj = "apple @{[new $x]} pear" +#### +$obj = "apple ${\(new $y)} pear" +#### +$obj = "apple @{[new $y]} pear" +#### exec $x $x, @a; #### exec { $a[0] } @a;