X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F040_type_constraints%2F008_union_types.t;h=cff72483c64b9a0aef8dedae0004a183c7aff648;hb=abandoned%2Fname-delegations;hp=5c84661af4edf3ebd4216d1717b7e48d3e730051;hpb=4c015454152fff7c0a2c71665d4dc5e0f39b835b;p=gitmo%2FMoose.git diff --git a/t/040_type_constraints/008_union_types.t b/t/040_type_constraints/008_union_types.t index 5c84661..cff7248 100644 --- a/t/040_type_constraints/008_union_types.t +++ b/t/040_type_constraints/008_union_types.t @@ -3,11 +3,11 @@ use strict; use warnings; -use Test::More tests => 35; +use Test::More; use Test::Exception; BEGIN { - use_ok('Moose::Util::TypeConstraints'); + use_ok('Moose::Util::TypeConstraints'); } my $Str = find_type_constraint('Str'); @@ -66,15 +66,16 @@ diag $HashOrArray->validate([]); ok(!defined($HashOrArray->validate([])), '... (ArrayRef | HashRef) can accept []'); ok(!defined($HashOrArray->validate({})), '... (ArrayRef | HashRef) can accept {}'); -like($HashOrArray->validate(\(my $var2)), -qr/Validation failed for \'ArrayRef\' failed with value SCALAR\(0x.+?\) and Validation failed for \'HashRef\' failed with value SCALAR\(0x.+?\) in \(ArrayRef\|HashRef\)/, +like($HashOrArray->validate(\(my $var2)), +qr/Validation failed for \'ArrayRef\' failed with value SCALAR\(0x.+?\) and Validation failed for \'HashRef\' failed with value SCALAR\(0x.+?\) in \(ArrayRef\|HashRef\)/, '... (ArrayRef | HashRef) cannot accept scalar refs'); -like($HashOrArray->validate(sub {}), -qr/Validation failed for \'ArrayRef\' failed with value CODE\(0x.+?\) and Validation failed for \'HashRef\' failed with value CODE\(0x.+?\) in \(ArrayRef\|HashRef\)/, +like($HashOrArray->validate(sub {}), +qr/Validation failed for \'ArrayRef\' failed with value CODE\(0x.+?\) and Validation failed for \'HashRef\' failed with value CODE\(0x.+?\) in \(ArrayRef\|HashRef\)/, '... (ArrayRef | HashRef) cannot accept code refs'); is($HashOrArray->validate(50), -'Validation failed for \'ArrayRef\' failed with value 50 and Validation failed for \'HashRef\' failed with value 50 in (ArrayRef|HashRef)', +'Validation failed for \'ArrayRef\' failed with value 50 and Validation failed for \'HashRef\' failed with value 50 in (ArrayRef|HashRef)', '... (ArrayRef | HashRef) cannot accept Numbers'); +done_testing;