root/Template-Plugin-FillInForm/trunk/t/01_fillin.t

Revision 605 (checked in by miyagawa, 17 years ago)

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 use strict;
2 use CGI;
3 use Template::Test;
4
5 my $query = CGI->new({ foo => 'bar', bar => 'baz' });
6 test_expect(\*DATA, undef, { query => $query });
7
8 __END__
9 --test--
10 [% USE FillInForm -%]
11 [% FILTER fillinform fobject => query -%]
12 <form action="foo" method="POST"><input name="foo" type="text"></form>
13 [%- END %]
14 --expect--
15 <form action="foo" method="POST"><input name="foo" type="text" value="bar"></form>
16
17 --test--
18 [% USE FillInForm -%]
19 [% FILTER fillinform fdat => { foo => 'foo&' } -%]
20 <form action="foo" method="POST"><input name="foo" type="text"></form>
21 [%- END %]
22 --expect--
23 <form action="foo" method="POST"><input name="foo" type="text" value="foo&amp;"></form>
Note: See TracBrowser for help on using the browser.