Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (26 sloc) 0.561 kb
use strict;
use warnings;
use Params::Validate qw(validate);
use Test::More;
{
package Overloaded;
use overload 'bool' => sub {0};
sub new { bless {} }
sub foo {1}
}
my $ovl = Overloaded->new;
{
eval {
my @p = ( object => $ovl );
validate( @p, { object => { isa => 'Overloaded' } } );
};
is( $@, q{}, 'overloaded object->isa' );
}
{
eval {
my @p = ( object => $ovl );
validate( @p, { object => { can => 'foo' } } );
};
is( $@, q{}, 'overloaded object->foo' );
}
done_testing();
Jump to Line
Something went wrong with that request. Please try again.