8889841có ÈÏRc@s0dZddlZddlmZddlmZmZmZmZm Z ddl m Z m Z m Z mZddlmZmZmZmZmZeƒZer¯d„ZneZdefd „ƒYZd efd „ƒYZd efd „ƒ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(t EnvironmenttTemplatetTemplateSyntaxErrortUndefinedErrortnodes(tnextt iteritemst text_typetPY2(tTokent TokenStreamt 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( R t test_tokenstcurrentttypeR tAssertionErrortboolteosRRR (tselftts((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt test_simple%s  cCsGgt|jddƒD]}|j^q}|ddgksCt‚dS(NRRt block_begint block_end(R RRR(Rttt token_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 %}(tenvt from_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( Nst{R.sGR/is1(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 }}( t jinja2.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 s with 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( Nsss_ 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( Nss${R.s ${item} 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 d d gƒjƒd ksZt‚tddddddddƒ}|jdƒ}|jd d d gƒ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 ƒ|d d ƒ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.pyt assert_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 %}sEncountered 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 %}sUnexpected 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 „Z d „Z d „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ð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.pyt test_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_unary scCs+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.pyt test_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.pyt test_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_priority9sc Cs¯tdftdftdftdftdftdftdftdftd ftd fg }xH|D]@\}}|r–|jttjd |ƒqgtjd |ƒqgWdS( Ns *foo, bars *foo, *bars *foo, bar=42s **foo, *bars **foo, barsfoo, bars foo, bar=42sfoo, bar=23, *argssa, b=c, *d, **es *foo, **bars {{ foo(%s) }}sfoo(%s)(RJRKR~RR'R((Rttestst should_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_notinxs cCsJdtfd„ƒ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_prioritys&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}RRR…R†R‡RˆRŒRRRR”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 „Z d „Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cCs@tdtdtƒ}|jdƒ}|jƒdks<t‚dS(Nt lstrip_blockst trim_blockss! {% if True %} {% endif %}s (RRJRKR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt test_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ƒd ksTt‚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ƒd ksTt‚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 ƒ}|jd td ƒƒ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 ñ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 ƒ}|jd td ƒƒ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 üs(RRJR(R)R1R³R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt!test_lstrip_angle_bracket_compactós  c Cs^tdddddddtdtƒ}|jdƒ}|jd td ƒƒd ksZt‚dS( NssR¤R¥sp R/iRR(RRJR(R)R1R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_php_syntax_with_manualþs  c Cswtdddddddtdtƒ}|jdƒ}|jd td ƒƒd jd „td ƒDƒƒksst‚dS( NssR¤R¥sn R/iRcss|]}d|VqdS(s %s N((R²R[((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pys s(RRJR(R)R1R³R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyRSs  c Cswtdddddddtdtƒ}|jdƒ}|jd td ƒƒd jd „td ƒDƒƒksst‚dS( NssR¤R¥sh R/iRcss|]}d|VqdS(s %s N((R²R[((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pys s(RRJR(R)R1R³R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_php_syntax_compacts  c Cswtdddddddtdtƒ}|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 *s(RRJR(R)R1R³R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyRTs  c Cs^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  c Cs^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  c Cs^tdddddddtdtƒ}|jdƒ}|jd td ƒƒd ksZt‚dS( Nss${R.s ${item} 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 R R R RR'RRRR&RQRdR£R¾(((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt s ("(  Eo¹¥