~ubuntu-branches/ubuntu/saucy/libhtml-fillinform-perl/saucy-proposed

« back to all changes in this revision

Viewing changes to t/11_target.t

  • Committer: Bazaar Package Importer
  • Author(s): gregor herrmann
  • Date: 2008-03-01 22:28:37 UTC
  • mfrom: (3.1.1 hardy)
  • Revision ID: james.westby@ubuntu.com-20080301222837-2o991644nb992eqj
Tags: 2.00-2
* debian/control: Added: Vcs-Svn field (source stanza); Vcs-Browser
  field (source stanza); Homepage field (source stanza). Removed: XS-
  Vcs-Svn fields.
* debian/rules:
  - delete /usr/lib/perl5 only if it exists (closes: #467951)
  - remove CFLAGS
* debian/watch: use dist-based URL.
* Set Standards-Version to 3.7.3 (no changes).
* Set debhelper compatibility level to 6.
* debian/copyright: change upstream source URL, convert to new format.
* Add /me to Uploaders.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
 
3
3
use strict;
4
4
use Test;
5
 
BEGIN { plan tests => 3 }
 
5
BEGIN { plan tests => 8 }
6
6
 
7
7
use HTML::FillInForm;
8
8
 
16
16
<FORM>
17
17
<INPUT TYPE="TEXT" NAME="foo3" value="nada">
18
18
</FORM>
 
19
<FORM id="foo4">
 
20
<INPUT TYPE="TEXT" NAME="foo4" value="nada">
 
21
</FORM>
19
22
EOF
20
23
  ;
21
24
  
23
26
  foo1 => 'bar1',
24
27
  foo2 => 'bar2',
25
28
  foo3 => 'bar3',
 
29
  foo4 => 'bar4',
26
30
);
27
31
 
28
 
my $fif = new HTML::FillInForm;
29
 
my $output = $fif->fill(
30
 
  scalarref => \$form,
31
 
  fdat => \%fdat,
 
32
my $output = HTML::FillInForm->fill( \$form, \%fdat,
32
33
  target => 'foo2',
33
34
);
34
35
 
36
37
ok($v[0], 'nada');
37
38
ok($v[1], 'bar2');
38
39
ok($v[2], 'nada');
 
40
ok($v[3], 'nada');
 
41
 
 
42
my $output2 = HTML::FillInForm->fill( \$form, \%fdat,
 
43
  target => 'foo4',
 
44
);
 
45
 
 
46
my @v2 = $output2 =~ m/<input .*?value="(.*?)"/ig;
 
47
ok($v2[0], 'nada');
 
48
ok($v2[1], 'nada');
 
49
ok($v2[2], 'nada');
 
50
ok($v2[3], 'bar4');