File: 27_qualify_ref_happy_death.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 (64 lines) | stat: -rw-r--r-- 1,425 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
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Friendy error messages when quality_to_ref fails due to a typo. -mls 05/03/03 

use Test::More tests => 5;

use Data::FormValidator; 

my %FORM = (
	bad_email  => 'oops',
	good_email => 'great@domain.com',

	'short_name' => 'tim',
);

my $results;

eval {
$results = Data::FormValidator->check(\%FORM, { 
		required => 'good_email',
		filters  => 'grim', # testing filter typo
	});
};
like($@,qr/found named/, 'happy filters typo failure');

eval {
$results = Data::FormValidator->check(\%FORM, { 
		required => 'good_email',
		field_filters  => {
			'good_email' =>	'grim', # testing filter typo
		},
	});
};
like($@,qr/found named/, 'happy field_filters typo failure');

eval {
$results = Data::FormValidator->check(\%FORM, { 
		required => 'good_email',
		field_filter_regexp_map  => {
			qr/_email$/ =>	'grim', # testing filter typo
		},
	});
};
like($@,qr/found named/, 'happy field_filter_regexp_map typo failure');

eval {
$results = Data::FormValidator->check(\%FORM, { 
		required => 'good_email',
		constraints => {
			good_email => 'e-mail', # typo in constraint name
		}
	});
};
like($@,qr/found named/, 'happy constraints typo failure');

eval {
$results = Data::FormValidator->check(\%FORM, { 
		required => 'good_email',
		untaint_all_constraints => 1,
		constraints => {
			good_email => 'e-mail', # typo in constraint name
		}
	});
};
like($@,qr/found named/, 'happy untainted constraints typo failure');