HEX
Server: Apache
System: Linux bd12.noc223.com 4.18.0-553.121.1.lve.el8.x86_64 #1 SMP Thu Apr 30 16:40:41 UTC 2026 x86_64
User: handcraf (1693)
PHP: 8.1.28
Disabled: NONE
Upload Files
File: //opt/alt/python312/lib64/python3.12/test/__pycache__/test_fstring.cpython-312.opt-1.pyc
�

~h�e����ddlZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZm
Z
dZGd�dej�Zedk(rej"�yy)	�N)�support)�temp_cwd)�assert_python_failure�assert_python_okzglobal variablec��eZdZd�Zd�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d	�Zd
�Zd�Z
d�Zd
�Zd�Zd�Zd�Zd�Zej*ej.d�d��Zej*ej.d�d��Zd�Zd�Zd�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d �Z%d!�Z&d"�Z'd#�Z(d$�Z)d%�Z*d&�Z+d'�Z,d(�Z-d)�Z.d*�Z/d+�Z0d,�Z1d-�Z2d.�Z3d/�Z4d0�Z5d1�Z6d2�Z7d3�Z8d4�Z9d5�Z:d6�Z;d7�Z<d8�Z=d9�Z>d:�Z?d;�Z@d<�ZAd=�ZBd>�ZCd?�ZDd@�ZEdA�ZFdB�ZGdC�ZHdD�ZIdE�ZJdF�ZKdG�ZLdH�ZMdI�ZNdJ�ZOdK�ZPdL�ZQdM�ZRdN�ZSdO�ZTdP�ZUdQ�ZVdR�ZWdS�ZXdT�ZYdU�ZZyV)W�TestCasec���|D]C}|j|��5|j||�5t|�ddd�ddd��Ey#1swY�xYw#1swY�\xYw)N��str)�subTest�assertRaisesRegex�eval)�self�exception_type�regex�
error_stringsrs     �8/opt/alt/python312/lib64/python3.12/test/test_fstring.py�assertAllRaisezTestCase.assertAllRaisese�� �	�C����#��&�
��+�+�N�E�B����I��
�
�	����
�
�s!�A�A
�A�
A�A�A	c�B�Gd�d�}|�}|�}tjd�|�|_|j|�t	|��|j|�d�|jt	|�t	|��|j|jd�d�|j|jd�d�|jt|�j|d�d�|jt|�j|d�d�y)Nc��eZdZd�Zy)�(TestCase.test__format__lookup.<locals>.Xc��y)N�class��r�specs  r�
__format__z3TestCase.test__format__lookup.<locals>.X.__format__(s���N��__name__�
__module__�__qualname__rrrr�Xr's��
rr#c��y)N�instancerrs  r�<lambda>z/TestCase.test__format__lookup.<locals>.<lambda>0s�rr�r%)�types�
MethodTyper�assertEqual�format�type)rr#�x�ys    r�test__format__lookupzTestCase.test__format__lookup%s���	�	�
�C��
�C���'�'�(E�q�I������A�3����+����A�3��)�������F�1�I�.�
	
