File: empty.t

package info (click to toggle)
libcgi-untaint-perl 1.26-3
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 112 kB
  • ctags: 21
  • sloc: perl: 302; makefile: 6
file content (19 lines) | stat: -rw-r--r-- 406 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
#!/usr/bin/perl

use CGI::Untaint;
use Test::More tests => 4;

my %params = ( foo => '', bar => undef);
my $h = CGI::Untaint->new({ %params });

{
	my $foo = $h->extract(-as_printable => 'foo');
	is $foo, '', "Extract empty text";
	ok !$h->error, "No error";
}

{
	my $bar = $h->extract(-as_printable => 'bar');
	is $bar, undef, "Extract undef";
	like $h->error, qr/No param/, "No parameter with undef";
}