From 5d77f4de9a9be441515412bb103e55cd3cb6112d Mon Sep 17 00:00:00 2001 From: Justin Hileman Date: Thu, 7 Aug 2014 10:38:44 -0700 Subject: [PATCH] Move failing nested partial example into a test case. See #214 --- .../Functional/NestedPartialIndentTest.php | 45 +++++++++++++++++++ .../nested_partials/nested_partials.txt | 3 -- .../partials/fourth_inline.mustache | 1 - .../nested_partials/partials/third.mustache | 3 -- 4 files changed, 45 insertions(+), 7 deletions(-) create mode 100644 test/Mustache/Test/Functional/NestedPartialIndentTest.php delete mode 100644 test/fixtures/examples/nested_partials/partials/fourth_inline.mustache diff --git a/test/Mustache/Test/Functional/NestedPartialIndentTest.php b/test/Mustache/Test/Functional/NestedPartialIndentTest.php new file mode 100644 index 0000000..a484cf5 --- /dev/null +++ b/test/Mustache/Test/Functional/NestedPartialIndentTest.php @@ -0,0 +1,45 @@ + $partials + )); + $tpl = $m->loadTemplate($src); + $this->assertEquals($expected, $tpl->render()); + } + + public function partialsAndStuff() + { + $partials = array( + 'a' => ' {{> b }}', + 'b' => ' {{> d }}', + 'c' => ' {{> d }}{{> d }}', + 'd' => 'D!', + ); + + return array( + array(' {{> a }}', $partials, ' D!'), + array(' {{> b }}', $partials, ' D!'), + array(' {{> c }}', $partials, ' D!D!'), + ); + } +} diff --git a/test/fixtures/examples/nested_partials/nested_partials.txt b/test/fixtures/examples/nested_partials/nested_partials.txt index badd575..62776f9 100644 --- a/test/fixtures/examples/nested_partials/nested_partials.txt +++ b/test/fixtures/examples/nested_partials/nested_partials.txt @@ -3,8 +3,5 @@ FOURTH! - - FOURTH!FOURTH! - \ No newline at end of file diff --git a/test/fixtures/examples/nested_partials/partials/fourth_inline.mustache b/test/fixtures/examples/nested_partials/partials/fourth_inline.mustache deleted file mode 100644 index d796ae0..0000000 --- a/test/fixtures/examples/nested_partials/partials/fourth_inline.mustache +++ /dev/null @@ -1 +0,0 @@ -{{ val }} \ No newline at end of file diff --git a/test/fixtures/examples/nested_partials/partials/third.mustache b/test/fixtures/examples/nested_partials/partials/third.mustache index 30f8fa8..f33301a 100644 --- a/test/fixtures/examples/nested_partials/partials/third.mustache +++ b/test/fixtures/examples/nested_partials/partials/third.mustache @@ -1,6 +1,3 @@ {{> fourth }} - - {{> fourth_inline }}{{> fourth_inline }} -