X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Flib%2FDecoratorLibrary.pm;fp=t%2Flib%2FDecoratorLibrary.pm;h=faa8327cb5af0d5269a1aebff316b504e52310e9;hb=e9dc30af81ed775a6ac0a0f0c1daad021e5569f6;hp=7c8ad928eb94f60a060e307712447d27102dbbed;hpb=a2487cfb17f24711667462ae01dc8cf8a47ac87e;p=gitmo%2FMooseX-Types.git diff --git a/t/lib/DecoratorLibrary.pm b/t/lib/DecoratorLibrary.pm index 7c8ad92..faa8327 100644 --- a/t/lib/DecoratorLibrary.pm +++ b/t/lib/DecoratorLibrary.pm @@ -25,18 +25,18 @@ use MooseX::Types subtype MyArrayRefBase, as ArrayRef; - + coerce MyArrayRefBase, from Str, via {[split(',', $_)]}; - + subtype MyArrayRefInt01, as ArrayRef[Int]; subtype BiggerInt, as Int, where {$_>10}; - + subtype SubOfMyArrayRefInt01, as MyArrayRefInt01[BiggerInt]; @@ -45,13 +45,13 @@ coerce MyArrayRefInt01, via {[split('\.',$_)]}, from HashRef, via {[sort values(%$_)]}; - + subtype MyArrayRefInt02, as MyArrayRefBase[Int]; - + subtype MyHashRefOfInts, as HashRef[Int]; - + subtype MyHashRefOfStr, as HashRef[Str]; @@ -71,10 +71,10 @@ subtype StrOrArrayRef, subtype AtLeastOneInt, as ArrayRef[Int], where { @$_ > 0 }; - + enum Jobs, (qw/Programming Teaching Banking/); - + subtype isFive, as Int, where { $_ == 5}; @@ -82,15 +82,15 @@ subtype isFive, subtype isTen, as Int, where { $_ == 10}; - + subtype isFifteen, as Int, where { $_ == 15}; - + subtype VeryBigInt, as BiggerInt, where {$_>100}; - + subtype FiveOrTenOrFifteen, as isFive|isTen|isFifteen; @@ -98,5 +98,5 @@ subtype WierdIntegersArrayRef1, as ArrayRef[FiveOrTenOrFifteen|VeryBigInt]; subtype WierdIntegersArrayRef2, - as ArrayRef[FiveOrTenOrFifteen|Object]; + as ArrayRef[FiveOrTenOrFifteen|Object]; 1;