1use warnings;
2use strict;
3use lib 't';
4use Test::More tests => 3;
5use_ok('HTML::Template::Compiled');
6use HTC_Utils qw($cache $tdir &cdir);
7
8{
9    my $htc = HTML::Template::Compiled->new(
10        scalarref => \<<'EOM',
11<tmpl_var foo POST_CHOMP=3 >
12<tmpl_var  foo >
13<!--tmpl_var foo PRE_CHOMP=3 -->
14<%var foo PRE_CHOMP=3 POST_CHOMP=3 %>
15EOM
16        tagstyle => [qw(+classic +asp +comment )],
17        debug => 0,
18    );
19    $htc->param(foo => 23);
20    my $out = $htc->output;
21    #print "out: $out\n";
22    cmp_ok($out, 'eq', '23232323', "chomp");
23}
24
25{
26    my $htc = HTML::Template::Compiled->new(
27        scalarref => \<<'EOM',
28<%loop foo %>
29* <%= _ %>
30<%/loop PRE_CHOMP=3 POST_CHOMP=3 %>
31EOM
32        tagstyle => [qw(+asp)],
33        debug => 0,
34    );
35    my $exp = <<'EOM';
36
37* 2
38* 3
39* 4
40EOM
41    $htc->param(foo => [2..4]);
42    chomp($exp);
43    my $out = $htc->output;
44    #print "out: $out\n";
45    cmp_ok($out, 'eq', $exp, "chomp loop");
46}
47
48
49