blob: 433a7fc5fe06979066bef012c64165ecf1710501 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
use strict;
use warnings;
use Test::More;
use Text::Xslate;
my $tx = Text::Xslate->new(syntax => 'Handlebars');
is(
$tx->render_string(
'<h1>{{title}}</h1>',
{ title => 'Xslate rocks' },
),
'<h1>Xslate rocks</h1>',
);
is(
$tx->render_string(
'<h1>{{article.title}}</h1>',
{ article => { title => 'Hash references rock' } },
),
'<h1>Hash references rock</h1>',
);
is(
$tx->render_string(
'<h1>{{article/title}}</h1>',
{ article => { title => 'Deprecated syntax does not' } },
),
'<h1>Deprecated syntax does not</h1>',
);
|