diff options
Diffstat (limited to 't/03invalid_tc.t')
-rw-r--r-- | t/03invalid_tc.t | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/t/03invalid_tc.t b/t/03invalid_tc.t new file mode 100644 index 0000000..e006981 --- /dev/null +++ b/t/03invalid_tc.t @@ -0,0 +1,39 @@ +=head1 PURPOSE + +Check that we get error messages about unrecognisable type constraints. + +=head1 AUTHOR + +Toby Inkster E<lt>tobyink@cpan.orgE<gt>. + +=head1 COPYRIGHT AND LICENCE + +This software is copyright (c) 2012-2013 by Toby Inkster. + +This is free software; you can redistribute it and/or modify it under +the same terms as the Perl 5 programming language system itself. + +=cut + +use strict; +use warnings; + +use Test::More; + +$@ = undef; +ok !eval q { +# line 1 "embedded" + package Foo; + use Moo; + use MooX::late; + has foo => (is => 'ro', isa => 'X Y Z', required => 0); + 1; +}; + +like( + $@, + qr{^Unexpected tail on type expression: Y Z}, + 'error message looks ok', +); + +done_testing; |