X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fforeign%2FMooseX-Method-Signatures%2Ftype_alias.t;fp=t%2Fforeign%2FMooseX-Method-Signatures%2Ftype_alias.t;h=21b8caca6ba98c175c2e3f9e9be9325413257bbd;hb=1a52f2db46f6d870454428a07bfae09e0359eeee;hp=0000000000000000000000000000000000000000;hpb=ff265988561375d3cf480004e29e3891094c0afb;p=p5sagit%2FFunction-Parameters.git diff --git a/t/foreign/MooseX-Method-Signatures/type_alias.t b/t/foreign/MooseX-Method-Signatures/type_alias.t new file mode 100644 index 0000000..21b8cac --- /dev/null +++ b/t/foreign/MooseX-Method-Signatures/type_alias.t @@ -0,0 +1,31 @@ +#!perl +use strict; +use warnings FATAL => 'all'; +use Test::More + eval { require Moose; require aliased } + ? (tests => 2) + : (skip_all => "Moose, aliased required for testing types") +; +use Test::Fatal; + +use Dir::Self; +use lib __DIR__ . '/lib'; + +{ + package TestClass; + use Moose; + use Function::Parameters qw(:strict); + + use aliased 'My::Annoyingly::Long::Name::Space', 'Shortcut'; + + ::is(::exception { method alias_sig ((Shortcut) $affe) { } }, + undef, 'method with aliased type constraint compiles'); +} + +my $o = TestClass->new; +my $affe = My::Annoyingly::Long::Name::Space->new; + +is(exception { + $o->alias_sig($affe); +}, undef, 'calling method with aliased type constraint'); +