Skip to content

Commit

Permalink
Add some more block tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scottchiefbaker committed May 23, 2022
1 parent 1836ba2 commit 51f4bf2
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions unit_tests/tests.php
Original file line number Diff line number Diff line change
Expand Up @@ -122,10 +122,13 @@
sluz_test('{include \'extra.stpl\'}' , '/e1ab49cf/' , 'Include #2 - \'extra.stpl\'');
sluz_test('{include}' , 'ERROR-73467', 'Include #3 - No payload');

sluz_test(['{$a}{$b}{$c}'] , 3, 'Get blocks #1 - Basic variables');
sluz_test(['{if $a}{$a}{/if}'] , 1, 'Get blocks #2 - Basic variables');
sluz_test(['Jason{$a}Baker{$b}'] , 4, 'Get blocks #3 - Basic variables');
sluz_test(['function(foo) { $i = 10; }'], 1, 'Get blocks #4 - javascript function');
sluz_test(['{$a}{$b}{$c}'] , 3, 'Get blocks #1 - Basic variables');
sluz_test(['{if $a}{$a}{/if}'] , 1, 'Get blocks #2 - Basic variables');
sluz_test(['Jason{$a}Baker{$b}'] , 4, 'Get blocks #3 - Basic variables');
sluz_test(['function(foo) { $i = 10; }'] , 1, 'Get blocks #4 - javascript function');
sluz_test(['{* Comment *}ABC{* Comment *}'] , 3, 'Get blocks #5 - Comments');
sluz_test([' {$x} '] , 3, 'Get blocks #6 - Whitespace around variable');
sluz_test(['{foreach $arr as $i => $x}{if $x.1}{$x.1}{/if}{/foreach}'], 1, 'Get blocks #7 - Lots of brackets');

$total = $pass_count + $fail_count;

Expand Down

0 comments on commit 51f4bf2

Please sign in to comment.