File: 21-min_symbols.t

package info (click to toggle)
libvalidation-class-perl 7.900057-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 1,616 kB
  • sloc: perl: 21,493; makefile: 2
file content (27 lines) | stat: -rw-r--r-- 498 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use Test::More tests => 4;

package MyVal;
use Validation::Class;

package main;

my $r = MyVal->new(
    fields => {
        one => {
            label       => 'Object',
            min_symbols => 2
        }
    }
);

$r->params->{one} = '@@#';
ok $r->validate('one'), 'validation ok';

$r->params->{one} = '@@';
ok $r->validate('one'), 'validation ok';

$r->params->{one} = '!';
ok !$r->validate('one'), 'validation failed';

$r->params->{one} = '$$D';
ok $r->validate('one'), 'validation ok';