summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-02 17:33:57 -0500
committerJesse Luehrs <doy@tozt.net>2012-10-02 17:33:57 -0500
commitf5a6d16466fd528171002a137440e9d99eb9129a (patch)
tree5c19fc0674a2f2a0a4cfec7641f9da7f1a87d6cf /t
parent5f753f44ba7f37c744f46f8c0334c70a05f8281b (diff)
downloadtext-handlebars-f5a6d16466fd528171002a137440e9d99eb9129a.tar.gz
text-handlebars-f5a6d16466fd528171002a137440e9d99eb9129a.zip
implement ../
Diffstat (limited to 't')
-rw-r--r--t/expressions.t16
1 files changed, 14 insertions, 2 deletions
diff --git a/t/expressions.t b/t/expressions.t
index 02b1b3a..c2e928c 100644
--- a/t/expressions.t
+++ b/t/expressions.t
@@ -26,7 +26,18 @@ render_ok(
"/ separator"
);
-{ local $TODO = "unimplemented";
+render_ok(
+ '<h1>{{page.article.title}}</h1> - {{date}}',
+ {
+ page => {
+ article => { title => 'Multilevel field access' },
+ },
+ date => '2012-10-01',
+ },
+ '<h1>Multilevel field access</h1> - 2012-10-01',
+ "multilevel field access with ."
+);
+
render_ok(
'{{#article}}<h1>{{title}}</h1> - {{../date}}{{/article}}',
{ article => { title => 'Backtracking' }, date => '2012-10-01' },
@@ -34,6 +45,7 @@ render_ok(
"backtracking with ../"
);
+{ local $TODO = "autochomping issues";
render_ok(
<<'TEMPLATE',
{{#page}}
@@ -51,6 +63,7 @@ TEMPLATE
RENDERED
"multilevel backtracking with ../"
);
+}
render_ok(
'{{#article}}<h1>{{title}}</h1> - {{../metadata.date}}{{/article}}',
@@ -61,6 +74,5 @@ render_ok(
'<h1>Backtracking</h1> - 2012-10-01',
"backtracking into other hash variables with ../ and ."
);
-}
done_testing;