Rc@s0dZddlZddlmZddlmZmZmZmZm Z ddl m Z m Z m Z mZddlmZmZmZmZmZeZerdZneZdefd YZd efd YZd efd YZdefdYZdefdYZdZdS(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. iN(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>eZededededgZdZdZRS(iticCst|jdd}|jjtks-tt|s?tt|j sUtt||jjt kswtt|stt|j stt||jjt kstt| stt|jstdS(Ntfootbar( R t test_tokenstcurrentttypeR tAssertionErrortboolteosRRR (tselftts((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt test_simple%s  cCsGgt|jddD]}|j^q}|ddgksCtdS(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 LexerTestCasecBsYeZdZdZdZdZdZdZdZdZ dZ RS( cCs+tjd}|jdks'tdS(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}|jdks'tdS(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}|jdttddksNtdS( 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}|jdttddksNtdS( 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|kstqWtjdjdksctdS( 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|dd|dksKtdS(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|ddkstqWdS( 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   cCsxttgD]}td|}xdifdifdidt6fdidt6fgD]]\}}|j|}|j||}|j}||ks[t||||fq[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      tParserTestCasecBsPeZdZdZdZdZdZdZdZdZ RS(cCsXtdddddd}|jd}|jdttdd ksTtdS( Nsss_ R/it01234(RR(R)R0R1R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_php_syntaxs cCsXtdddddd}|jd}|jdttddksTtdS( 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_syntaxs cCsXtdddddd}|jd}|jdttdd ksTtdS( Nss${R.s ${item} R/iRR(RR(R)R0R1R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_comment_syntaxs cCs+tjd}|jdks'tdS(Ns{{{'foo':'bar'}.foo}}R(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyR2scCs1tjd}|jjdks-tdS(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_comments c Cstddddddd}|jd}g|jdttd jD]}t|j^qRttd ksttdddddddd }|jd }g|jdttd jD]}t|j^qttd kstdS( 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_syntaxs @! @c Cstdddddddd}|jd }|jd d d gjd ksZttdddddddd}|jd}|jd d d gjdkstdS(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_prioritys! *! cCs[d}|dd|dd|dd|dd |d d |d d dS(NcSsXyt|Wn1tk rA}t||ksTtdnXtsTtddS(Nsunexpected error messages that was supposed to be an error(RRtstrRRK(tcodeROte((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt assert_errors "s#{% for item in seq %}...{% endif %}sEncountered 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 %}sUnexpected 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_messagess ( R$R%RSRTRUR2RWR\R^Rc(((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyRQ}s    tSyntaxTestCasecBs1eZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ dZ!d Z"RS(!cCsDt}d|jd<|jd}|jdks@tdS(NcSs|||||S(N((tatbtcRatg((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pytsRs2{{ 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_calls cCs+tjd}|jdks'tdS(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_slicingscCs8tjd}|jdidd6dks4tdS(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_attrscCs:tjd}|jddddgdks6tdS(Ns{{ foo[0] }}|{{ foo[-1] }}Riiis0|2(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_subscriptscCs+tjd}|jdks'tdS(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}|jdks'tdS(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}|jdks'tdS(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}|jdks'tdS(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}|jdks'tdS(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}|jdks'tdS(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}|jdks'tdS(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}|jjdks-tdS(Ns{{ [] }}|{{ {} }}|{{ () }}s[]|{}|()(R'R(R)tlowerR(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt test_literalsscCs+tjd}|jdks'tdS(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}|jdks'tdS(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}|jdks'tdS(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}|jdks'tdS(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}|jdks'ttjd}|jt|jdS(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}|jdks'tdS(Ns{{ "foo"|upper + "bar"|upper }}tFOOBAR(R'R(R)R(RR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_filter_priority9sc Cstdftdftdftdftdftdftdftdftd 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|stqWdS( 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}|jjdks-tdS(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|jttjddS(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|jt|jf}|jd||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;|jttjdtjdjdks7tdS(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}|jdks'tdS(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|kksEtdS(Nids{{ not 42 in bar }}Ri*(R1R'R(R)RR(RRR*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt test_notinxs cCsJdtfdY}tjd}|jd|dksFtdS(NtFoocBseZdZRS(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(RRR!((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_implicit_subscribed_tuple}scCs+tjd}|jdks'tdS(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}|jdks'tdS(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_constscCsbtjd}t|jdjdtjs5tt|jdjdjtjs^tdS(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_assignscCs+tjd}|jdks'tdS(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_localsets cCsltjd}|jdidd6dks4ttjd}|jdidd6dkshtdS(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_unarys%(#R$R%RlRmRnRoRpRqRrRsRtRuRvRxRyRzR{R}RRRRRRRRRRRR-RRRRR(((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyRdsB                               tLstripBlocksTestCasecBseZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd ZdZdZdZdZdZdZdZRS(cCs@tdtdt}|jd}|jdks<tdS(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_lstripscCs@tdtdt}|jd}|jdks<tdS(NRRs! {% if True %} {% endif %}R(RRJR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_lstrip_trimscCs@tdtdt}|jd}|jdks<tdS(NRRs# {%+ if True %} {%+ endif %}s (RRJRKR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_no_lstripscCs@tdtdt}|jd}|jdks<tdS(NRRs- 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_endlinescCs@tdtdt}|jd}|jdks<tdS(NRRs% {% if True %}hello {% endif %}s hello (RRJRKR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_lstrip_inlinescCs@tdtdt}|jd}|jdks<tdS(NRRs: {% 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_nestedscCs@tdtdt}|jd}|jdks<tdS(NRRs. 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_charss cCs@tdtdt}|jd}|jdks<tdS(NRRs& {% set x = " {% str %} " %}{{ x }}s {% str %} (RRJRKR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_lstrip_embeded_stringsscCs@tdtdt}|jd}|jdks<tdS(NRRs {% set hello = 1 %}s (RRJRKR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt%test_lstrip_preserve_leading_newlinesscCs@tdtdt}|jd}|jdks<tdS(NRRs% {# if True #} hello {#endif#}s hello (RRJRKR(R)R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_lstrip_comments c CsXtdddddddddtd t}|jd }|jd ksTtdS( Ns<%s%>s${R.s<%#RXs##RRs% <% 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_simplesc CsXtdddddddddtd t}|jd }|jd ksTtdS( Ns<%s%>s${R.s<%#RXs##RRs' <%# 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_commentsc Cs}tdddddddddtd t}|jd }|jd td d jdtd DksytdS(Ns<%s%>s${R.s<%#RXs##RRse <%# 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_brackets  c Cs}tdddddddddtd t}|jd }|jd td d jdtd DksytdS(Ns<%s%>s${R.s<%#RXs##RRs_ <%#regular comment%> <%for item in seq%> ${item} ## the rest of the stuff <%endfor%>R/iRcss|]}d|VqdS(s%s N((RR[((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pys s(RRJR(R)R1RR(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt!test_lstrip_angle_bracket_compacts  c Cs^tdddddddtdt}|jd}|jd td d ksZtdS( NssRRsp R/iRR(RRJR(R)R1R(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_php_syntax_with_manuals  c Cswtdddddddtdt}|jd}|jd td d jd td DksstdS( NssRRsn R/iRcss|]}d|VqdS(s %s N((RR[((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pys s(RRJR(R)R1RR(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyRSs  c Cswtdddddddtdt}|jd}|jd td d jd td DksstdS( NssRRsh R/iRcss|]}d|VqdS(s %s N((RR[((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pys s(RRJR(R)R1RR(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyttest_php_syntax_compacts  c Cswtdddddddtdt}|jd}|jdtd d jd td DksstdS( Ns<%s%>s<%=s<%#RRse<%# I'm a comment, I'm not interesting %> <% for item in seq %> <%= item %> <% endfor %> R/iRcss|]}d|VqdS(s %s N((RR[((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pys *s(RRJR(R)R1RR(RR'R*((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyRTs  c Cs^tdddddddtdt}|jd}|jdtd d ksZtdS( Ns<%s%>s<%=s<%#RRsj<%# 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 ksZtdS( Ns<%s%>s<%=s<%#RRsk<%# 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 ksZtdS( 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%RRRRRRRRRRRRRRRRSRRTRRRU(((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyRs*              cCs~tj}|jtjt|jtjt|jtjt|jtjt|jtjt|S(N( tunittestt TestSuitetaddTestt makeSuiteRR&RQRdR(tsuite((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyRJs (t__doc__Rtjinja2.testsuiteRtjinja2RRRRRtjinja2._compatRRRR R<R R R R RR'RRRR&RQRdRR(((s>/usr/lib/python2.7/site-packages/jinja2/testsuite/lexnparse.pyt s ("(  Eo