Skip to content

Commit

Permalink
Make sure we keep working with Devel::CallParser loaded
Browse files Browse the repository at this point in the history
  • Loading branch information
rafl committed May 2, 2011
1 parent 499109e commit 74d9d9c
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions t/devel_callparser.t
@@ -0,0 +1,33 @@
use warnings;
use strict;

BEGIN {
eval { require Devel::CallParser };
if($@ ne "") {
require Test::More;
Test::More::plan(skip_all => "Devel::CallParser unavailable");
}
}

use Test::More tests => 1;

use Devel::CallParser ();

sub method {
my ($usepack, $name, $inpack, $sub) = @_;
no strict "refs";
*{"${inpack}::${name}"} = $sub;
}

use Devel::Declare method => sub {
my ($usepack, $use, $inpack, $name) = @_;
return sub (&) { ($usepack, $name, $inpack, $_[0]); };
};

method bar {
return join(",", @_);
};

is +__PACKAGE__->bar(qw(x y)), "main,x,y";

1;

0 comments on commit 74d9d9c

Please sign in to comment.