File: check_profile_syntax.t

package info (click to toggle)
libdata-formvalidator-perl 4.66-1%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 588 kB
  • ctags: 127
  • sloc: perl: 2,756; makefile: 2
file content (49 lines) | stat: -rw-r--r-- 797 bytes parent folder | download | duplicates (6)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
use Test::More qw/no_plan/;
use Data::FormValidator;
use strict;

{
	local $@ = undef;
	eval {
	  my $results = Data::FormValidator->check({}, 
		{
			msgs => {
				my_field => 'foo',
			},
		}
	);
	};
	like($@, qr/Invalid/, 'checking syntax of unknown msgs fields works');
}

my $results;
eval {
$results = Data::FormValidator->check({}, 
    {
        constraints => {
            key => {
                oops => 1,
            },

        },
    }
);
};

like($@, qr/Invalid/, 'checking syntax of constraint hashrefs works');


eval {
$results = Data::FormValidator->check({}, 
    {
        constraint_regexp_map => {
            qr/key/ => {
                oops => 1,
            },

        },
    }
);
};
like($@, qr/Invalid/, 'checking syntax of constraint_regexp_map hashrefs works');