root/lang/perl/Text-MicroTemplate/trunk/t/03-modes.t @ 26608

Revision 26608, 508 bytes (checked in by kazuho, 6 years ago)

add test

Line 
1use strict;
2use warnings;
3use Test::More tests => 6;
4use Text::MicroTemplate qw(:all);
5
6do {
7    my $s = 'foo<a';
8    is eval as_html('<?= $s ?>'), 'foo&lt;a';
9    is eval as_html('<?=r $s ?>'), 'foo<a';
10    my $rs = raw_string($s);
11    is eval as_html('<?= $rs ?>'), 'foo<a';
12    is eval as_html('<?=r $rs ?>'), 'foo<a';
13};
14
15do {
16    use utf8;
17    my $s = 'い<';
18    is eval as_html('あ<?= $s ?>う'), 'あい&lt;う';
19    my $rs = raw_string($s);
20    is eval as_html('あ<?= $rs ?>う'), 'あい<う';
21}
Note: See TracBrowser for help on using the browser.