1use strict;
2use warnings;
3#use Test::More tests => 4;
4use Test::More skip_all => 'not implemented yet';
5
6use_ok('HTML::Template');
7
8# normal loop with values
9my $tmpl_string = 'Hello<tmpl_comment> enemy</tmpl_comment> friend';
10my $template = HTML::Template->new_scalar_ref( \$tmpl_string );
11$template->param( name => 'Fred');
12my $output = $template->output;
13is($output, 'Hello friend', 'simple comment');
14
15# comment with a var next to it
16$tmpl_string = 'Hello<tmpl_comment> enemy</tmpl_comment> friend <tmpl_var name>';
17$template = HTML::Template->new_scalar_ref( \$tmpl_string );
18$template->param( name => 'Fred');
19$output = $template->output;
20is($output, 'Hello friend Fred', 'comment with var');
21
22# comment with a var in it
23$tmpl_string = 'Hello<tmpl_comment><tmpl_var name></tmpl_comment> friend';
24$template = HTML::Template->new_scalar_ref( \$tmpl_string );
25$template->param( name => 'Fred');
26$output = $template->output;
27is($output, 'Hello friend', 'comment hiding var');
28