Spade
Mini Shell
| Directory:~$ /proc/self/root/lib/python2.7/site-packages/jinja2/testsuite/ |
| [Home] [System Details] [Kill Me] |
�
��Rc@s0dZddlZddlmZddlmZmZmZmZm Z ddl
mZmZm
Z
mZddlmZmZmZmZmZe�Zer�d�ZneZdefd ��YZd
efd��YZdefd
��YZdefd��YZdefd��YZd�ZdS(s�
jinja2.testsuite.lexnparse
~~~~~~~~~~~~~~~~~~~~~~~~~~
All the unittests regarding lexing, parsing and syntax.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
i����N(t
JinjaTestCase(tEnvironmenttTemplatetTemplateSyntaxErrortUndefinedErrortnodes(tnextt iteritemst text_typetPY2(tTokentTokenStreamt TOKEN_EOFtTOKEN_BLOCK_BEGINtTOKEN_BLOCK_ENDcCst|�dS(Ni(trepr(tstring((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pytjinja_string_reprstTokenStreamTestCasecBs>eZeded�eded�gZd�Zd�ZRS(iticCs�t|jdd�}|jjtks-t�t|�s?t�t|j�sUt�t|�|jjt kswt�t|�s�t�t|j�s�t�t|�|jjt
ks�t�t|�s�t�t|j�s�t�dS(Ntfootbar(Rttest_tokenstcurrentttypeR
tAssertionErrortboolteosRRR(tselftts((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_simple%s
cCsGgt|jdd�D]}|j^q}|ddgksCt�dS(NRRtblock_begint block_end(RRRR(Rttttoken_types((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt test_iter3s+(t__name__t
__module__R
R
RRRR#(((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyR
s t
LexerTestCasecBsYeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z
RS( cCs+tjd�}|j�dks't�dS(NsH{% raw %}foo{% endraw
%}|{%raw%}{{ bar }}|{% baz %}{% endraw %}sfoo|{{ bar }}|{% baz
%}(tenvtfrom_stringtrenderR(Rttmpl((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt test_raw1:scCs+tjd�}|j�dks't�dS(Ns'1
{%- raw -%} 2 {%- endraw -%}
3t123(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt test_raw2?scCsRtdddd�}|jd�}|jdttd���dksNt�dS( Ns{%s%}s${t}sC{%
for item in seq
%}${{'foo': item}|upper}{% endfor
%}tseqis{'FOO': 0}{'FOO': 1}{'FOO':
2}(RR(R)tlisttrangeR(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_balancingCs cCsRtdddd�}|jd�}|jdttd���dksNt�dS( Ns<!--s-->t{R.sG<ul>
<!--- for item in seq -->
<li>{item}</li>
<!--- endfor -->
</ul>R/is1<ul>
<li>0</li>
<li>1</li>
<li>2</li>
</ul>(RR(R)R0R1R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt
test_commentsIs cCsgx?d D]7}tjdt|��}|j�|kst�qWtjd�j�dksct�dS(
Nuu♨uäu u
u
s{{ %s }}s{{ "\N{HOT SPRINGS}" }}(uu♨uäu u
u
(R'R(RR)R(RtcharR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_string_escapesTs
cCsOddlm}tjd�}|j�|d�d|d�ksKt�dS(Ni����(tpformatu&{{
'foo'|pprint }}|{{ 'bär'|pprint
}}Rt|ubär(tpprintR7R'R(R)R(RR7R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_bytefallbackZscCs{ddlm}xdt|�D]V\}}|dkr;qntjjd|�}t|�|jj|kst �qWdS(Ni����(t operatorss([{}])s{{
%s }}(
tjinja2.lexerR;RR'tlexerttokenizeRRRR(RR;ttesttexpecttstream((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_operators_s
cCs]xVdD]N}td|�}|jd�}|j�}|j|d�dkst�qWdS( Ns
s
s
tnewline_sequences 1
2
3
4
tXt1X2X3X4(s
s
s
(RR(R)treplaceR(RR/R'R*tresult((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_normalizinghs
cCs�x�ttgD]�}td|�}x�difdifdidt6fdidt6fgD]]\}}|j|�}|j||�}|j�}||ks[t||||f��q[Wq
WdS(Ntkeep_trailing_newlineRs
no
newlines
with
newline
swith
newlineswith
several
swith
several
(tTruetFalseRR(tgetR)R(RtkeepR'ttemplatetexpectedR*R@RG((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_trailing_newlineos
(R$R%R+R-R2R4R6R:RBRHRP(((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyR&8s tParserTestCasecBsPeZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z RS(cCsXtdddddd�}|jd�}|jdttd���d ksTt�dS(
Ns<?s?>s<?=s<!--s-->s_<!-- I'm a comment,
I'm not interesting --><? for item in seq -?>
<?= item ?>
<?- endfor
?>R/it01234(RR(R)R0R1R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_php_syntaxs cCsXtdddddd�}|jd�}|jdttd���dksTt�dS( Ns<%s%>s<%=s<%#s]<%#
I'm a comment, I'm not interesting %><% for item in seq
-%>
<%= item %>
<%- endfor
%>R/iRR(RR(R)R0R1R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_erb_syntax�s cCsXtdddddd�}|jd�}|jdttd���d ksTt�dS(
Ns<!--s-->s${R.s<!--#sb<!--# I'm a comment, I'm
not interesting --><!-- for item in seq --->
${item}
<!--- endfor
-->R/iRR(RR(R)R0R1R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_comment_syntax�s cCs+tjd�}|j�dks't�dS(Ns{{{'foo':'bar'}.foo}}R(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyR2�scCs1tjd�}|j�j�dks-t�dS(NsR{#
foo comment
and bar comment #}
{% macro blub() %}foo{% endmacro %}
{{ blub()
}}R(R'R(R)tstripR(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_start_comment�s c Cstddddddd�}|jd�}g|jdttd ���j�D]}t|j��^qRttd ��ks�t�tdddddddd
�}|jd�}g|jdttd ���j�D]}t|j��^q�ttd ��kst�dS(Ns<%s%>s${R.s<%#t%s><%#
regular comment %>
% for item in seq:
${item}
% endforR/is##sW<%# regular comment %>
% for item in seq:
${item} ## the rest of the stuff
%
endfor( RR(R)R0R1tsplittintRVR(RR'R*tx((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_line_syntax�s @! @c Cs�tdddddddd�}|jd �}|jd
ddg�j�d
ksZt�tdddddddd�}|jd�}|jd
ddg�j�dks�t�dS(Ns{%s%}s${R.s/*s*/s##t#sw/* ignore
me.
I'm a multiline comment */
## for item in seq:
* ${item} # this is just extra stuff
## endforR/iis* 1
* 2s�/* ignore me.
I'm a multiline comment */
# for item in seq:
* ${item} ## this is just extra stuff
## extra stuff i just want to ignore
# endfors* 1
*
2(RR(R)RVR(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_line_syntax_priority�s! *! cCs[d�}|dd�|dd�|dd�|dd �|d
d�|dd
�dS(NcSsXyt|�Wn1tk
rA}t|�|ksTtd��nXtsTtd��dS(Nsunexpected error
messages that was supposed to be an
error(RRtstrRRK(tcodeROte((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pytassert_error�s
"s#{% for item in seq %}...{% endif %}s�Encountered unknown
tag 'endif'. Jinja was looking for the following tags:
'endfor' or 'else'. The innermost block that needs to
be closed is 'for'.s<{% if foo %}{% for item in seq %}...{%
endfor %}{% endfor %}s�Encountered unknown tag 'endfor'. Jinja
was looking for the following tags: 'elif' or 'else' or
'endif'. The innermost block that needs to be closed is
'if'.s{% if foo %}s�Unexpected end of template. Jinja was
looking for the following tags: 'elif' or 'else' or
'endif'. The innermost block that needs to be closed is
'if'.s{% for item in seq %}s�Unexpected end of template. Jinja
was looking for the following tags: 'endfor' or 'else'.
The innermost block that needs to be closed is 'for'.s{% block
foo-bar-baz %}spBlock names in Jinja have to be valid Python identifiers
and may not contain hyphens, use an underscore instead.s{% unknown_tag
%}s&Encountered unknown tag
'unknown_tag'.((RRb((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_error_messages�s (
R$R%RSRTRUR2RWR\R^Rc(((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyRQ}s tSyntaxTestCasecBs1eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z
d �Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z
d�Z!d
�Z"RS(!cCsDt�}d�|jd<|jd�}|j�dks@t�dS(NcSs|||||S(N((tatbtcRatg((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt<lambda>�sRs2{{
foo('a', c='d', e='f', *['b'],
**{'g': 'h'})
}}tabdfh(RtglobalsR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt test_call�s cCs+tjd�}|j�dks't�dS(Ns({{
[1, 2, 3][:] }}|{{ [1, 2, 3][::-1] }}s[1, 2, 3]|[3, 2,
1](R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_slicing�scCs8tjd�}|jdidd6�dks4t�dS(Ns{{
foo.bar }}|{{ foo['bar']
}}Ri*Rs42|42(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt test_attr�scCs:tjd�}|jddddg�dks6t�dS(Ns{{
foo[0] }}|{{ foo[-1]
}}Riiis0|2(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_subscript�scCs+tjd�}|j�dks't�dS(Ns
{{ () }}|{{ (1,) }}|{{ (1, 2) }}s()|(1,)|(1,
2)(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt
test_tuplescCs+tjd�}|j�dks't�dS(Ns${{ (1 + 1
* 2) - 3 / 2 }}|{{ 2**3
}}s1.5|8(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt test_mathscCs+tjd�}|j�dks't�dS(Ns${{
3 // 2 }}|{{ 3 / 2 }}|{{ 3 % 2
}}s1|1.5|1(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_divscCs+tjd�}|j�dks't�dS(Ns{{
+3 }}|{{ -3
}}s3|-3(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt
test_unaryscCs+tjd�}|j�dks't�dS(Ns{{ [1, 2]
~ 'foo' }}s [1,
2]foo(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_concatscCs+tjd�}|j�dks't�dS(Ns>{{
1 > 0 }}|{{ 1 >= 1 }}|{{ 2 < 3 }}|{{ 2 == 2 }}|{{ 1 <= 1
}}sTrue|True|True|True|True(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_comparescCs+tjd�}|j�dks't�dS(Ns-{{
1 in [1, 2, 3] }}|{{ 1 not in [1, 2, 3] }}s
True|False(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt test_inopscCs1tjd�}|j�j�dks-t�dS(Ns{{
[] }}|{{ {} }}|{{ ()
}}s[]|{}|()(R'R(R)tlowerR(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt
test_literalsscCs+tjd�}|j�dks't�dS(Ns8{{
true and false }}|{{ false or true }}|{{ not false
}}sFalse|True|True(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt test_bool!scCs+tjd�}|j�dks't�dS(Ns8{{
(true and false) or (false and true) and not false
}}RK(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt
test_grouping&scCs+tjd�}|j�dks't�dS(Ns!{{
[1, 2, 3].0 }}|{{ [[1]].0.0
}}s1|1(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_django_attr*scCs+tjd�}|j�dks't�dS(Ns{{
0 if true else 1
}}t0(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_conditional_expression.scCsMtjd�}|j�dks't�tjd�}|jt|j�dS(Ns<{{
1 if false }}>s<>s<{{ (1 if false).bar
}}>(R'R(R)Rt
assert_raisesR(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt!test_short_conditional_expression2scCs+tjd�}|j�dks't�dS(Ns{{
"foo"|upper + "bar"|upper
}}tFOOBAR(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_filter_priority9scCs�tdftdftdftdftdftdftdftdftd ftd
fg
}xH|D]@\}}|r�|jttjd|�qgtjd|�qgWdS(
Ns *foo,
bars
*foo, *bars*foo, bar=42s**foo, *bars
**foo, barsfoo, barsfoo, bar=42sfoo, bar=23, *argssa, b=c, *d,
**es*foo, **bars
{{ foo(%s)
}}sfoo(%s)(RJRKR~RR'R((Rtteststshould_failtsig((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_function_calls=s cCsBx;ddddddddgD]}tj|�st�qWdS( Ns{{
() }}s{{ (1, 2) }}s
{{ (1, 2,) }}s{{ 1, }}s
{{ 1, 2 }}s({% for foo, bar in seq %}...{% endfor %}s&{% for x in foo,
bar %}...{% endfor %}s"{% for x in foo, %}...{% endfor
%}(R'R(R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_tuple_exprQs
cCs1tjd�}|j�j�dks-t�dS(Ns){{
(1, 2,) }}|{{ [1, 2,] }}|{{ {1: 2,} }}s(1, 2)|[1, 2]|{1:
2}(R'R(R)RwR(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_trailing_comma^scCs'tjd�|jttjd�dS(Ns${%
block foo %}...{% endblock foo %}s{% block x %}{% endblock y
%}(R'R(R~R(R((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_block_end_namebs
cCszxsttdfD]b}tjdt|�t|�j�t|�j�f�}|j�d||fkst �qWdS(Ns{{
%s }}|{{ %s }}|{{ %s }}s%s|%s|(
RJRKtNoneR'R(R_RwtupperR)R(RtconstR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_constant_casinggs 1cCs;|jttjd�tjd�j�dks7t�dS(Ns{{
foo is string is sequence }}s"{{ 42 is string or 42 is number
}}RJ(R~RR'R(R)R(R((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_test_chainingnscCs+tjd�}|j�dks't�dS(Ns{{
"foo" "bar" "baz"
}}t foobarbaz(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_string_concatenationtscCsItd�}tjd�}|jd|�td|k�ksEt�dS(Nids{{
not 42 in bar
}}Ri*(R1R'R(R)RR(RRR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt
test_notinxscCsJdtfd��Y}tjd�}|jd|��dksFt�dS(NtFoocBseZd�ZRS(cSs|S(N((RR[((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt__getitem__s(R$R%R�(((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyR�~ss{{
foo[1, 2] }}Ru(1,
2)(tobjectR'R(R)R(RR�R!((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_implicit_subscribed_tuple}scCs+tjd�}|j�dks't�dS(Ns,{%
raw %}{{ FOO }} and {% BAR %}{% endraw %}s{{ FOO }} and {% BAR
%}(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyR-�scCs+tjd�}|j�dks't�dS(NsP{{
true }}|{{ false }}|{{ none }}|{{ none is defined }}|{{ missing is defined
}}sTrue|False|None|True|False(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt
test_const�scCsbtjd�}t|jdjdtj�s5t�t|jdjdjtj�s^t�dS(Ns{{
-1|foo }}i( R'tparset
isinstancetbodyRtFilterRtnodetNeg(RR�((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_neg_filter_priority�s&cCs=d}d}x*||fD]}|jttj|�qWdS(Ns{%
set true = 42 %}s!{% for none in seq %}{% endfor
%}(R~RR'R((Rt constass1t constass2R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_const_assign�scCs+tjd�}|j�dks't�dS(NsO{%
set foo = 0 %}{% for item in [1, 2] %}{% set foo = 1 %}{% endfor %}{{ foo
}}R|(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt
test_localset�s cCsltjd�}|jdidd6�dks4t�tjd�}|jdidd6�dksht�dS(Ns{{
-foo["bar"] }}Ri*Rs-42s{{ -foo["bar"]|abs
}}t42(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_parse_unary�s%(#R$R%RlRmRnRoRpRqRrRsRtRuRvRxRyRzR{R}RR�R�R�R�R�R�R�R�R�R�R-R�R�R�R�R�(((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyRd�sB
tLstripBlocksTestCasecBs�eZd�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z
d �Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(cCs@tdtdt�}|jd�}|j�dks<t�dS(Nt
lstrip_blocksttrim_blockss!
{% if True %}
{% endif %}s
(RRJRKR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_lstrip�scCs@tdtdt�}|jd�}|j�dks<t�dS(NR�R�s!
{% if True %}
{% endif
%}R(RRJR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_lstrip_trim�scCs@tdtdt�}|jd�}|j�dks<t�dS(NR�R�s#
{%+ if True %}
{%+ endif %}s
(RRJRKR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_no_lstrip�scCs@tdtdt�}|jd�}|j�dks<t�dS(NR�R�s-
hello{% if True %}
goodbye{% endif %}s hello
goodbye(RRJRKR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_lstrip_endline�scCs@tdtdt�}|jd�}|j�dks<t�dS(NR�R�s%
{% if True %}hello {% endif %}s hello
(RRJRKR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_lstrip_inline�scCs@tdtdt�}|jd�}|j�dks<t�dS(NR�R�s:
{% if True %}a {% if True %}b {% endif %}c {% endif %}sa b c
(RRJRKR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_lstrip_nested�scCs@tdtdt�}|jd�}|j�dks<t�dS(NR�R�s.
abc {% if True %}
hello{% endif %}s abc
hello(RRJRKR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_lstrip_left_chars�s cCs@tdtdt�}|jd�}|j�dks<t�dS(NR�R�s&
{% set x = " {% str %} " %}{{ x }}s {% str %}
(RRJRKR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_lstrip_embeded_strings�scCs@tdtdt�}|jd�}|j�dks<t�dS(NR�R�s
{% set hello = 1 %}s
(RRJRKR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt%test_lstrip_preserve_leading_newlines�scCs@tdtdt�}|jd�}|j�dks<t�dS(NR�R�s%
{# if True #}
hello
{#endif#}s
hello
(RRJRKR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_lstrip_comment�s c
CsXtdddddddddtd t�}|jd
�}|j�dksTt�dS(Ns<%s%>s${R.s<%#RXs##R�R�s%
<% if True %>hello <% endif %>s hello
(RRJR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt
test_lstrip_angle_bracket_simple�sc
CsXtdddddddddtd t�}|jd
�}|j�dksTt�dS(Ns<%s%>s${R.s<%#RXs##R�R�s'
<%# if True %>hello <%# endif %>s hello
(RRJR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt!test_lstrip_angle_bracket_comment�sc
Cs}tdddddddddtd t�}|jd
�}|jdtd��d
jd�td�D��ksyt�dS(Ns<%s%>s${R.s<%#RXs##R�R�se
<%# regular comment %>
<% for item in seq %>
${item} ## the rest of the stuff
<% endfor %>R/iRcss|]}d|VqdS(s%s
N((t.0R[((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pys <genexpr>�s(RRJR(R)R1tjoinR(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_lstrip_angle_bracket�s c
Cs}tdddddddddtd t�}|jd
�}|jdtd��d
jd�td�D��ksyt�dS(Ns<%s%>s${R.s<%#RXs##R�R�s_
<%#regular comment%>
<%for item in seq%>
${item} ## the rest of the stuff
<%endfor%>R/iRcss|]}d|VqdS(s%s
N((R�R[((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pys <genexpr>�s(RRJR(R)R1R�R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt!test_lstrip_angle_bracket_compact�s cCs^tdddddddtdt�}|jd�}|jd td
��dksZt�dS(Ns<?s?>s<?=s<!--s-->R�R�sp
<!-- I'm a comment, I'm not interesting -->
<? for item in seq -?>
<?= item ?>
<?- endfor
?>R/iRR(RRJR(R)R1R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_php_syntax_with_manual�s
cCswtdddddddtdt�}|jd�}|jd td
��djd�td
�D��ksst�dS(
Ns<?s?>s<?=s<!--s-->R�R�sn
<!-- I'm a comment, I'm not interesting -->
<? for item in seq ?>
<?= item ?>
<? endfor ?>R/iRcss|]}d|VqdS(s %s
N((R�R[((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pys <genexpr>s(RRJR(R)R1R�R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyRSs
cCswtdddddddtdt�}|jd�}|jd td
��djd�td
�D��ksst�dS(
Ns<?s?>s<?=s<!--s-->R�R�sh
<!-- I'm a comment, I'm not interesting -->
<?for item in seq?>
<?=item?>
<?endfor?>R/iRcss|]}d|VqdS(s %s
N((R�R[((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pys <genexpr>s(RRJR(R)R1R�R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_php_syntax_compacts
cCswtdddddddtdt�}|jd�}|jdtd ��d
jd�td �D��ksst�dS(Ns<%s%>s<%=s<%#R�R�se<%#
I'm a comment, I'm not interesting %>
<% for item in seq %>
<%= item %>
<% endfor %>
R/iRcss|]}d|VqdS(s %s
N((R�R[((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pys <genexpr>*s(RRJR(R)R1R�R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyRTs
cCs^tdddddddtdt�}|jd�}|jdtd ��d
ksZt�dS(Ns<%s%>s<%=s<%#R�R�sj<%# I'm a
comment, I'm not interesting %>
<% for item in seq -%>
<%= item %>
<%- endfor
%>R/iRR(RRJR(R)R1R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_erb_syntax_with_manual,s
cCs^tdddddddtdt�}|jd�}|jdtd ��d
ksZt�dS(Ns<%s%>s<%=s<%#R�R�sk<%# I'm a
comment, I'm not interesting %>
<%+ for item in seq -%>
<%= item %>
<%- endfor %>R/is
01234(RRJR(R)R1R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_erb_syntax_no_lstrip6s
cCs^tdddddddtdt�}|jd�}|jd td
��dksZt�dS(Ns<!--s-->s${R.s<!--#R�R�sb<!--#
I'm a comment, I'm not interesting --><!-- for item in seq
--->
${item}
<!--- endfor
-->R/iRR(RRJR(R)R1R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyRU@s
(R$R%R�R�R�R�R�R�R�R�R�R�R�R�R�R�R�RSR�RTR�R�RU(((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyR��s*
cCs~tj�}|jtjt��|jtjt��|jtjt��|jtjt��|jtjt��|S(N( tunittestt TestSuitetaddTestt makeSuiteRR&RQRdR�(tsuite((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyR�Js(t__doc__R�tjinja2.testsuiteRtjinja2RRRRRtjinja2._compatRRRR R<R
RRR
RR'RRRR&RQRdR�R�(((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt<module>
s("( Eo��