summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorShawn M Moore <code@sartak.org>2012-09-25 17:03:40 -0400
committerShawn M Moore <code@sartak.org>2012-09-25 17:03:40 -0400
commitebb77424883ed8fc76f82d3287f990c575edc05b (patch)
tree21ff012bc225f636b11bc3819dcd7a5c326a17d2 /t
parent2c0aa1266c1cb2a889baaa74bf423abfc8728c28 (diff)
downloadtext-handlebars-ebb77424883ed8fc76f82d3287f990c575edc05b.tar.gz
text-handlebars-ebb77424883ed8fc76f82d3287f990c575edc05b.zip
Start porting http://handlebarsjs.com/expressions.html
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>',
+);