diff --git a/tests/UnitTests/TemplateSource/_Issues/422/NestedLoopIssue422Test.php b/tests/UnitTests/TemplateSource/_Issues/422/NestedLoopIssue422Test.php new file mode 100644 index 00000000..c541b3cb --- /dev/null +++ b/tests/UnitTests/TemplateSource/_Issues/422/NestedLoopIssue422Test.php @@ -0,0 +1,35 @@ +setUpSmarty(dirname(__FILE__)); + } + + public function testInit() + { + $this->cleanDirs(); + } + + public function testnested422() + { + $this->assertEquals('loop: 1inner: 0loop: 2inner: 1', $this->smarty->fetch('422_test.tpl')); + } + +} diff --git a/tests/UnitTests/TemplateSource/_Issues/422/cache/dummy.txt b/tests/UnitTests/TemplateSource/_Issues/422/cache/dummy.txt new file mode 100644 index 00000000..2995a4d0 --- /dev/null +++ b/tests/UnitTests/TemplateSource/_Issues/422/cache/dummy.txt @@ -0,0 +1 @@ +dummy \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/_Issues/422/templates/422_test.tpl b/tests/UnitTests/TemplateSource/_Issues/422/templates/422_test.tpl new file mode 100644 index 00000000..09fb9d41 --- /dev/null +++ b/tests/UnitTests/TemplateSource/_Issues/422/templates/422_test.tpl @@ -0,0 +1,8 @@ +{strip} +{assign var=samplearr value=[["list" => []],["list" => ["item"]]]} +{foreach $samplearr as $v} + {section name=inner loop=$v.list} + {/section} + loop: {$v@iteration} + inner: {$smarty.section.inner.total} +{/foreach} \ No newline at end of file diff --git a/tests/UnitTests/TemplateSource/_Issues/422/templates_c/dummy.txt b/tests/UnitTests/TemplateSource/_Issues/422/templates_c/dummy.txt new file mode 100644 index 00000000..2995a4d0 --- /dev/null +++ b/tests/UnitTests/TemplateSource/_Issues/422/templates_c/dummy.txt @@ -0,0 +1 @@ +dummy \ No newline at end of file