Mojolicious-Plugin-Vparam

 view release on metacpan or  search on metacpan

t/020_simple.t  view on Meta::CPAN


        is $self->vparam( str3 => qr{^[\w\s]{10,20}$} ),
            undef,                                      'str3 empty';
        is $self->verror('str3'), 'Wrong format',       'str3 error';

        is $self->vparam( str4 => qr{^(www)$}, default => 'abc' ),
            'abc',                                      'str4 default';
        is $self->verror('str4'), 0,                    'str4 no error';

        is $self->vparam(
            str5    => qr{^(online_)?(all|free|busy|auto)$},
            default => 'all',
        ), 'auto',                                      'str5 regexp';
        is $self->verror('str5'), 0,
            'str5 no error, set default';

        $self->render(text => 'OK.');
    });

    $t->post_ok("/test/regexp/vparam", form => {
        str1    => 'aaa111bbb222 ccc333',



( run in 0.389 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )