diff options
author | Oleg Pudeyev <oleg@bsdpower.com> | 2011-04-25 13:03:55 -0400 |
---|---|---|
committer | Oleg Pudeyev <oleg@bsdpower.com> | 2011-04-25 23:19:25 -0400 |
commit | f97411b91143a0c75ef0ecec3ff03fc36a879728 (patch) | |
tree | 65c2bcbe1947dfe78e34e3cc2ae280d837ab06f0 /tests/template | |
parent | 8d5e468eb47f35287214ed4a12722d5add5f37ba (diff) | |
download | forums-f97411b91143a0c75ef0ecec3ff03fc36a879728.tar forums-f97411b91143a0c75ef0ecec3ff03fc36a879728.tar.gz forums-f97411b91143a0c75ef0ecec3ff03fc36a879728.tar.bz2 forums-f97411b91143a0c75ef0ecec3ff03fc36a879728.tar.xz forums-f97411b91143a0c75ef0ecec3ff03fc36a879728.zip |
[feature/template-engine] Corrected miscompilation of loop size constructs.
PHPBB3-9726
Diffstat (limited to 'tests/template')
-rw-r--r-- | tests/template/template_test.php | 7 | ||||
-rw-r--r-- | tests/template/templates/loop_size.html | 39 |
2 files changed, 46 insertions, 0 deletions
diff --git a/tests/template/template_test.php b/tests/template/template_test.php index 5c43fe656e..5a21d2f69c 100644 --- a/tests/template/template_test.php +++ b/tests/template/template_test.php @@ -288,6 +288,13 @@ class phpbb_template_template_test extends phpbb_test_case // I don't completely understand this output, hopefully it's correct "top-level content\nouter\n\ninner z\nfirst row\n\ninner zz", ), + array( + 'loop_size.html', + array(), + array('loop' => array(array()), 'empty_loop' => array()), + array(), + "nonexistent = 0\n! nonexistent\n\nempty = 0\n! empty\nloop\n\nin loop", + ), ); } diff --git a/tests/template/templates/loop_size.html b/tests/template/templates/loop_size.html new file mode 100644 index 0000000000..f1938441df --- /dev/null +++ b/tests/template/templates/loop_size.html @@ -0,0 +1,39 @@ +<!-- IF .nonexistent_loop --> + nonexistent +<!-- ENDIF --> + +<!-- IF .nonexistent_loop == 0 --> + nonexistent = 0 +<!-- ENDIF --> + +<!-- IF ! .nonexistent_loop --> + ! nonexistent +<!-- ENDIF --> + +<!-- IF .empty_loop --> + empty +<!-- ENDIF --> + +<!-- IF .empty_loop == 0 --> + empty = 0 +<!-- ENDIF --> + +<!-- IF ! .empty_loop --> + ! empty +<!-- ENDIF --> + +<!-- IF .loop --> + loop +<!-- ENDIF --> + +<!-- IF .loop == 0 --> + loop = 0 +<!-- ENDIF --> + +<!-- IF ! .loop --> + ! loop +<!-- ENDIF --> + +<!-- BEGIN loop --> + in loop +<!-- END --> |