������b�)�7�3�������b�)�:�6�	
����a��+�+�A�r�2�G�<�����a��+�+�A�r�2�G�<rc���Gd�d�}|�}d}tj|�}t|dd�}|j|j�t|�|j
|j�y)Nc��eZdZd�Zd�Zy)�TestCase.test_ast.<locals>.Xc��d|_y)NF��called�rs r�__init__z%TestCase.test_ast.<locals>.X.__init__Cs	��#��rc��d|_y)NT�r4r6s r�__call__z%TestCase.test_ast.<locals>.X.__call__Es��"���rN)r r!r"r7r:rrrr#r2Bs��
$�
rr#�
a = 10
f'{a * x()}'r'�exec)�ast�parse�compile�assertFalser5r<�
assertTrue)rr#r-�expr�t�cs      r�test_astzTestCase.test_ast@sh��	�	�
�C����
�I�I�d�O���A�r�6�"��	
������"�	
�Q��	
������!rc�F�d}tj|�}|jt|�tj�|jt|j�d�|jt|jd�tj�|j|jdjd�|jt|jd�tj�|jt|jdj�tj�|jt|jdjj�d�|jt|jdjjd�tj�|j|jdjd�|j|jdjjd�|j|jdjjdjd�|jdjjdj}|jt|�tj�|jt|j�tj �|jt|j"�tj$�|jt|j&�tj(�|j|jd�|j|jjd�|j|j&jd�|j|j*d�|j|jj*d�|j|j&j*d�y)Nr;�r���)r=r>r*r,�Module�len�body�Assign�lineno�Expr�value�	JoinedStr�values�FormattedValue�BinOp�left�Name�op�Mult�right�Call�
col_offset�rrBrC�binops    r�test_ast_line_numberszTestCase.test_ast_line_numbersXs�����
�I�I�d�O������a��#�*�*�-�����Q�V�V��a�(�����a�f�f�Q�i��#�*�*�5���������)�)�1�-�����a�f�f�Q�i��#�(�(�3�����a�f�f�Q�i�o�o�.��
�
�>�����Q�V�V�A�Y�_�_�3�3�4�a�8�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�:L�:L�M���������)�)�1�-�����������/�/��3�����������/�/��2�9�9�1�=����q�	���&�&�q�)�/�/������e��c�i�i�0�����e�j�j�)�3�8�8�4�����e�h�h�����2�����e�k�k�*�C�H�H�5�������q�)�������*�*�A�.�������+�+�Q�/�����)�)�1�-�������.�.��2�������/�/��3rc���d}tj|�}|jt|�tj�|jt|j�d�|jt|jd�tj�|jt|jdj�tj�|j|jdjd�|jt|jd�tj�|jt|jdj�tj�|jt|jdjj�d�|jt|jdjjd�tj�|jt|jdjjdj�t�|jt|jdjjd�tj�|jt|jdjjd�tj�|jt|jdjjdj�t�|jt|jdjjd�tj�|j|jdjd�|j|jdjjd�|j|jdjjdjd�|j|jdjjdjd�|j|jdjjdjd�|j|jdjjdjd�|jdjjdj}|jt|�tj�|jt|j �tj"�|jt|j$�tj&�|jt|j(�tj*�|j|jd�|j|j jd�|j|j(jd�|j|j,d�|j|j j,d�|j|j(j,d�|jdjjdj}|jt|�tj�|jt|j �tj"�|jt|j$�tj.�|jt|j(�tj*�|j|jd�|j|j jd�|j|j(jd�|j|j,d	�|j|j j,d	�|j|j(j,d
�y)Nz8
f'no formatted values'
f'eggs {a * x()} spam {b + y()}'rGrrHr9rI����)r=r>r*r,rKrLrMrPrQrRrOrS�ConstantrrTrUrVrWrXrYrZr[r\�Add)rrBrC�binop1�binop2s     r�.test_ast_line_numbers_multiple_formattedvaluesz7TestCase.test_ast_line_numbers_multiple_formattedvalueswsw��$��
�I�I�d�O������a��#�*�*�-�����Q�V�V��a�(�����a�f�f�Q�i��#�(�(�3�����a�f�f�Q�i�o�o�.��
�
�>���������)�)�1�-�����a�f�f�Q�i��#�(�(�3�����a�f�f�Q�i�o�o�.��
�
�>�����Q�V�V�A�Y�_�_�3�3�4�a�8�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�,�,�G�����a�f�f�Q�i�o�o�4�4�Q�7�=�=�>��D�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�:L�:L�M�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�,�,�G�����a�f�f�Q�i�o�o�4�4�Q�7�=�=�>��D�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�:L�:L�M���������)�)�1�-�����������/�/��3�����������/�/��2�9�9�1�=�����������/�/��2�9�9�1�=�����������/�/��2�9�9�1�=�����������/�/��2�9�9�1�=��������'�'��*�0�0������f��s�y�y�1�����f�k�k�*�C�H�H�5�����f�i�i��#�(�(�3�����f�l�l�+�S�X�X�6��������*�������+�+�Q�/�������,�,�a�0�����*�*�A�.�������/�/��3�������0�0�"�5��������'�'��*�0�0������f��s�y�y�1�����f�k�k�*�C�H�H�5�����f�i�i��#�'�'�2�����f�l�l�+�S�X�X�6��������*�������+�+�Q�/�������,�,�a�0�����*�*�B�/�������/�/��4�������0�0�"�5rc�^
�d}tj|�}|jt|�tj�|jt|j�d�|jt|jd�tj�|j|jdjd�|jt|jd�tj�|jt|jdj�tj�|jt|jdjj�d�|jt|jdjjd�tj�|j|jdjd�|j|jdjjd�|j|jdjjdjd�|jdjjdj}|jt|�tj�|jt|j�tj �|jt|j"�tj$�|jt|j&�tj�|j|jd�|j|jjd�|j|j&jd�|j|j(d�|j|jj(d�|j|j&j(d�|jt|j&j�d�|jt|j&jd�tj*�|jt|j&jdj�t,�|jt|j&jd�tj�|jt|j&jd�tj*�|jt|j&jdj�t,�|j|j&jdjd�|j|j&jdjd�|j|j&jdjd�|j&jdj}|jt|�tj.�|j|jd�|j|j(d�y)Nz
a = 10
f'{a * f"-{x()}-"}'rGrrHrIrJ�)r=r>r*r,rKrLrMrNrOrPrQrRrSrTrUrVrWrXrYrZr\rerr[)rrBrCr^�calls     r�test_ast_line_numbers_nestedz%TestCase.test_ast_line_numbers_nested�si����
�I�I�d�O������a��#�*�*�-�����Q�V�V��a�(�����a�f�f�Q�i��#�*�*�5���������)�)�1�-�����a�f�f�Q�i��#�(�(�3�����a�f�f�Q�i�o�o�.��
�
�>�����Q�V�V�A�Y�_�_�3�3�4�a�8�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�:L�:L�M���������)�)�1�-�����������/�/��3�����������/�/��2�9�9�1�=����q�	���&�&�q�)�/�/������e��c�i�i�0�����e�j�j�)�3�8�8�4�����e�h�h�����2�����e�k�k�*�C�M�M�:�������q�)�������*�*�A�.�������+�+�Q�/�����)�)�1�-�������.�.��2�������/�/��3�����U�[�[�/�/�0�!�4�����e�k�k�0�0��3�4�c�l�l�C�����e�k�k�0�0��3�9�9�:�C�@�����e�k�k�0�0��3�4�c�6H�6H�I�����e�k�k�0�0��3�4�c�l�l�C�����e�k�k�0�0��3�9�9�:�C�@�������+�+�A�.�5�5�q�9�������+�+�A�.�5�5�q�9�������+�+�A�.�5�5�q�9��{�{�!�!�!�$�*�*������d��S�X�X�.�������a�(�������"�-rc���d}tj|�}|jt|�tj�|jt|j�d�|jt|jd�tj�|j|jdjd�|jt|jd�tj�|jt|jdj�tj�|jt|jdjj�d�|jt|jdjjd�tj�|jt|jdjjd�tj�|jt|jdjjdj�t�|jt|jdjjd�tj�|jt|jdjjd�tj�|jt|jdjjdj�t�|jt|jdjjd�tj�|j|jdjd�|j|jdjjd�|j|jdjjdjd�|j|jdjjdjd�|j|jdjjdjd�|j|jdjjdjd�|j|jdjjdjd�|jdjjdj}|jt|�tj �|jt|j"�tj$�|jt|j&�tj(�|jt|j*�tj,�|j|jd�|j|j"jd�|j|j*jd�|j|j.d�|j|j"j.d�|j|j*j.d�|jdjjdj}|jt|�tj �|jt|j"�tj$�|jt|j&�tj(�|jt|j*�tj,�|j|jd�|j|j"jd�|j|j*jd�|j|j.d	�|j|j"j.d	�|j|j*j.d
�|jdjjdj}|jt|�tj �|jt|j"�tj$�|jt|j&�tj(�|jt|j*�tj,�|j|jd�|j|j"jd�|j|j*jd�|j|j.d�|j|j"j.d�|j|j*j.d�y)
Nz)
a = 10
f'{a * x()} {a * x()} {a * x()}'
rGrrH�rIr9rJ�
�rcrd)r=r>r*r,rKrLrMrNrOrPrQrRrSrTrerrUrVrWrXrYrZr[r\r]s    r�*test_ast_line_numbers_duplicate_expressionz3TestCase.test_ast_line_numbers_duplicate_expression�s�����
�I�I�d�O������a��#�*�*�-�����Q�V�V��a�(�����a�f�f�Q�i��#�*�*�5���������)�)�1�-�����a�f�f�Q�i��#�(�(�3�����a�f�f�Q�i�o�o�.��
�
�>�����Q�V�V�A�Y�_�_�3�3�4�a�8�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�:L�:L�M�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�,�,�G�����a�f�f�Q�i�o�o�4�4�Q�7�=�=�>��D�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�:L�:L�M�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�,�,�G�����a�f�f�Q�i�o�o�4�4�Q�7�=�=�>��D�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�:L�:L�M���������)�)�1�-�����������/�/��3�����������/�/��2�9�9�1�=�����������/�/��2�9�9�1�=�����������/�/��2�9�9�1�=�����������/�/��2�9�9�1�=�����������/�/��2�9�9�1�=����q�	���&�&�q�)�/�/������e��c�i�i�0�����e�j�j�)�3�8�8�4�����e�h�h�����2�����e�k�k�*�C�H�H�5�������q�)�������*�*�A�.�������+�+�Q�/�����)�)�1�-�������.�.��2�������/�/��3����q�	���&�&�q�)�/�/������e��c�i�i�0�����e�j�j�)�3�8�8�4�����e�h�h�����2�����e�k�k�*�C�H�H�5�������q�)�������*�*�A�.�������+�+�Q�/�����)�)�2�.�������.�.��3�������/�/��4����q�	���&�&�q�)�/�/������e��c�i�i�0�����e�j�j�)�3�8�8�4�����e�h�h�����2�����e�k�k�*�C�H�H�5�������q�)�������*�*�A�.�������+�+�Q�/�����)�)�2�.�������.�.��3�������/�/��4rc��tjd�}|jt|j�d�|j|jdj
d�|jt
|jd�tj�|jt
|jdj�tj�|jt|jdjj�d�|jt
|jdjjd�tj�|jt
|jdjjd�tj�|jt
|jdjjd�tj�|jdjj\}}}|j}|jt
|�tj�|j|j
d�|j|jd�|j|jd�|j|j d�y)Nz%f"Here is that pesky {xxx:.3f} again"rHrrIrG��)r=r>r*rLrMrOr,rPrQrRrSrerTrW�
end_linenor\�end_col_offset)rrC�_rB�names     r�(test_ast_numbers_fstring_with_formattingz1TestCase.test_ast_numbers_fstring_with_formattings����I�I�=�>������Q�V�V��a�(���������)�)�1�-�����a�f�f�Q�i��#�(�(�3�����a�f�f�Q�i�o�o�.��
�
�>�����Q�V�V�A�Y�_�_�3�3�4�a�8�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�,�,�G�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�:L�:L�M�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�,�,�G��V�V�A�Y�_�_�+�+�
��4���z�z������d��S�X�X�.�������a�(�������!�,�������"�-�����,�,�b�1rc�n�d}tj|�}|jt|�tj�|jt|j�d�|jt|jd�tj�|j|jdjd�|jt|jd�tj�|jt|jdj�tj�|jt|jdjj�d�|jt|jdjjd�tj�|jt|jdjjdj�t�|jt|jdjjd�tj�|jt|jdjjd�tj�|jt|jdjjdj�t�|j|jdjd�|j|jdjjd�|j|jdjjdjd�|j|jdjjdjd�|j|jdjjdjd�|j|jdj d�|j|jdjj d�|j|jdjjdj d�|j|jdjjdj d�|j|jdjjdj d�|jdjjdj}|jt|�tj"�|jt|j$�tj&�|jt|j(�tj*�|jt|j,�tj.�|j|jd�|j|j$jd�|j|j,jd�|j|j d�|j|j$j d�|j|j,j d	�d
}tj|�}|jt|�tj�|jt|j�d�|jt|jd�tj�|jt|jdj�tj�|jt|jdjj�d�|jt|jdjjd�tj�|j|jdjd�|j|jdjjd�|j|jdjjdjd�|j|jdjjdjd�|j|jdjjdjd�|j|jdj d�|j|jdjj d�|j|jdjjdj d�|j|jdjjdj d�|j|jdjjdj d
�|j|jdjjdjjd�|j|jdjjdjj0d�|j|jdjjdjj d�|j|jdjjdjj2d�y)Nz?
a = 10
f'''
  {a
     *
       x()}
non-important content
'''
rGrrHrIr9�rkrJz$
a = f'''
          {blech}
    '''
