From: Florian Ragwitz Date: Wed, 3 Feb 2010 06:13:44 +0000 (+0100) Subject: More failing tests for Tuple. X-Git-Tag: 0.20~1^2~2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Types-Structured.git;a=commitdiff_plain;h=d5c6cdc8380d020b07549a6274734f6330f52422 More failing tests for Tuple. --- diff --git a/t/bug-optional.t b/t/bug-optional.t index 301de29..431c65f 100644 --- a/t/bug-optional.t +++ b/t/bug-optional.t @@ -9,11 +9,14 @@ BEGIN { use MooseX::Types -declare => [qw( Signature MyDict + MyTuple )]; subtype Signature, as Tuple[Tuple[Object], Dict[optional => Optional[Any], required => Any]]; subtype MyDict, as Dict[optional => Optional[Any], required => Any]; + + subtype MyTuple, as Tuple[Object, Any, Optional[Any]]; } BEGIN { @@ -30,4 +33,11 @@ ok(!MyDict->check({ required => 42, unknown => 23 })); ok(MyDict->check({ optional => 42, required => 23 })); ok(MyDict->check({ required => 23 })); +ok(!MyTuple->check([])); +ok(!MyTuple->check([bless({}, 'Foo')])); +ok(!MyTuple->check([bless({}, 'Foo'), 'bar', 'baz', 'moo'])); + +ok(MyTuple->check([bless({}, 'Foo'), 'bar'])); +ok(MyTuple->check([bless({}, 'Foo'), 'bar', 'baz'])); + done_testing;