From 53a90010afb0d4bb13d30c6756466ba366e16c9b Mon Sep 17 00:00:00 2001 From: Marian Schubert Date: Sat, 18 May 2013 22:08:51 +0200 Subject: [PATCH] Add failing test for dotted access inside section Fails (prints nothing): {{#photos}} {{thumb.src}} {{/photos}} Works (prints photo's thumb's src): {{#photos}} {{#thumb}}{{src}}{{/thumb}} {{/photos}} First example should work same as second one, but it fails. --- test/clostache/test_parser.clj | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/clostache/test_parser.clj b/test/clostache/test_parser.clj index 8fcdca5..ee5dc61 100644 --- a/test/clostache/test_parser.clj +++ b/test/clostache/test_parser.clj @@ -107,6 +107,10 @@ (is (= "Hello, Felix" (render "Hello, {{felix.name}}" {:felix {:name "Felix"}})))) +(deftest test-render-tag-with-dotted-name-like-section--inside-another-section + (is (= "photo thumb" (render "{{#photos}}{{src}} {{thumb.src}}{{/photos}}" + {:photos [{:src "photo" :thumb {:src "thumb"}}]})))) + (deftest test-render-lambda (is (= "Hello, Felix" (render "Hello, {{name}}" {:name (fn [] "Felix")}))))