->xyzzy,
999,
'attribute installed',
);
is(
$obj->mymethod(''),
42,
'method installed',
);
isnt(
exception { $obj->mymethod() },
undef,
'signature works',
);
is(
$obj->blep({}),
'{}',
'm
'[]',
'multimethod candidate 2',
);
is(
$obj->blep(""),
'""',
'multimethod candidate 3',
);
isnt(
exception { $obj->blep(undef) },
undef,
'multimethod exception',
);
is(
$obj->XYZ,
666,
'
optimize => !!1,
caller => 'Foo',
});
is_deeply(
$code->([], [], 1.1, "hi"),
[ "Foo", [], [], 1, "hi" ],
);
isnt(
exception { $code->(1.1, "hi") },
undef,
);
done_testing;
ss => [
'Bar' => { has => { foo => { type => 'Foo' } } },
],
);
my $foo = MyApp->new_foo;
my $bar = MyApp->new_bar(foo => $foo);
isnt(
exception { $bar->foo(undef) },
undef,
);
done_testing;
{
class 'Bar' => sub {
has 'foo' => ( type => 'Foo' );
};
};
my $foo = MyApp->new_foo;
my $bar = MyApp->new_bar( foo => $foo );
isnt(
exception { $bar->foo(undef) },
undef,
);
done_testing;