summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
Diffstat (limited to 't')
-rw-r--r--t/002-expressions.t30
1 files changed, 30 insertions, 0 deletions
diff --git a/t/002-expressions.t b/t/002-expressions.t
new file mode 100644
index 0000000..433a7fc
--- /dev/null
+++ b/t/002-expressions.t
@@ -0,0 +1,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>',
+);