From 408ff8d3451fe485b31de070f987c7e8658e0b51 Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Sun, 21 Jul 2013 00:48:18 -0700 Subject: [PATCH] Add a failing test for #128 --- .../Functional/PartialLambdaIndentTest.php | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 test/Mustache/Test/Functional/PartialLambdaIndentTest.php diff --git a/test/Mustache/Test/Functional/PartialLambdaIndentTest.php b/test/Mustache/Test/Functional/PartialLambdaIndentTest.php new file mode 100644 index 0000000..190c194 --- /dev/null +++ b/test/Mustache/Test/Functional/PartialLambdaIndentTest.php @@ -0,0 +1,59 @@ + + {{> input }} + + +EOS; + $partial = << + +EOS; + + $expected = << + + + +EOS; + + $m = new Mustache_Engine(array( + 'partials' => array('input' => $partial) + )); + + $tpl = $m->loadTemplate($src); + + + $data = new Mustache_Test_Functional_ClassWithLambda(); + $this->assertEquals($expected, $tpl->render($data)); + } +} + +class Mustache_Test_Functional_ClassWithLambda +{ + public function _t() + { + return function($val) { + return strtoupper($val); + }; + } +}