ra�
rq�)r=r>r*r,rKrLrMrNrOrPrQrRrSrerrTr\rUrVrWrXrYrZr[rvrwr]s    r�'test_ast_line_numbers_multiline_fstringz0TestCase.test_ast_line_numbers_multiline_fstring1s�����
�I�I�d�O������a��#�*�*�-�����Q�V�V��a�(�����a�f�f�Q�i��#�*�*�5���������)�)�1�-�����a�f�f�Q�i��#�(�(�3�����a�f�f�Q�i�o�o�.��
�
�>�����Q�V�V�A�Y�_�_�3�3�4�a�8�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�,�,�G�����a�f�f�Q�i�o�o�4�4�Q�7�=�=�>��D�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�:L�:L�M�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�,�,�G�����a�f�f�Q�i�o�o�4�4�Q�7�=�=�>��D���������)�)�1�-�����������/�/��3�����������/�/��2�9�9�1�=�����������/�/��2�9�9�1�=�����������/�/��2�9�9�1�=���������-�-�q�1�����������3�3�Q�7�����������/�/��2�=�=�q�A�����������/�/��2�=�=�q�A�����������/�/��2�=�=�r�B����q�	���&�&�q�)�/�/������e��c�i�i�0�����e�j�j�)�3�8�8�4�����e�h�h�����2�����e�k�k�*�C�H�H�5�������q�)�������*�*�A�.�������+�+�Q�/�����)�)�1�-�������.�.��2�������/�/��3���

�I�I�d�O������a��#�*�*�-�����Q�V�V��a�(�����a�f�f�Q�i��#�*�*�5�����a�f�f�Q�i�o�o�.��
�
�>�����Q�V�V�A�Y�_�_�3�3�4�a�8�����a�f�f�Q�i�o�o�4�4�Q�7�8�#�:L�:L�M���������)�)�1�-�����������/�/��3�����������/�/��2�9�9�1�=�����������/�/��2�9�9�1�=�����������/�/��2�9�9�1�=���������-�-�q�1�����������3�3�Q�7�����������/�/��2�=�=�q�A�����������/�/��2�=�=�r�B�����������/�/��2�=�=�r�B�����������/�/��2�8�8�?�?��C�����������/�/��2�8�8�C�C�Q�G�����������/�/��2�8�8�C�C�R�H�����������/�/��2�8�8�G�G��Lrc�^
�d}tj|�}|jt|�tj�|jt|j�d�|jdj}|jt|�tj�|j|jd�|j|jd�|j|jd�|j|jd�|jdjjd}|jt|�tj�|j|jd�|j|jd�|j|jd�|j|jd�|jdjjdj}|jt|�tj�|j|jd�|j|jd�|j|jd	�|j|jd
�d}tj|�}|jt|�tj�|jt|j�d�|j\}}|jj D�cgc]}|j|jf��}	}|j#t%d
�|	D���|jj D�cgc]}|j|jf��}	}|j#t%d�|	D���d}tj|�}|jt|�tj�|jt|j�d�|jdjj d}
|jt|
�tj�|jt|
j�d�|
j\}}}
|jt|�tj&�|j|jd�|j|jd�|j|jd�|j|jd�|j}|jt|�tj�|j|jd�|j|jd�|j|jd�|j|jd�|jt|
�tj&�|j|
jd�|j|
jd�|j|
jd�|j|
jd�|j|
jd�ycc}wcc}w)Nz
x = (
    f" {test(t)}"
)rHrrIr9rqrJr~ra�z�
x = (
    u'wat',
    u"wat",
    b'wat',
    b"wat",
    f'wat',
    f"wat",
)

y = (
    u'''wat''',
    u"""wat""",
    b'''wat''',
    b"""wat""",
    f'''wat''',
    f"""wat""",
)
        rGc3�&K�|]	}|dk(���y�w))r9r}Nr��.0�offsets  r�	<genexpr>zBTestCase.test_ast_line_numbers_with_parentheses.<locals>.<genexpr>������
��
�g��
���c3�&K�|]	}|dk(���y�w))r9�Nrr�s  rr�zBTestCase.test_ast_line_numbers_with_parentheses.<locals>.<genexpr>�r�r�zv
x = (
        'PERL_MM_OPT', (
            f'wat'
            f'some_string={f(x)} '
            f'wat'
        ),
)
ror��rd�r|� �)r=r>r*r,rKrLrMrQrRrOrvr\rwrSrTr[�eltsrA�allre)rrBrC�	joinedstr�fvrlr-r.�elt�offsets�fstring�wat1�middle�wat2s              r�&test_ast_line_numbers_with_parenthesesz/TestCase.test_ast_line_numbers_with_parentheses�s�����
�I�I�d�O������a��#�*�*�-�����Q�V�V��a�(��F�F�1�I�O�O�	�����i��#�-�-�8�����)�)�1�-�����-�-�q�1�����-�-�q�1�����1�1�2�6�
�V�V�A�Y�_�_�
#�
#�A�
&������b��3�#5�#5�6�������A�&��������*��������*�����*�*�B�/��v�v�a�y���%�%�a�(�.�.������d��S�X�X�.�������a�(�������!�,�������!�,�����,�,�b�1���&
�I�I�d�O������a��#�*�*�-�����Q�V�V��a�(��v�v���1�
�w�w�|�|�
���^�^�S�/�/�0�
��
�	
����
�!�
�
�	��w�w�|�|�
���^�^�S�/�/�0�
��
�	
����
�!�
�
�	�
��
�I�I�d�O������a��#�*�*�-�����Q�V�V��a�(��&�&��)�/�/�&�&�q�)������g���
�
�6�����W�^�^�,�a�0�$�^�^���f�d�����d��S�\�\�2�������a�(�������!�,�������"�-�����,�,�b�1��|�|������d��S�X�X�.�������a�(�������!�,�������"�-�����,�,�b�1�����d��S�\�\�2�������a�(�������!�,�������"�-�	
����,�,�b�1�����/�/��4��u
��
s�,Z%�Z*c��d}tj|�}|jt|�tj�|jt|j�d�|jdj}|jt|�tj�|jt|j�d�|jd}|jt|�tj�|j}|jt|�tj�|jt|j�d�y)Nz
f'{expr:}'rHr)r=r>r*r,rKrLrMrQrRrSrT�format_spec)rrB�modr�r�r�s      r�"test_ast_fstring_empty_format_specz+TestCase.test_ast_fstring_empty_format_spec�s������i�i��o������c��C�J�J�/�����S�X�X���*��(�(�1�+�#�#������g���
�
�6�����W�^�^�,�a�0�
�^�^�A�
������b��3�#5�#5�6��n�n������k�*�C�M�M�:�����[�/�/�0�!�4rc�|�d�}|j|j�d�}|j|j�y)Nc��y�Nrrrr�fz"TestCase.test_docstring.<locals>.fs��rc��yr�rrrr�gz"TestCase.test_docstring.<locals>.g	s��!r)�assertIsNone�__doc__)rr�r�s   r�test_docstringzTestCase.test_docstrings2��	#����!�)�)�$�	�	
���!�)�)�$rc��|jtd�5tjd�ddd�y#1swYyxYw)Nzmalformed node or stringzf'x')r
�
ValueErrorr=�literal_evalr6s r�test_literal_evalzTestCase.test_literal_evals6��
�
#�
#�J�0J�
K�	%����V�$�	%�	%�	%�s�6�?c��dg}d}tj|�}t|dd�}t|�|j	|dd�y)Nr'zx[0] = 'foo' f'{3}'r<r�foo3)r=r>r?r<r*)rr-rBrCrDs     r�test_ast_compile_time_concatz%TestCase.test_ast_compile_time_concatsD��
�D��(���I�I�d�O���A�r�6�"���Q������1��v�&rc�6�|jtdddg�y)Nz&cannot mix bytes and nonbytes literalszf'' b''zb'' f''�r�SyntaxErrorr6s r�test_compile_time_concat_errorsz(TestCase.test_compile_time_concat_errorss �����K�D�+�+��	 rc�p�|j�d�|jdd�|jdd�y)Nr'�a� �r*r6s r�test_literalzTestCase.test_literal"s2������b�!����1�s�#����1�s�#rc�6�|jtdgd��y)Nzunterminated string)zf'{"x'zf'{"x}'zf'{("x'zf'{("x}'r�r6s r�test_unterminated_stringz!TestCase.test_unterminated_string's�����K�)>��	 rzexhausts limited stack on WASIc�*�|jtddg�|jtddg�|jtddg�|jtddg�|jtdd	g�|jttd
�y)Nz@closing parenthesis '\}' does not match opening parenthesis '\('zf'{((}'z@closing parenthesis '\)' does not match opening parenthesis '\['z	f'{a[4)}'z@closing parenthesis '\]' does not match opening parenthesis '\('z	f'{a(4]}'z@closing parenthesis '\}' does not match opening parenthesis '\['zf'{a[4}'zf'{a(4}'a�f'{((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((}')rr��assertRaisesrr6s r�test_mismatched_parenszTestCase.test_mismatched_parens/s������K�*G�&��	 �	
���K�*G�(��	�	
���K�*G�(��	�	
���K�*G�'��	�	
���K�*G�'��	�	
���+�t�-C�Drc�|��|jtddg��fd��|jtd�d�g�y)Nz'f-string: expressions nested too deeplyzf"{1+2:{1+2:{1+1:{1}}}}"c�2��|dk(ry�|dz
�}d|�d�S)Nrz1+1rHzf"{z}"r)�n�prev�create_nested_fstrings  �rr�zFTestCase.test_fstring_nested_too_deeply.<locals>.create_nested_fstringMs*����A�v��(��1��-�D��$��s�#�#rztoo many nested f-strings�r�)rr�s @r�test_fstring_nested_too_deeplyz'TestCase.test_fstring_nested_too_deeplyGsA������K�E�7�8�	:�	$�	
���K�7�2�3�7�8�	:rc�4�|jtddg�y)N�invalid syntaxa�f"{1 1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:{f"1:r�r6s r�#test_syntax_error_in_nested_fstringz,TestCase.test_syntax_error_in_nested_fstringWs�����K�,�8�9�	;rc���|jdd�|jdd�|jdd�|jdd�|jdd�|jdd�|jdd�|jdd�|jd	d	�|jd
d
�|jdd�|jdd�|jd
d
�|jdd�|jdd�|jdd�|jdd��d�|jdd��d�|jdd��d�|jdd��d�|jd�d�d�|jd�d�d�|jd�d�d�|jd�d�d�|jd�d�|jtddg�y) N�{za{z{bza{b�}za}z}bza}bz{}za{}z{b}z{}cza{b}za{}cz{b}cza{b}cr}z{10z}10z}{z}{10z}a{z}a{10z10{z10}z10}{z}a{}z10}a{}z{{}}zunhashable typezf'{ {{}} }')r*r�	TypeErrorr6s r�test_double_braceszTestCase.test_double_braces]s������2��$����3��&����3��&����4�%�(����2��$����3��&����3��&����4�%�(����4�$�'����5�5�)����5�5�)����5�5�)����6�F�+����6�F�+����6�F�+����7�W�-����2�b�T��E�*����2�b�T��E�*����4��t��f�-����5����w�/����B�4�r��E�*����B�4�r��E�*����B�4�t��f�-����B�4�z�)�8�4�	
���F�8�f�-����I�'8�*��	 rc�*�d}|jd|�d�d�|jd|�d�d�|jd|�d|d��d�|jd	|��d
�|jd|��d�|jd	|��d
�|jd
|��d�|jd|��d�|jd|��d�|j|�d�d�|j|�d�|j|�d�|j|�d�|j|�d�d�|jd|�d�d�|jd|��d�|j|�d|��d�|j�d�|j�d�|j�d�|j�d�|j�d�|j�d�|j�d�|jd�d�|jtddg�y)N�defzabc## �ghizabc## defghi�abc�	abcdefghi�4z
abcdefghidef z{x}z{x}defz{xz{xdefz{{x}}z{{x}}defz{{xz{{xdefzx}}zx}}defzdefx}}�2�def2�1�1def2�1def�-zdef-defr'z fz
expecting '}'z
f'{3' f"}"�r*rr��rr-s  r�test_compile_time_concatz!TestCase.test_compile_time_concat�s$��������Q�C�s�+�^�<�����!��e�+�[�9�����!��h�q��e�4�o�F�����!���x�0��������g�.�����!���x�0�����A�3���4�����!���x�0�����!���x�0����A�3���x�0����A�3�E�*����q�c�u�-����q�c�E�*����A�3���V�,������s�C���1������s��V�,����A�3�!�A�3���3������$�����B�'������+�����b�!������$�����R�(������+�	
���D�6�D�)����K��-��	 rc���ddi}|jd�d�|j|d�d�|jtdgd��|jtddg�|jdd��d	�|jd
d��d�|jd
d��d�|jd
d��d�|jd
d��d�|jtddg�y)N�#�hashz'{' was never closed)zf'{1#}'zf'{#}'zf'one: {1#}'z(f'{1# one} {2 this is a comment still#}'�f-string: unmatched '\)'zf'{)#}'zA complex trick: rGzA complex trick: 2�
�*z
42z
# this is not a comment
r|z
# this is not a comment
6�Vz
86�.f-string: valid expression required before '}'zf'''
{
# only a comment
}'''
r��r�ds  r�
test_commentszTestCase.test_comments�sL��
�&�M�����C�5�3�'����A�c�F�8�f�-����K�)?��	 �	
���K�)D�&��	 �	
���.��/���	�	
�������

