File: 05_textarea.t

package info (click to toggle)
libhtml-fillinform-perl 2.22-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 356 kB
  • sloc: perl: 649; makefile: 2
file content (39 lines) | stat: -rw-r--r-- 783 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
# -*- Mode: Perl; -*-

use strict;

$^W = 1;

print "1..3\n";

use HTML::FillInForm;

print "ok 1\n";

my $hidden_form_in = qq{<TEXTAREA NAME="foo">blah</TEXTAREA>};

my %fdat = (foo => 'bar>bar');

my $fif = new HTML::FillInForm;
my $output = $fif->fill(scalarref => \$hidden_form_in,
			fdat => \%fdat);
if ($output eq '<TEXTAREA NAME="foo">bar&gt;bar</TEXTAREA>'){
	print "ok 2\n";
} else {
	print "Got unexpected out for $hidden_form_in:\n$output\n";
	print "not ok 2\n";
}

# empty fdat test

%fdat = (foo => '');

$fif = new HTML::FillInForm;
$output = $fif->fill(scalarref => \$hidden_form_in,
			fdat => \%fdat);
if ($output eq '<TEXTAREA NAME="foo"></TEXTAREA>'){
	print "ok 3\n";
} else {
	print "Got unexpected out for $hidden_form_in:\n$output\n";
	print "not ok 3\n";
}