summaryrefslogtreecommitdiffstats
path: root/t/expressions.t
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2012-10-02 16:22:46 -0500
committerJesse Luehrs <doy@tozt.net>2012-10-02 16:22:46 -0500
commitfa8c5a1f9e8dd17424bc28d01bfe661dde50ddd7 (patch)
tree497be368923725bf07e931f023f74fb7b276cec7 /t/expressions.t
parentf8163f38482ebe4a48b08a3f49080821e62e383b (diff)
downloadtext-handlebars-fa8c5a1f9e8dd17424bc28d01bfe661dde50ddd7.tar.gz
text-handlebars-fa8c5a1f9e8dd17424bc28d01bfe661dde50ddd7.zip
more tests
Diffstat (limited to 't/expressions.t')
-rw-r--r--t/expressions.t37
1 files changed, 37 insertions, 0 deletions
diff --git a/t/expressions.t b/t/expressions.t
index 0a3ebf3..02b1b3a 100644
--- a/t/expressions.t
+++ b/t/expressions.t
@@ -26,4 +26,41 @@ render_ok(
"/ separator"
);
+{ local $TODO = "unimplemented";
+render_ok(
+ '{{#article}}<h1>{{title}}</h1> - {{../date}}{{/article}}',
+ { article => { title => 'Backtracking' }, date => '2012-10-01' },
+ '<h1>Backtracking</h1> - 2012-10-01',
+ "backtracking with ../"
+);
+
+render_ok(
+ <<'TEMPLATE',
+{{#page}}
+{{#article}}<h1>{{title}}</h1> - {{../../date}}{{/article}}
+{{/page}}
+TEMPLATE
+ {
+ page => {
+ article => { title => 'Multilevel Backtracking' },
+ },
+ date => '2012-10-01',
+ },
+ <<'RENDERED',
+<h1>Multilevel Backtracking</h1> - 2012-10-01
+RENDERED
+ "multilevel backtracking with ../"
+);
+
+render_ok(
+ '{{#article}}<h1>{{title}}</h1> - {{../metadata.date}}{{/article}}',
+ {
+ article => { title => 'Backtracking' },
+ metadata => { date => '2012-10-01' },
+ },
+ '<h1>Backtracking</h1> - 2012-10-01',
+ "backtracking into other hash variables with ../ and ."
+);
+}
+
done_testing;