X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F040_type_constraints%2F018_custom_parameterized_types.t;h=be0fd85d9ca215855bd3f6426bad45a10a63b0fc;hb=31aa6299ca20515174f1b145e5b3d4dbd9e09a08;hp=5dad083444246ff87ae4af463b6ade3b7c13d28d;hpb=fde8e43f95fe996fbc2a778aa259feeb04552171;p=gitmo%2FMouse.git diff --git a/t/040_type_constraints/018_custom_parameterized_types.t b/t/040_type_constraints/018_custom_parameterized_types.t index 5dad083..be0fd85 100644 --- a/t/040_type_constraints/018_custom_parameterized_types.t +++ b/t/040_type_constraints/018_custom_parameterized_types.t @@ -7,7 +7,6 @@ use strict; use warnings; use Test::More; -$TODO = q{Mouse is not yet completed}; use Test::Exception; BEGIN { @@ -48,6 +47,7 @@ lives_ok { ok($t->check({ one => 1, two => 2 }), '... validated it correctly'); ok(!$t->check({ one1 => 1, two2 => 2 }), '... validated it correctly'); + local $TODO = 'Mouse does not support equals()'; ok( $t->equals($t), "equals to self" ); ok( !$t->equals($t->parent), "not equal to parent" ); } @@ -58,15 +58,15 @@ ok($hoi->check({ one => 1, two => 2 }), '... validated it correctly'); ok(!$hoi->check({ one1 => 1, two2 => 2 }), '... validated it correctly'); ok(!$hoi->check({ one => 'uno', two => 'dos' }), '... validated it correctly'); ok(!$hoi->check({ one1 => 'un', two2 => 'deux' }), '... validated it correctly'); - +{ local $TODO = 'Mouse does not support equals()'; ok( $hoi->equals($hoi), "equals to self" ); ok( !$hoi->equals($hoi->parent), "equals to self" ); ok( !$hoi->equals(find_type_constraint('AlphaKeyHash')), "not equal to unparametrized self" ); ok( $hoi->equals( Mouse::Meta::TypeConstraint->new( name => "Blah", parent => find_type_constraint("AlphaKeyHash"), type_parameter => find_type_constraint("Int") ) ), "equal to clone" ); ok( !$hoi->equals( Mouse::Meta::TypeConstraint->new( name => "Oink", parent => find_type_constraint("AlphaKeyHash"), type_parameter => find_type_constraint("Str") ) ), "not equal to different parameter" ); +} # end TODO my $th = Mouse::Util::TypeConstraints::find_or_parse_type_constraint('Trihash[Bool]'); - ok(!$th->check({ one => 1, two => 1 }), '... validated it correctly'); ok($th->check({ one => 1, two => 0, three => 1 }), '... validated it correctly'); ok(!$th->check({ one => 1, two => 2, three => 1 }), '... validated it correctly');