update foreign tests
[p5sagit/Function-Parameters.git] / t / foreign / MooseX-Method-Signatures / type_alias.t
CommitLineData
1a52f2db 1#!perl
2use strict;
3use warnings FATAL => 'all';
4use Test::More
5 eval { require Moose; require aliased }
6 ? (tests => 2)
7 : (skip_all => "Moose, aliased required for testing types")
8;
9use Test::Fatal;
10
11use Dir::Self;
12use lib __DIR__ . '/lib';
13
14{
15 package TestClass;
16 use Moose;
17 use Function::Parameters qw(:strict);
18
19 use aliased 'My::Annoyingly::Long::Name::Space', 'Shortcut';
20
21 ::is(::exception { method alias_sig ((Shortcut) $affe) { } },
22 undef, 'method with aliased type constraint compiles');
23}
24
25my $o = TestClass->new;
26my $affe = My::Annoyingly::Long::Name::Space->new;
27
28is(exception {
29 $o->alias_sig($affe);
30}, undef, 'calling method with aliased type constraint');
31