Skip to content

Commit

Permalink
test: multi-line template tags, bcosca/fatfree#1285
Browse files Browse the repository at this point in the history
  • Loading branch information
ikkez committed Sep 22, 2024
1 parent 1b85790 commit ca2da30
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/template.php
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,10 @@ function get($f3) {
trim($tpl->render('templates/test5.3.htm')) === '10',
'test unmatching tag cases'
);
$test->expect(
($x=preg_replace('/(\s)*/', '', trim($tpl->render('templates/test5.4.htm')))) === '1010',
'test multiline tags'. $x
);
$f3->clear('cond1');
$f3->set('test',['string'=>'thin','int'=>123,'bool'=>FALSE]);
$test->expect(
Expand Down
20 changes: 20 additions & 0 deletions ui/templates/test5.4.htm
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<check
if='{{ @cond1 }}'>
1
</check>
<check
if='{{ !@cond1 }}'>
<true>1</true>
<false>0</false>
</check>
<check if='{{ @cond1 }}'
>
<true>1</true>
<false>0</false>
</check>
<check
if='{{ !@cond1 }}'
>
<true>1</true>
<false>0</false>
</check>

0 comments on commit ca2da30

Please sign in to comment.