Current File : //usr/local/apps/python3/lib/python3.11/test/__pycache__/test_eof.cpython-311.pyc
�

�Ke���dZddlZddlmZddlmZddlmZddlZGd�dej��Z	e
dkrej��dSdS)	z/test script for a few new invalid token catches�N)�support)�	os_helper)�
script_helperc�l�eZdZd�Zd�Zd�Zd�Zd�Zej	e
jd��d���ZdS)	�EOFTestCasec��d}dD]u}	t|�d���tj�#t$rH}|�t|��|��|�|jd��Yd}~�nd}~wwxYwdS)NzCunterminated string literal (detected at line 1) (<string>, line 1))�'�"zthis is a test                ���evalr�
TestFailed�SyntaxError�assertEqual�str�offset)�self�expect�quote�msgs    �7/usr/local/apps/python3/lib/python3.11/test/test_eof.py�test_EOF_single_quotez!EOFTestCase.test_EOF_single_quote
s���V�� �	)�	)�E�
)��%��������(�(��	�
0�
0�
0�� � ��S���6�2�2�2�� � ���Q�/�/�/�/�/�/�/�/�����
0����		)�	)s�&�
A8�>A3�3A8c���d}	td��tj�#t$rI}|�t|��|��|�|jd��Yd}~dSd}~wwxYw)NzQunterminated triple-quoted string literal (detected at line 1) (<string>, line 1)z'''this is a testrr�rrrs   r�	test_EOFSzEOFTestCase.test_EOFSs���e��	%��(�)�)�)�
�$�$��	�	,�	,�	,����S��X�X�v�.�.�.����S�Z��+�+�+�+�+�+�+�+�+�����	,���s��
A2�>A-�-A2c���d}tj��5}tj|dd��}tj|��\}}}ddd��n#1swxYwY|�d|��dS)Nz(<string>, line 1)�fooz'''this is 
a 
tests>unterminated triple-quoted string literal (detected at line 3)�r�temp_dirr�make_script�assert_python_failure�assertIn)rrr�	file_name�rc�out�errs       r�test_EOFS_with_filezEOFTestCase.test_EOFS_with_file s���&��
�
�
!�
!�	J�X�%�1�(�E�C^�_�_�I�(�>�y�I�I�L�B��S�	J�	J�	J�	J�	J�	J�	J�	J�	J�	J�	J����	J�	J�	J�	J�	
�
�
�W�Y\�]�]�]�]�]s�/A�A�Ac��d}	tdddd���tj�#t$r.}|�t|��|��Yd}~dSd}~wwxYw)N�/unexpected EOF while parsing (<string>, line 1)z"\xhh" \z<string>�execT)�dont_inherit)�compilerrrrrrs   r�test_eof_with_line_continuationz+EOFTestCase.test_eof_with_line_continuation's}��B��	%��L�:�v�D�I�I�I�I��$�$���	/�	/�	/����S��X�X�v�.�.�.�.�.�.�.�.�.�����	/���s�#�
A�#A�Ac��d}|�t��5}td��ddd��n#1swxYwY|�t	|j��|��|�t��5}td��ddd��n#1swxYwY|�t	|j��|��dS)z=A continuation at the end of input must be an error; bpo2180.r)zx = 5\N�\)�assertRaisesrr*rr�	exception)rr�excinfos   r�test_line_continuation_EOFz&EOFTestCase.test_line_continuation_EOF0s1��B��
�
�
�{�
+�
+�	�w���O�O�O�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�����W�.�/�/��8�8�8�
�
�
�{�
+�
+�	�w���J�J�J�	�	�	�	�	�	�	�	�	�	�	����	�	�	�	�����W�.�/�/��8�8�8�8�8s�9�=�=�B"�"B&�)B&zsys.executable requiredc��tj��5}tj|dd��}tj|��\}}}|�d|��|�d|��|�d|��tj|dd��}tj|��\}}}|�d|��|�d|��|�d|��ddd��dS#1swxYwYdS)	z9Ensure tok_nextc() does not add too many ending newlines.rr/sunexpected EOF while parsingsline 1�\zy = 6\sy = 6\Nr)rrr#r$r%r&s      r�,test_line_continuation_EOF_from_file_bpo2180z8EOFTestCase.test_line_continuation_EOF_from_file_bpo2180:sB���
�
!�
!�	+�X�%�1�(�E�4�H�H�I�(�>�y�I�I�L�B��S��M�M�9�3�?�?�?��M�M�)�S�)�)�)��M�M�%��%�%�%�%�1�(�E�9�M�M�I�(�>�y�I�I�L�B��S��M�M�9�3�?�?�?��M�M�)�S�)�)�)��M�M�*�c�*�*�*�	+�	+�	+�	+�	+�	+�	+�	+�	+�	+�	+�	+����	+�	+�	+�	+�	+�	+s�C!D�D�	DN)
�__name__�
__module__�__qualname__rrr'r-r3�unittest�skipIf�sys�
executabler6��rrr	s�������
)�
)�
)�%�%�%�^�^�^�%�%�%�9�9�9��X�_���'�)B�C�C�
+�
+�D�C�
+�
+�
+r?r�__main__)�__doc__r<�testr�test.supportrrr:�TestCaserr7�mainr>r?r�<module>rFs���5�5�
�
�
�
�������"�"�"�"�"�"�&�&�&�&�&�&�����?+�?+�?+�?+�?+�(�#�?+�?+�?+�B�z����H�M�O�O�O�O�O��r?