]> git.vpit.fr Git - perl/modules/indirect.git/blobdiff - t/20-good.t
Only check methods where the method name is a constant
[perl/modules/indirect.git] / t / 20-good.t
index 353949893fe4d9fdb2117ba5b4c393638fe5e9ec..f883537209281af88d55b32ce0e2bde45a3ed6d6 100644 (file)
@@ -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;