X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=blobdiff_plain;f=t%2F001_mouse%2F039-subtype.t;h=7142f2b697e7107e129bce4e721678f1a32e0406;hp=50b7bf9c1490eda2abfc1df6db12b4b5ea7afc66;hb=4f24c5987ee735b348eeb03eb36074e3cd83cfd3;hpb=2a96ea8598dea995d57fa05e73cf2d42cf567e28 diff --git a/t/001_mouse/039-subtype.t b/t/001_mouse/039-subtype.t index 50b7bf9..7142f2b 100644 --- a/t/001_mouse/039-subtype.t +++ b/t/001_mouse/039-subtype.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 11; +use Test::More tests => 14; use Test::Exception; use Mouse::Util::TypeConstraints; @@ -24,8 +24,6 @@ do { is => 'ro', isa => 'NonemptyStr', ); - - }; ok(My::Class->new(name => 'foo')); @@ -48,3 +46,13 @@ lives_and{ ok!$tc->check([]); ok!$tc->check(undef); }; + +package Foo; +use Mouse::Util::TypeConstraints; + +$st = subtype as 'Int', where{ $_ > 0 }; + +::ok $st->is_a_type_of('Int'); +::ok $st->check(10); +::ok!$st->check(0); +