use strict;
use warnings;
-use Test::More tests => 22;
+use Test::More tests => 25;
use Test::Fatal;
+use Test::Exception;
{
package FooTest;
StrongPassword
NonEmptyStr
LowerCaseStr
- UpperCaseStr),
+ UpperCaseStr
+ NumericCode
+ ),
);
has simplestr => ( is => 'rw', isa => SimpleStr );
has strongpassword => ( is => 'rw', isa => StrongPassword );
has lowercasestr => ( is => 'rw', isa => LowerCaseStr );
has uppercasestr => ( is => 'rw', isa => UpperCaseStr );
+ has numericcode => ( is => 'rw', isa => NumericCode );
}
my $ins = FooTest->new;
isnt(exception { $ins->uppercasestr('notok') }, undef, 'UpperCaseStr');
is(exception { $ins->uppercasestr('OK') }, undef, 'UpperCaseStr 2');
+
+
+is( exception { $ins->numericcode('032') }, undef, 'NumericCode lives');
+isnt( exception { $ins->numericcode('abc') }, undef, 'NumericCode dies' );
+isnt( exception { $ins->numericcode('x18') }, undef, 'mixed NumericCode dies');