X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F20_union_with_string_type.t;h=38d921f44f6c221befb5b6965ec803c08c79330d;hb=e9dc30af81ed775a6ac0a0f0c1daad021e5569f6;hp=8147f8629f236d247ab8109c96088c74b1238ff4;hpb=a344ca961b0a3507cfb5a4fc142c3d89c0bea1c7;p=gitmo%2FMooseX-Types.git diff --git a/t/20_union_with_string_type.t b/t/20_union_with_string_type.t index 8147f86..38d921f 100644 --- a/t/20_union_with_string_type.t +++ b/t/20_union_with_string_type.t @@ -19,9 +19,9 @@ my $exception; Test::More::ok !$@, 'types are not mutated by union with a string type'; - subtype Test1, + subtype Test1, as Int | 'ArrayRef[Int]'; - + Test::More::ok Test1->check(1), '1 is an Int'; Test::More::ok !Test1->check('a'), 'a is not an Int'; Test::More::ok Test1->check([1, 2, 3]), 'Passes ArrayRef'; @@ -29,16 +29,16 @@ my $exception; Test::More::ok !Test1->check({a=>1}), 'fails wrong ref type'; eval { - subtype Test2, + subtype Test2, as Int | 'IDONTEXIST'; }; my $check = $@; - Test::More::ok $@, 'Got an error for bad Type'; + Test::More::ok $@, 'Got an error for bad Type'; Test::More::like $check, qr/IDONTEXIST is not a type constraint/, 'correct error'; - my $obj = subtype Test3, + my $obj = subtype Test3, as Int | 'ArrayRef[Int]' | Object; Test::More::ok Test3->check(1), '1 is an Int';