File: 09-escape.t

package info (click to toggle)
libtext-microtemplate-perl 0.18-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 272 kB
  • sloc: perl: 1,563; makefile: 2
file content (15 lines) | stat: -rw-r--r-- 264 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use strict;
use warnings;
use Test::More tests => 5;
use Text::MicroTemplate qw(:all);

sub html {
    render_mt('<?= $_[0] ?>', @_)->as_string
}

is html('&'), '&amp;';
is html('>'), '&gt;';
is html('<'), '&lt;';
is html(q{"}), '&quot;';
is html(q{'}), '&#39;';