aboutsummaryrefslogtreecommitdiffhomepage
path: root/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test')
-rw-r--r--vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test74
1 files changed, 74 insertions, 0 deletions
diff --git a/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test
new file mode 100644
index 00000000..1d2273f8
--- /dev/null
+++ b/vendor/twig/twig/test/Twig/Tests/Fixtures/tags/trim_block.test
@@ -0,0 +1,74 @@
1--TEST--
2Whitespace trimming on tags.
3--TEMPLATE--
4{{ 5 * '{#-'|length }}
5{{ '{{-'|length * 5 + '{%-'|length }}
6
7Trim on control tag:
8{% for i in range(1, 9) -%}
9 {{ i }}
10{%- endfor %}
11
12
13Trim on output tag:
14{% for i in range(1, 9) %}
15 {{- i -}}
16{% endfor %}
17
18
19Trim comments:
20
21{#- Invisible -#}
22
23After the comment.
24
25Trim leading space:
26{% if leading %}
27
28 {{- leading }}
29{% endif %}
30
31{%- if leading %}
32 {{- leading }}
33
34{%- endif %}
35
36
37Trim trailing space:
38{% if trailing -%}
39 {{ trailing -}}
40
41{% endif -%}
42
43Combined:
44
45{%- if both -%}
46<ul>
47 <li> {{- both -}} </li>
48</ul>
49
50{%- endif -%}
51
52end
53--DATA--
54return array('leading' => 'leading space', 'trailing' => 'trailing space', 'both' => 'both')
55--EXPECT--
5615
5718
58
59Trim on control tag:
60123456789
61
62Trim on output tag:
63123456789
64
65Trim comments:After the comment.
66
67Trim leading space:
68leading space
69leading space
70
71Trim trailing space:
72trailing spaceCombined:<ul>
73 <li>both</li>
74</ul>end