X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F01-string.t;h=39d50b9297f0a6a8aa40669ad9937157e2463402;hb=19ef3f5a0f4e5ca8afdc65be59944f0766ef7001;hp=807af4f50845ff1c64e4eb276e4bf9bdf04250c3;hpb=c52f847ab091407c10541e333238536c75d3f169;p=gitmo%2FMooseX-Types-Common.git diff --git a/t/01-string.t b/t/01-string.t index 807af4f..39d50b9 100644 --- a/t/01-string.t +++ b/t/01-string.t @@ -2,7 +2,7 @@ use strict; use warnings; -use Test::More tests => 25; +use Test::More tests => 33; use Test::Fatal; { @@ -36,6 +36,8 @@ use Test::Fatal; my $ins = FooTest->new; +# TODO: need to check both the inlined and non-inlined versions! + is(exception { $ins->simplestr('') }, undef, 'SimpleStr'); is(exception { $ins->simplestr('good string') }, undef, 'SimpleStr 2'); isnt(exception { $ins->simplestr("bad\nstring") }, 'SimpleStr 3'); @@ -57,16 +59,23 @@ is(exception { $ins->strongpassword('83773r_ch01c3') }, undef, 'StrongPassword 2 isnt(exception { $ins->lcsimplestr('NOTOK') }, undef, 'LowerCaseSimpleStr'); is(exception { $ins->lcsimplestr('ok') }, undef, 'LowerCaseSimpleStr 2'); +isnt(exception { $ins->lcsimplestr('NOTOK_123`"') }, undef, 'LowerCaseSimpleStr 3'); +is(exception { $ins->lcsimplestr('ok_123`"') }, undef, 'LowerCaseSimpleStr 4'); isnt(exception { $ins->ucsimplestr('notok') }, undef, 'UpperCaseSimpleStr'); is(exception { $ins->ucsimplestr('OK') }, undef, 'UpperCaseSimpleStr 2'); +isnt(exception { $ins->ucsimplestr('notok_123`"') }, undef, 'UpperCaseSimpleStr 3'); +is(exception { $ins->ucsimplestr('OK_123`"') }, undef, 'UpperCaseSimpleStr 4'); isnt(exception { $ins->lowercasestr('NOTOK') }, undef, 'LowerCaseStr'); -is(exception { $ins->lowercasestr('ok') }, undef, 'LowerCaseStr 2'); +is(exception { $ins->lowercasestr("ok\nok") }, undef, 'LowerCaseStr 2'); +isnt(exception { $ins->lowercasestr('NOTOK_123`"') }, undef, 'LowerCaseStr 3'); +is(exception { $ins->lowercasestr("ok\n_123`'") }, undef, 'LowerCaseStr 4'); isnt(exception { $ins->uppercasestr('notok') }, undef, 'UpperCaseStr'); -is(exception { $ins->uppercasestr('OK') }, undef, 'UpperCaseStr 2'); - +is(exception { $ins->uppercasestr("OK\nOK") }, undef, 'UpperCaseStr 2'); +isnt(exception { $ins->uppercasestr('notok_123`"') }, undef, 'UpperCaseStr 3'); +is(exception { $ins->uppercasestr("OK\n_123`'") }, undef, 'UpperCaseStr 4'); is( exception { $ins->numericcode('032') }, undef, 'NumericCode lives'); isnt( exception { $ins->numericcode('abc') }, undef, 'NumericCode dies' );