�	�	
�������

�	�	
�������
(�		)�
	
�������
�		�	
���K�)Z���	 rc�l�dd�}d}d}tdd�D])}|jt||��|dz|z��+|jt|d�dz�|dzd	z�|d
d�}|jt|�|dzdz�d
dz}|jt|�d�y)Nc��dd|zz|zdzS)N�f'z{x} �'r)r��extras  r�
build_fstrz2TestCase.test_many_expressions.<locals>.build_fstr�s���6�A�:�&��.��4�4rr#rH�ir���i��z{x:{width}} �zf'{1}' 'x' 'y'i�1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy1xy)r')�ranger*r)rr�r-�width�i�ss      r�test_many_expressionszTestCase.test_many_expressions�s���
	5�
�����s�C��	=�A����T�*�Q�-�0�1�S�5�!�)�<�	=�	
����j��o�c�1�2�Q�s�U�W�4E�F��s�N�+������a��1�S�5�#�+�.�
�t�#������a��,�/rc	�N�d}d}tjd�}|jd||�d|�d���d�|jd||�d|�d���d�|jd||d�d|d	�d���d�|jd|d
�dd�d|d	�d���d�|jd|d
�dd�d|d	�d���d�|jddd
�d
��d�|jdd�d	d�d�d��d�|jddd�d	d�d��d�|jdd�dd
�dd�d��d�|jdddddik7xr|�d��d�|jd||d�d��d|d	�d���d�|jtddg�|jtddg�|jtddg�y)Nr}r9z12.34567zresult: �.r'zresult:      12.35�0r�rHrr��0xz
       0xar-i����r�z
      -0xarIrozf-string: expecting ':' or '}'zf'{"s"!r{":10"}}'�0f-string: expecting a valid expression after '{'zf'{4:{/5}}'�&f-string: invalid conversion characterzf'{"s"!{"r"}}')�decimal�Decimalr*rr�)rr��	precisionrQs    r�!test_format_specifier_expressionsz*TestCase.test_format_specifier_expressions�s7�����	����
�+�����8�E�5�'��9�+�P�)=�#>�?�AU�V����8�E�5�)�1�Y�K�p�)?�#@�A�CW�X����8�E�5��)�1�Y�q�M��)A�#B�C�EY�Z����8�E�1�#�a��U�!�I�a�=��)@�#A�B�DX�Y����8�E�A�$��!�f�A�y��^�0�)C�#D�E�G[�\����B�q���2�g�;��6����B��u�A�a�S���P�o�.��>����C��#��a��s�!�|�,�|�<����C���Q�q�c��3�%�p�/�0�<�@����B�q��q��e��!5�� 6�a�7�8�<�H����8�E�5�!��@��+�Q�y��m�0�)C�#D�E�G[�\����K�)I�4��	 �
	
