summaryrefslogtreecommitdiffstats
path: root/t/expressions.t
diff options
context:
space:
mode:
Diffstat (limited to 't/expressions.t')
-rw-r--r--t/expressions.t34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/expressions.t b/t/expressions.t
new file mode 100644
index 0000000..730196f
--- /dev/null
+++ b/t/expressions.t
@@ -0,0 +1,34 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More;
+
+use Text::Handlebars;
+
+my $tx = Text::Handlebars->new;
+
+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>',
+);
+
+done_testing;