-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for using aliased.pm with type signatures.
- Loading branch information
1 parent
1929314
commit d77e80c
Showing
2 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,3 @@ | |||
package My::Annoyingly::Long::Name::Space; | |||
use Moose; | |||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,27 @@ | |||
use strict; | |||
use warnings; | |||
use Test::More; | |||
use Test::Exception; | |||
|
|||
use FindBin; | |||
use lib "$FindBin::Bin/lib"; | |||
|
|||
{ | |||
package TestClass; | |||
use Moose; | |||
use MooseX::Method::Signatures; | |||
|
|||
use aliased 'My::Annoyingly::Long::Name::Space', 'Shortcut'; | |||
|
|||
eval 'method alias_sig (Shortcut $affe) { }'; | |||
::ok(!$@, 'method with aliased type constraint compiles'); | |||
} | |||
|
|||
my $o = TestClass->new; | |||
my $affe = My::Annoyingly::Long::Name::Space->new; | |||
|
|||
lives_ok(sub { | |||
$o->alias_sig($affe); | |||
}, 'calling method with aliased type constraint'); | |||
|
|||
done_testing; |