File: 04-default-escape.t

package info (click to toggle)
libhtml-template-perl 2.97-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 740 kB
  • sloc: perl: 2,572; makefile: 8
file content (22 lines) | stat: -rw-r--r-- 491 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
use strict;
use Test::More;
use HTML::Template;

{
    my $t = HTML::Template->new(
        scalarref      => \'<tmpl_var foo>',
        default_escape => 'html',
    );
    $t->param( foo => '<' );
    is( $t->output, '&lt;', "test default_escape => 'html'");
}
{
    my $t = HTML::Template->new(
        scalarref      => \'<tmpl_var foo>',
        default_escape => 'none',
    );
    $t->param( foo => '<' );
    is( $t->output, '<', "test default_escape => 'none'");
}

done_testing();