���K�N�*��	 �	
���K�)Q�2��	 rc���Gd�d�}|j|�d�d�|j|�d�d�|jt�5tdd|i�ddd�y#1swYyxYw)Nc��eZdZd�Zy)�;TestCase.test_custom_format_specifier.<locals>.CustomFormatc��|Sr�r)rr�s  rrzFTestCase.test_custom_format_specifier.<locals>.CustomFormat.__format__s��"�"rNrrrr�CustomFormatrs��
#rrr�u☃uf"{F():¯\_(ツ)_/¯}"�F)r*�assertWarns�
SyntaxWarningr<)rrs  r�test_custom_format_specifierz%TestCase.test_custom_format_specifierss��	#�	#�	
���L�N�2�.��6����L�N�6�2�U�;�
�
�
�m�
,�	A��*�S�,�,?�@�	A�	A�	A�s�A*�*A3c�T�Gd�d�}|�}|j|�d|��d�y)Nc��eZdZd�Zd�Zy)�*TestCase.test_side_effect_order.<locals>.Xc��d|_y)Nr)r�r6s rr7z3TestCase.test_side_effect_order.<locals>.X.__init__s	����rc�V�|xjdz
c_t|j�S)NrH)r�rrs  rrz5TestCase.test_side_effect_order.<locals>.X.__format__ s�����!����4�6�6�{�"rN)r r!r"r7rrrrr#rs��
�
#rr#r�z1 2r�)rr#r-s   r�test_side_effect_orderzTestCase.test_side_effect_orders/��	#�	#�
�C�����A�3�a��s��U�+rc��|jtdgd��|jtdgd��|jtdgd��|jtdgd��|jtd	d
dg�y)Nr�)zf'{}'z
f'{ }'f' {} 'zf'{10:{ }}'zf' { } 'z
f'''{	
}'''z.f-string: valid expression required before '!')zf'{!r}'zf'{ !r}'zf'{!}'zf'''{	
!a}'''zf'{!'zf'{!s:'zf'{!x}'z	f'{ !xr}'zf'{!x:}'z	f'{!x:a}'z
f'{ !xr:}'zf'{ !xr:a}'z.f-string: valid expression required before ':')zf'{:}'zf'{ :!}'zf'{:2}'zf'''{	
:a}'''zf'{:'z.f-string: valid expression required before '=')zf'{=}'zf'{ =}'zf'{ =:}'z
f'{   =!}'zf'''{	
=}'''zf'{='z'invalid non-printable character U\+00A0uf'''{ }'''� r�r6s r�test_missing_expressionz TestCase.test_missing_expression's������K�L�	�	 �	
���K�L��	 �,	
���K�L��	 �	
���K�L��	 �	
���K�)S�,�#��	 rc��|jd�d�|jtddg�|jtddg�y)N)rIz(3,)r�zf'{,}'r�z
f'{3)+(4}'r�r6s r�test_parens_in_expressionsz#TestCase.test_parens_in_expressionsdsL�����B�4�&�)����K�N�%��	 �
	
���K�)D�)��	 rc�6�|jtdgd��y)Nr�)zf'{.}'z
f'{.}'z

f'{.}'r�r6s r�!test_newlines_before_syntax_errorz*TestCase.test_newlines_before_syntax_errorps�����K�N�4�	6rc�J�|jdd�|jdd�|jdd�|jd�d�d�|jd�dd��d�|jdd��d�|jdd�|jd	d	�|jd	d	�|jd�d�d
�|jd�dd��d�|jdd��d�|jdd�|jd
d
�|jd
d
�|jd�d�d
�|jd�dd��d�|jdd��d�|jdd�|jd�d�d
�|jd�dd��d�|jdd��d�|jd
d
�|jdd�|jdd�|jdd�|jdd�|jdd�|jd�d�d�|jd�dd��d�|jdd��d�|jdd�|jdd�|jdd�|jt�5td�}ddd�|jd�|jt�5td�}ddd�|j|d�|jdd��d�|jdd��d�d}|jdd�|jd|��d�|jd|��d�|jdd�y#1swY��xYw#1swY��xYw)N�	z\trGz2	rIz2	3z	3uΔz\u0394u2Δu2Δ3uΔ3z
\U00000394r�z\x20z2 z2 3z 3z	f'\{6*7}'z\42zf'\g'z\g�\r��spam�&z\Nz\Nspamz\&)r*rrr)rrQ�	AMPERSANDs   r�test_backslashes_in_string_partz(TestCase.test_backslashes_in_string_partus������2��%������&����B��'����A�3�b��5�)����A�3�b����f�-����2�a�S��5�)����6�H�-�����I�.����F�Y�/����A�3�f��y�1����A�3�f�Q�C��*�5����6�!���y�1����:��1�����
�6����J��7����A�3�j�)�9�5����A�3�j���,�j�9����:�a�S�)�9�5����9�H�E����A�3�<�=�y�I����A�3�<�Q�C�@�*�M����9�!��=�y�I����:�Y�G����;�j�I����:�Y�G����4�#�&�����'�*����D�7�+����A�3�d��T�*����A�3�d�1�#���.����4��s��T�*����5�4�(����6�E�*����5�4�(�
�
�
�m�
,�	'���&�E�	'������'�
�
�
�m�
,�	#���N�E�	#������&����2�c�U��V�,����A�c�U��V�,��	�	
���=�3�/����3�y�k�*�I�6����B�y�k�*�I�6����?�U�3�	'�	'��	#�	#�s�1N
�,N�
N�N"c�6�|jtdgd��y)Nzi\(unicode error\) 'unicodeescape' codec can't decode bytes in position .*: malformed \\N character escape)
zf'\N'zf'\N 'zf'\N  'zf'\N{'z f'\N{GREEK CAPITAL LETTER DELTA'z'\N'z'\N 'z'\N  'z'\N{'z'\N{GREEK CAPITAL LETTER DELTA'r�r6s r�%test_misformed_unicode_character_namez.TestCase.test_misformed_unicode_character_name�s��	
���K�*V�
�	 rc���|jd�d�|jdd�|jd�d�|jd�d�|jtddg�y)NrI�3r�r�zf'{
}'r�r6s r�#test_backslashes_in_expression_partz,TestCase.test_backslashes_in_expression_part�su��������	�
	
���1�3�7����4�5��<����5�6��=����K�L�&��	 rc��dD��cgc]}dD]}|j|�����}}}|jtd|�ycc}}w)N)z{expr}z
f'{{{expr}}}'zrf'{{{expr}}}')z\'a\'z\t3r)rBz,unexpected character after line continuation)r+rr�)r�
formattingrB�casess    r�/test_invalid_backslashes_inside_fstring_contextz8TestCase.test_invalid_backslashes_inside_fstring_context�sc��
�
��
�
��

���4��(�
�(�
��
�	
���K�)W�!�	#��
s� Ac��|jdd�|jdd�|jdd�|jdd�y)z@
        Only literal curly braces begin an expression.
        z{1+1}z{1+1Nr�r6s r�test_no_escapes_for_bracesz#TestCase.test_no_escapes_for_braces�sE��
	
���9�w�/����7�V�,����9�v�.����K�g�Vrc�P�|jd�d�|jd�d�y)Nrr�rJ�7r�r6s r�test_newlines_in_expressionsz%TestCase.test_newlines_in_expressions�s/�����A�3��%���� ��
�	rc����d�|j�fd�d��d�|j�fd�d�d�d�|j�fd�d�d�d	�|jtd
gd��|jtd�5t	d
dd�ddd�|jtd�5td�ddd�y#1swY�4xYw#1swYyxYw)Nroc����|zSr�r�r.r-s �rr&z&TestCase.test_lambda.<locals>.<lambda>�����a��c�r�8z'88888'c����|zSr�rr-s �rr&z&TestCase.test_lambda.<locals>.<lambda>�r.r�10z
'88888'   c����|zSr�rr-s �rr&z&TestCase.test_lambda.<locals>.<lambda>�r.rz
88888     z@f-string: lambda expressions are not allowed without parentheses)zf'{lambda x:x}'zf'{lambda :x}'zf'{lambda *arg, :x}'zf'{1, lambda:x}'zf'{lambda x:}'z
f'{lambda :}'r�z)lambda name_3=f'{name_4}': {name_3}
1 $ 1z<string>r<r�zf'{+ lambda:None}')r*rr�r
r?rr�s @r�test_lambdazTestCase.test_lambda�s����
�����\�3�/�2�Y�?����\�3�/�"�5��E����\�3�/��3�l�C�
	
���K�2��		 ��
#�
#�K�1A�
B�	V��@�*�f�U�	V��
#�
#�K�1c�
d�	'��%�&�	'�	'�		V�	V��	'�	'�s�	C
�5C�
C�Cc�v�|jd�d�|jd�d�|jd�d�y)NrHr�rGr�rIr r�r6s r�test_valid_prefixeszTestCase.test_valid_prefixess8�����A�3��%����Q�C�#�&����Q�C�#�&rc��|jdd�|jdd�|jdd�|jdd�|jdd�|jdd�|jdd�y)Nz\'z\"z\"\'z\'\"z\"\'\"z\'\"\'z\"\'\"\'r�r6s r�test_roundtrip_raw_quotesz"TestCase.test_roundtrip_raw_quotesss�����B��'����B��'����D�9�-����D�9�-����F�\�2����F�]�3����H�'7�8rc���gd�}|D]\\}}|j||��5|jt�5t|�}ddd�|j	|�ddd��^|j	dd�|j	dd�|j	dd��d�|j	dd��d�|j	d�d�d	�y#1swY��xYw#1swY��xYw)
N))z	f'\{{\}}'�\{\})�f'\{{'�\{)zf'\{{{1+1}'�\{2)zf'\}}{1+1}'�\}2)zf'{1+1}\}}'�2\})�case�expected_resultr9r;rGr<z\}r=r>)rrrrr*)r�deprecated_casesr?r@�results     r�,test_fstring_backslash_before_double_bracketz5TestCase.test_fstring_backslash_before_double_brackets���
��&6�	:�!�D�/����4���I�
:��%�%�m�4�(�!�$�Z�F�(�� � ���9�
:�
:�	:�
	
���F�X�.����C�%�(����C��u��v�.����C��u��v�.����S�E���v�.�(�(��
:�
:�s"�C�C
�C�
C�C�C	c��|jt�5}td�ddd�|jt	j
�d�|j|j
djt�y#1swY�\xYw)Nr:rHr)rrrr*rL�warnings�category)r�ws  r�7test_fstring_backslash_before_double_bracket_warns_oncez@TestCase.test_fstring_backslash_before_double_bracket_warns_once0sd��
�
�
�m�
,�	����O�	�����Q�Z�Z��!�,�������A��/�/��?�	�	�s�A=�=Bc��|jdd�|jdd�|jdd�|jdd�|jdd�|jdd�|jdd�|jdd�|jdd�|jdd�|jdd�|jdd�y)Nrz\\z\\\\r�r6s r�!test_fstring_backslash_prefix_rawz*TestCase.test_fstring_backslash_prefix_raw6s������2��%����4�&�)����B��'����D�7�+����B��'����D�7�+����B��'����D�7�+����B��'����D�7�+����B��'����D�7�+rc�d�|jd��d�d�|jddd�d��d�d�y)NrHr�z1}z>3ror'z$                                  1}r�r6s r�(test_fstring_format_spec_greedy_matchingz1TestCase.test_fstring_format_spec_greedy_matchingDs;�����A�Q�4�r��D�)����A�b���0�V�9�B��)O�Prc��d�}|d�}|jt|�d�|jt|�d�y)Nc3�*K�d|dz����d���y�w)Nzy:rGr)r.s r�fnzTestCase.test_yield.<locals>.fnKs�����q��s�����g�s�r9ra)r*�next)rrOr�s   r�
test_yieldzTestCase.test_yieldHs:��	�
�q�E������a��!�$�����a��$�'rc��d�}|d�}t|�}|j|d�d�|j|jd�d�y)Nc3�&�K�d�fd�������y�w)N�x:c����|zSr�r)r�r-s �rr&z6TestCase.test_yield_send.<locals>.fn.<locals>.<lambda>Us����A��rr�r-s`rrOz$TestCase.test_yield_send.<locals>.fnTs������o�.�/�0�0�s�r}r9�(�stringzx:string)rPr*�send)rrOr��
the_lambdas    r�test_yield_sendzTestCase.test_yield_sendSsH��	1�
�r�F���!�W�
�����A���+��������)�:�6rc�4�|jd�d�|jd�d�|jd�d�|jd�d�|jd�d�|jd�d�|jd�d�|jd�d�y)Nr-zeric'szxeric"syzxeric"szeric"syr�r6s r�+test_expressions_with_triple_quoted_stringsz4TestCase.test_expressions_with_triple_quoted_strings\s������G�9�s�+����L�>�H�5�	
���0�1�J�?����,�-�	�:����,�-�	�:����4�5�
�C����8�9�J�G����9�:�Z�Hrc��d}d}|j|�|��d�|jd|�|��d�|j|�d|��d�|j|�|�d�d�|jd|�d|��d	�|jd|�|�d�d
�|j|�d|�d�d�|jd|�d|�d�d
�y)N�br��98abcr#�X98abc�98Xabc�98abcX�Y�X98Yabc�X98abcY�98XabcY�Z�X98YabcZr��rr-r.s   r�test_multiple_varszTestCase.test_multiple_varshs����������A�3�q�c��G�,����1�Q�C��s��X�.����A�3�a��s��X�.����A�3�q�c���X�.����1�Q�C�q����i�0����1�Q�C��s�!��i�0����A�3�a��s�!��i�0����1�Q�C�q���1��z�2rc�~�d�}|j|d��d�|j|d��d�y)Nc����fd�}|S)Nc���d���S)NrTrrVs�r�innerz3TestCase.test_closure.<locals>.outer.<locals>.innerys����A�3�x�rr)r-ros` r�outerz$TestCase.test_closure.<locals>.outerxs
���
 ��Lr�987zx:987rJzx:7r�)rrps  r�test_closurezTestCase.test_closurews9��	�
	
�����u����1������q���U�+rc�|��d��fd�}|j|dd�d�d}|j|dd�d�y)NrGc���d|�z|�d���S)N�x=r'r)r-r�r.s  �rr�z"TestCase.test_arguments.<locals>.f�s�����!��U�G�0�8�}�%�%r�foor}zx=foofoo    �barzx=        20r�)rr�r-r.s   @r�test_argumentszTestCase.test_arguments�s@���
��	&�	
����5�"��~�6�������2�r��N�3rc�2�d}|jd|��d�y)N�{�v:zv:123r�)rrQs  r�test_localszTestCase.test_locals�s�������2�e�W��w�/rc�j�|jt�5dt��ddd�y#1swYyxYw)Nr{)r��	NameErrorrQr6s r�test_missing_variablezTestCase.test_missing_variable�s.��
�
�
�y�
)�	����L�	�	�	�s�
)�2c��Gd�d�}|j|�d�d�|j|��d�|j|���d�|jd��d�|jd��d�y)Nc��eZdZd�Zy)�,TestCase.test_missing_format_spec.<locals>.Oc��|sy|S)N�*rrs  rrz7TestCase.test_missing_format_spec.<locals>.O.__format__�s
�����rNrrrr�Or��s��
rr�r-r�rIr r�)rr�s  r�test_missing_format_specz!TestCase.test_missing_format_spec�sv��	�	�	
���A�C��7�S�)����A�C�5�3�'����A�C�q�6�C�(����A�Q�4�#�&����A�q�6�C�(rc�<�|jdt��d�|jdt��d�d}|jdt�d|��d�|jdt��d�|jdt�d|��d�|jdt��y)	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_locals  r�test_globalzTestCase.test_global�s������2�h�Z��*=�>����2�h�\�*�,A�B�"�����2�h�Z�s�7�)�4�=�	?����2�h�\�*�.�	0����2�h�Z�s�7�+�6�?�	A�	
�
�
�.�8�*�>rc���d}|jd|��d�|jd|��d�d}|jd|�d|��d�|jd|��d�|jd|�d|��d�y)	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'r�)rr�r�s   r�test_shadowed_globalzTestCase.test_shadowed_global�s���#�����2�h�Z��*<�=����2�h�\�*�,@�A�"�����2�h�Z�s�7�)�4�<�	>����2�h�\�*�-�	/����2�h�Z�s�7�+�6�>�	@rc�<�d�}|j|d��d�y)Nc��dt|�zS)Nrur
rVs rrvzTestCase.test_call.<locals>.foo�s���#�a�&�=� rr}zx=10r�)rrvs  r�	test_callzTestCase.test_call�s��	!�	
���C��G�9�v�.rc�d�d}|jd�dz�d�|j|�dz�d�y)NrorrI�000�555r�)rr.s  r�test_nested_fstringszTestCase.test_nested_fstrings�s7��
�����q�c�1�H�:��.����q�c�1�H�:��.rc��gd�}|D�cgc]}|jdd���}}|jtd||z�ycc}w)N)zfu''zuf''zFu''zfU''zUf''zuF''zufr''zurf''zfur''zfru''zrfu''zruf''zFUR''zFur''zfb''zfB''zFb''zFB''zbf''zbF''zBf''zBF''r��"r�)�replacerr�)r�single_quote_casesr?�double_quote_casess    r�test_invalid_string_prefixesz%TestCase.test_invalid_string_prefixes�sP��&��,BT�T��d�l�l�3��4�T��T����K�)9�.�1C�C�	E��Us�?c	�X�|jd�d�|jd�d�|jd�d�|jd�d�|jddD��cic]\}}||��
c}}��d�|jddD��cic]\}}||��
c}}��d�ycc}}wcc}}w)NrIr zexpr=))rHrGzexpr={1: 2}r�rjs   r�test_leading_trailing_spacesz%TestCase.test_leading_trailing_spaces�s������Q�4�#�&����a�5�3�'����A�4�#�&����A�5�3�'����5�J�"?�D�A�q�1�a�4�"?� @�A�&�	(����5�J�"?�D�A�q�1�a�4�"?� A�B�&�	(��#@��"?s�
B �
B&c��|jddk7�d�|jddk7��d�|jddk7�d�|jddk7d�d�y)NrIr9�Truez.3�Trur�r6s r�test_not_equalzTestCase.test_not_equal�s`��
	
���A�q�D�6�F�+����A�q�D��7�V�,����A�q�D�8�f�-����A�q�D�2�;��/rc�0�|jddk(�d�y)NrrH�Falser�r6s r�test_equal_equalzTestCase.test_equal_equal�s��	
���A�q�D�6�G�,rc�,�|jdd�d�|jdd�d�|jdd�d�|jdd�d�|jd�d�|jd�d�|jd�d�|jd�d�|jdd�d�|jd	�d	�|jdd
�d�|jtdgd
��|jtdgd��dD]#}|jtd|zd|zdzg��%dD] }|jtdd|zdzg��"dD] }|jtdd|zdzg��"|jtdgd��y)Ng��Q�	@z10.10z
      3.14z
3.14      r�z'a'rIr za!rz!<10.10z
3.14!!!!!!�f-string: expecting '}')�f'{3!'�f'{3!s'zf'{3!g'z&f-string: missing conversion character)zf'{3!}'zf'{3!:'zf'{3!:}')r��A�G�äuɐzDf-string: invalid conversion character %r: expected 's', 'r', or 'a'zf'{3!z}')r �!r�)z sz s zFf-string: conversion type must come right after the exclamanation markzFf-string: invalid conversion character 'ss': expected 's', 'r', or 'a')z	f'{3!ss}'z
f'{3!ss:}'zf'{3!ss:s}'r�)r�conv_identifier�conv_non_identifier�convs    r�test_conversionszTestCase.test_conversions�s������D��<�,�7����D�5�>�L�9����D�5�>�L�9����D�5�>�L�9����C�5�3�'����C�7�U�+����C�7�U�+�	
���A�7�S�)����D�U�+�l�;�	
���E�7�U�+�	
���D��>�L�9����K�)B��	 �	
���K�)Q��	 � 9�	D�O�����!<�>M�!N�!(�?�!:�T�!A� B�
D�	D�$,�	H������ H�!(�+>�!>��!E� F�
H�	H�
 �	9�D�����!6�!(�4��$�!6� 7�
9�	9�	
���K�8��	 rc�6�|jtdgd��y)Nr�)zf'' = 3z
f'{0}' = xz
f'{x}' = xr�r6s r�test_assignmentzTestCase.test_assignment5s�����K�):��	 rc�6�|jtdddg�y)Nr�zdel f''z
del '' f''r�r6s r�test_delzTestCase.test_del<s �����K�)9�&�)��	 rc�@�|jtdgd��|jtdgd��|jtddg�|jd�d�|jd�d�|jd	d�d
��d�|jdd�d
��d
�y)Nz#f-string: single '}' is not allowed)zf'{{}'zf'{{}}}'zf'}'zf'x}'zf'x}x'z
f'\u007b}'zf'{3:}>10}'zf'{3:}}>10}'r�)zf'{3'r�zf'{3:'r�zf'{3!s:'z	f'{3!s:3'zf'x{'zf'x{x'zf'{x'zf'{3:s'zf'{{{'zf'{{}}{'zf'{'zf'{i='r�zf'{3:{{>10}'r�r�rIz>10z
}}}}}}}}}3rGz
{{{{{{{{{2)rr�r*r6s r�test_mismatched_braceszTestCase.test_mismatched_bracesBs������K�)N�
�	 �	
���K�)B��	 �"	
���K�N�+��	 �	
���C�5�3�'����C�5�3�'����A�s�e�3�Y�<�,�7����A�s�e�3�Y�<�,�7rc����fd�}�fd�}�fd�}|dd�|dd�|dd�|dd�|dd�|dd�y)Nc�>��d}|�rd}nd}�j||�y�NrrHrGr��r-�expected�flagrs   �r�test_fstringz2TestCase.test_if_conditional.<locals>.test_fstringqs)����D���v��������T�8�,rc�>��d}|�rd}nd}�j||�yr�r�r�s   �r�test_concat_emptyz7TestCase.test_if_conditional.<locals>.test_concat_emptyys)����D��C�y��������T�8�,rc�B��d}d|��rd}nd}�j||�y)Nrr�rHrGr�r�s   �r�test_concat_non_emptyz;TestCase.test_if_conditional.<locals>.test_concat_non_empty�s+����D��a�S�z��������T�8�,rr'rGr�rHr)rr�r�r�s`   r�test_if_conditionalzTestCase.test_if_conditionallsP���
	-�	-�	-�	�R����S�!���"�a� ��#�q�!��b�!�$��c�1�%rc��d}|j|�d�|j|��d�|j|��d�|j|��d�y)N�testz'test'r�r�s  r�test_empty_format_specifierz$TestCase.test_empty_format_specifier�sU�������A�3��(����A�Q�4�&�)����A�q�6�F�+����A�q�6�H�-rc��ddd�}d}|j|d�d�|j|d�d�|j||�d�|jdj|��d�|jdj|��d�y)	NrX�integer)r�rrr�z{d[a]})r�z{d[0]})r*r+)rr�r�s   r�test_str_format_differencesz$TestCase.test_str_format_differences�s�����
��
�����A�a�D�6�I�.����A�c�F�8�h�/����A�a�D�6�I�.�������1��-�x�8�������1��-�y�9rc�h�|jtdddg�|jtdddg�y)N�unsupportedzf'{(lambda: 0):x}'zf'{(0,):x}'zUnknown format codezf'{1000:j}')rr�r�r6s r�test_errorszTestCase.test_errors�s?�����I�}�2�+��	 �	
���J�(=�+�+��	rc�P�t�5}tjj|d�}t	|dd��5}|jd�ddd�t
|d��\}}}ddd�|jjdd��y#1swY�ExYw#1swY�8xYw)	Nzt.pyrG�utf-8)�encodingzf"{a b}"�ascii)�PYTHONIOENCODING�backslashreplace)	r�os�path�join�open�writerr��encode)r�cwd�	file_pathr�rx�stderrs      r�test_filename_in_syntaxerrorz%TestCase.test_filename_in_syntaxerror�s���
�Z�	K�3������S�&�1�I��i��w�7�
$�1����
�#�
$�0��BI�K�L�A�q�&�		K�	
�
�
�i�&�&�w�0B�C�V�L�	
$�
$��	K�	K�s"�/B�B�B�B	�B�B%c�f�td�D]#}|jd|��dt|�z��%y)Ni�zi:)r�r*r)rr�s  r�	test_loopzTestCase.test_loop�s3���t��	6�A����r�!��X�t�c�!�f�}�5�	6rc��dddd�}|j|d�d�|j|d�d�|j|d�d�|j|d�d�y)N�dquote�squoterw)r�r�rvr�r�rvr�r�s  r�	test_dictzTestCase.test_dict�sl�����
��	
���a��f�X�(�3����a��f�X�(�3����A�e�H�:��.����A�e�H�:��.rc�p�|jtd�d�|jtd�d�y)Nzf"\
"r'zf"\
")r*rr6s r�test_backslash_charzTestCase.test_backslash_char�s,��	
����i��"�-�����i��"�-rc	�z	��d�|jd���dt��z�|jd���dt��z�|jd���dt��z�|jd���dt��z�|jd���dt��z�d�|jd�d��dt	�d�z�|jd����dt	�d�z�|jd�d��dt	t��d�z�|jd�d��dt	t��d�z�|jd�d��dt	t��d�z�d�|jd	d
�zdz��d�d
}|jd|d��d�|jdd��d�|jddd��d�d�d}|jd|�d�d�|jdd
��d�|jddk(�d �|jddk7�d!�|jddk�d!�|jddk\�d �|jd"x��d"�|j�d"�|jd#x��d"�|j�d#�|jd$�d$�d%�|j�d&�d'��fd(�}d�|j|d)�*��d+�|j�d)�|j|d,�*��d)�|j�d,�Gd-�d.�}|jd/|���d0�|jd/|���d0�|jd/|����d1�|jd/|�d2��d3�|jd/|�d4��d5�|jd/|�d��d6�|jttd7�d8�|jd9��d:�d9t��zd:z�|jd;��d:�d;t��zd:z�|jd<��d:�d<t��zd:z�|jd=��d:�d=t��zd:z�|jd>d?d?d@�dA���dB�|jdCd
��dD�y)ENzA stringruzx =g����	�@z.2fr'z^20�	z3*x+15=rIr�z	3*x+15=42gffffff?@utenπ=utenπ=31.40u"Σ"=uΣu	"Σ"='Σ'z3.1415=go���!	@z.1fz*^20z*****3.1415=3.1*****uπualpha α pi=u	 ω omegaualpha α pi='π' ω omegaz
3
=z
3
=3rrHr�r��5ro�=��=10�
        20c����}|�|Sr�r)r��oldxr-s  �rr�z)TestCase.test_debug_conversion.<locals>.f	s����D��A��Krz3=)r�r�r9c��eZdZd�Zd�Zy)�)TestCase.test_debug_conversion.<locals>.Cc��d|��S)NzFORMAT-r)rr�s  rrz4TestCase.test_debug_conversion.<locals>.C.__format__s�� ���}�$rc��y)N�REPRrr6s r�__repr__z2TestCase.test_debug_conversion.<locals>.C.__repr__s��rN)r r!r"rr�rrr�Cr�s��
%�
rr�zC()=zC()=REPRzC()=FORMAT-r�zC()=FORMAT- r-zC()=FORMAT-xzC()=********REPR********zf'{C=]'rvzXx=rdzXx  =zXx=  zXx  =  zsadsd 1 + 1 =  rG�1dr�zsadsd 1 + 1 =  2.000000z	1+2 = 
  z
1+2 = 
  3)r*�reprrr�r+r�r�r)r�tenπ�pir�r�r-s     @r�test_debug_conversionzTestCase.test_debug_conversion�s���������B�A�4��$��a��.�1����C�A�5��5�4��7�?�3����B�A�6��D�3�q�6�M�2����B�A�6��D�4��7�N�3����B�A�6��D�5��8�O�4������B�A�s�8��d�V�A�u�-=�&=�>����B�A�a�5��4�&��B�-�#7�8����B�A��:���v�d�1�g�u�/E�(E�F����B�A��:���v�c�!�f�e�/D�(D�E����B�A��:���v�e�A�h��/F�(F�G�
�����G�A�a�C��F�9��{�3������F�E�3�<��-�8�	
���E�D�7��]�3�	
���w�v�s�m�,�T�2�5K�L������=�R�E��3�5P�Q�	
��������	�	
���A�q�D�6�G�,����A�q�D�6�F�+����A�q�D�6�F�+����A�q�D�6�G�,�����V�Q�:��,�����C� �����T�Q�8�c�*�����A�����C�5�3�'���	
���A�c�7�\�2�	�

�����A��I�;��-�����D�!����A��F�8�d�+�����A��	�	�	
���D�A�C�6��J�/����D�A�C�8��j�1����D�A�C��7��]�3����D�A�C��8��n�5����D�A�C��8��n�5����D�A�C�4�=�)�+E�F����+�t�Y�7�
�����4�Q�D���E�$�q�'�M�#�$5�6�	
���6�Q�F�!��g�d�1�g�o�c�&9�:����6�Q�F�!��g�d�1�g�o�c�&9�:����8�Q�H�A��	�$�q�'�(9�#�(=�>����+�%�U�2�J�a�<�!8�9�;T�U�����C����	rc�~�d}|j|d�d�|jdx}�d�|j|d�y)Nr�r�r�r}r1r�r�s  r�test_walruszTestCase.test_walrus:sE����	
���A�c�7�\�2�	
����U�Q�9�t�,�����B�rc�t�|jtd�5tddd�ddd�y#1swYyxYw)N�/f-string: expecting '=', or '!', or ':', or '}'z
f'{a $ b}'�?r<�r
r�r?r6s r�!test_invalid_syntax_error_messagez*TestCase.test_invalid_syntax_error_messageDs7��
�
#�
#�K�$U�W�	/��L�#�v�.�	/�	/�	/�s�.�7c��tjd�}|jt|�5dd�ddd�y#1swYyxYw)NzCannot specify ',' with ','.rHz,,��re�escaper
r��r�	error_msgs  r�(test_with_two_commas_in_format_specifierz1TestCase.test_with_two_commas_in_format_specifierI�=���I�I�<�=�	�
�
#�
#�J�	�
:�	���f�	�	�	��	�:�Ac��tjd�}|jt|�5dd�ddd�y#1swYyxYw)NzCannot specify '_' with '_'.rH�__rrs  r�,test_with_two_underscore_in_format_specifierz5TestCase.test_with_two_underscore_in_format_specifierNr
rc��tjd�}|jt|�5dd�ddd�y#1swYyxYw)N� Cannot specify both ',' and '_'.rHz,_rrs  r�8test_with_a_commas_and_an_underscore_in_format_specifierzATestCase.test_with_a_commas_and_an_underscore_in_format_specifierS�=���I�I�@�A�	�
�
#�
#�J�	�
:�	���f�	�	�	�rc��tjd�}|jt|�5dd�ddd�y#1swYyxYw)NrrHz_,rrs  r�7test_with_an_underscore_and_a_comma_in_format_specifierz@TestCase.test_with_an_underscore_and_a_comma_in_format_specifierXrrc���|jtd�5tddd�ddd�|jtd�5tddd�ddd�y#1swY�6xYw#1swYyxYw)Nz!can't use starred expression herezf'{*a}'rr<r�zf'{**a}'rr6s r�)test_syntax_error_for_starred_expressionsz2TestCase.test_syntax_error_for_starred_expressions]sp��
�
#�
#�K�1T�
U�	,��I�s�F�+�	,��
#�
#�K�$V�X�	-��J��V�,�	-�	-�	,�	,��	-�	-�s�A�A&�A#�&A/c�$�|jtdddg�|jtdddg�d}	t|dd	�y#t$rB}|j|jd
�|j|j
d�Yd}~yd}~wwxYw)Nzunterminated f-string literalzf"r�z+unterminated triple-quoted f-string literalzf"""zf'''zNx = 1 + 1
y = 2 + 2
z = f"""
sdfjnsdfjsdf
sdfsdfs{1+
2} dfigdf {3+
4}sdufsd""
rr<zz = f"""rI)rr�r?r*�textrO)r�data�es   r�test_not_closing_quotesz TestCase.test_not_closing_quoteses������K�)H�4�QU�,�W����K�)V�#�V�,�	.���	*��D�#�v�&���	*����Q�V�V�Z�0����Q�X�X�q�)�)��	*�s�
A�	B�
8B
�
Bc�h�|jtdgd��|jtdddg�y)Nr�)z	f'{1=}{;'z
f'{1=}{+;'zf'{1=}{2}{;'zf'{1=}{3}{;'r�z
f'{1=}{1;'zf'{1=}{1;}'r�r6s r�test_syntax_error_after_debugz&TestCase.test_syntax_error_after_debugxs:�����K�)[��	�	
���K�)Z� ,� -��	rc�f�t�5d}tdd�5}|jd�ddd�t|�\}}}ddd�|j	jd�j
�jdd�jdd�d�y#1swY�pxYw#1swY�exYw)	N�	script.pyrGzprint(f'''{
3
=}''')r�z
r��
z3
=3)rr�r�rr*�decode�stripr�)r�scriptr�rx�stdouts     r�test_debug_in_filezTestCase.test_debug_in_file�s���
�Z�	4� �F��k�3�'�
�1������
�,�F�3�L�A�v�q�	4�	
������w�/�5�5�7�?�?���M�U�U�VZ�\`�a� �	"�
�
��	4�	4�s!�B'�B�B'�B$	� B'�'B0c�Z�t�5d}t|d�5}|jd�ddd�t|�\}}}|j	d|�|jt
|j�j��d�ddd�y#1swY�jxYw#1swYyxYw)NrrGzprint(f'\{1}')s\1rG)	rr�r�rr�r*rLr"�
splitlines)rr#r�rxr$r�s      r�.test_syntax_warning_infinite_recursion_in_filez7TestCase.test_syntax_warning_infinite_recursion_in_file�s���
�Z�	B� �F��f�c�"�
+�a����)�*�
+�!1�� 8��A�v�v��M�M�&�&�)����S�����!:�!:�!<�=�q�A�	B�	B�
+�
+��	B�	B�s"�B!�B�A B!�B	�B!�!B*N)[r r!r"rr/rEr_rirmrrrzrr�r�r�r�r�r�r�r�r��skipIfr�is_wasir�r�r�r�r�r�r�r�rrrrrrrr!r%r'r*r3r5r7rCrHrJrLrQr[r]rkrrrxr|rr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr	rrrrrrr%r(rrrrrs	���=�6"�04�>26�h+.�Z@5�D2�.MM�^q5�f5�$%�%�'� �$�
 ��X�_�_�W�_�_�&F�G�E�H�E�.�X�_�_�W�_�_�&F�G�
:�H�
:�;�! �F# �J1 �f0�2 �BA�	,�; �z
 �6�
84�t �&
 �#�&W��
'�8'�
9�/�&@�,�Q�	(�7�
I�
3�,�4�0��)�?�@�/�/�
E�6	(�0�-�8 �t � �(8�T$&�L.�	:�	�M�6�	/�.�a�X �/�
�
�
�
�
-�*�&�"�Brr�__main__)r=r�rr(r�r�rEr�r�test.support.os_helperr�test.support.script_helperrrr�rr �mainrrr�<module>r/s[���	�	������+�N���}B�x� � �}B�~3�z���H�M�M�O�r