From: Shawn M Moore Date: Wed, 4 Jun 2008 04:02:24 +0000 (+0000) Subject: Expand the isa tests a bit, all that's left is population of valid/invalid values X-Git-Tag: 0.04~101 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=9f15f9eb5321495ed6ad2001784c01417724ec9d;hp=7e68124fa0ce88192ea0a8664051411876403d56;p=gitmo%2FMouse.git Expand the isa tests a bit, all that's left is population of valid/invalid values --- diff --git a/t/024-isa.t b/t/024-isa.t index 65dee16..8e68800 100644 --- a/t/024-isa.t +++ b/t/024-isa.t @@ -1,17 +1,29 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 6; +use Test::More; use Test::Exception; my %values_for_type = ( Any => { - valid => ["foo"], + valid => [ + undef, + \undef, + 1.0, + "foo", + \"foo", + sub { die }, + qr/^1?$|^(11+?)\1+$/, + [], + {}, + \do { my $v }, + Test::Builder->new, + ], invalid => [], }, Item => { - valid => [], + #valid => [], # populated later with the values from Any invalid => [], }, @@ -101,6 +113,15 @@ my %values_for_type = ( }, ); +$values_for_type{Item}{valid} = $values_for_type{Any}{valid}; + +my $plan = 0; +$plan += 5 * @{ $values_for_type{$_}{valid} } for keys %values_for_type; +$plan += 4 * @{ $values_for_type{$_}{invalid} } for keys %values_for_type; +$plan++; # can_ok + +plan tests => $plan; + do { package Class; use Mouse;