File: 26_inarray.t

package info (click to toggle)
libformvalidator-simple-perl 0.29-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 412 kB
  • sloc: perl: 3,043; makefile: 4
file content (21 lines) | stat: -rw-r--r-- 432 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
use strict;
use Test::More tests => 4;

BEGIN{ use_ok("FormValidator::Simple") }

use CGI;

my $q = CGI->new;
$q->param( foo => 'foo' );
$q->param( bar => 'bar' );
$q->param( buz => 0 );

my $r = FormValidator::Simple->check( $q => [ 
    foo => [ [qw/IN_ARRAY foo bar buz/] ],
    bar => [ [qw/IN_ARRAY foo buz/] ],
    buz => [ [qw/IN_ARRAY 0 1/] ],
] );

ok(!$r->invalid('foo'));
ok($r->invalid('bar'));
ok(!$r->invalid('buz'));