HEX
Server: Microsoft-IIS/10.0
System: Windows NT ITPWINWEBSVR22 10.0 build 20348 (Windows Server 2022) AMD64
User: www.conferencesearch.co.uk (0)
PHP: 8.3.30
Disabled: NONE
Upload Files
File: D:/Python311/Lib/idlelib/idle_test/__pycache__/test_hyperparser.cpython-311.opt-2.pyc
�

��Vc�$���	ddlmZddlZddlmZddlmZmZddlm	Z	Gd�d��Z
Gd�d	ej��Ze
d
krejd���dSdS)
�)�HyperParserN)�requires)�Tk�Text)�EditorWindowc�0�eZdZd�ZejZejZdS)�DummyEditwinc�L�||_d|_d|_d|_d|_dS)N��>>>)�2i�i�)�text�indentwidth�tabwidth�prompt_last_line�num_context_lines)�selfrs  �6D:\Python311\Lib\idlelib\idle_test\test_hyperparser.py�__init__zDummyEditwin.__init__
s.����	������
� %���!.�����N)�__name__�
__module__�__qualname__rr�_build_char_in_string_func�is_char_in_string�rrr	r		s3������/�/�/�".�!H��$�6���rr	c�z�eZdZdZed���Zed���Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zd
�ZdS)�HyperParserTestu#"""This is a module docstring"""
# this line is a comment
x = "this is a string"
y = 'this is also a string'
l = [i for i in range(10)]
m = [py*py for # comment
       py in l]
x.__len__
z = ((r'asdf')+('a')))
[x for x in
for = False
cliché = "this is a string with unicode, what a cliché"c���td��t��|_|j���t	|j��|_t
|j��|_dS)N�gui)rr�root�withdrawrrr	�editwin��clss r�
setUpClasszHyperParserTest.setUpClass%sP��������4�4�������������>�>���"�3�8�,�,����rc�D�|`|`|j���|`dS�N)rr#r!�destroyr$s r�
tearDownClasszHyperParserTest.tearDownClass-s(���H�c�k���������H�H�Hrc�F�|j�d|j��dS)N�insert)rr,�code�rs r�setUpzHyperParserTest.setUp3s"���	����4�9�-�-�-�-�-rc�T�|j�dd��d|j_dS)N�1.0�endr)r�deleter#rr.s r�tearDownzHyperParserTest.tearDown6s*���	�����&�&�&�(-���%�%�%rc�.�	t|j|��Sr()rr#)r�indexs  r�
get_parserzHyperParserTest.get_parser:s��	��4�<��/�/�/rc�`�	|�t��5}|j�ddd��|�d��}ddd��n#1swxYwY|�dt
|j����d|j_	|�d��}|�
|j|j�dd����|j�
d|j�dd��dz��|�d	��}dS)
N�consoler1z1.endz1.5�precedes�r2�z54.5)�assertRaises�
ValueErrorr�tag_addr7�assertIn�str�	exceptionr#r�assertEqual�rawtext�getr,)r�ve�ps   r�	test_initzHyperParserTest.test_init@sE��	��
�
�z�
*�
*�	'�b��I���i���8�8�8�����&�&�A�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'�	'����	'�	'�	'�	'�	
�
�
�j�#�b�l�"3�"3�4�4�4�)+���%�
�O�O�E�"�"�������D�I�M�M�%��$?�$?�@�@�@�	
�	�����	�
�
�e�U� ;� ;�A� =�>�>�>��O�O�F�#�#���s�2A�A�!Ac���|j}|d��}|�|�����|d��}|�|�����|d��}|�|�����|d��}|�|�����|d��}|�|�����|d��}|�|�����|d��}|�|�����dS)Nr1z1.4z2.3z3.3z3.7z4.6z12.54)r7�assertFalse�is_in_string�
assertTrue�rrErGs   r�test_is_in_stringz!HyperParserTest.test_is_in_stringTs4���o���C��J�J��������)�)�*�*�*��C��J�J��������(�(�)�)�)��C��J�J��������)�)�*�*�*��C��J�J��������)�)�*�*�*��C��J�J��������(�(�)�)�)��C��J�J��������(�(�)�)�)��C��L�L��������(�(�)�)�)�)�)rc�l�|j}|d��}|�|�����|d��}|�|�����|d��}|�|�����|d��}|�|�����|d��}|�|�����|d��}|�|�����dS)Nr1z1.1z2.5z3.4z3.6z4.14)r7rL�
is_in_coderJrMs   r�test_is_in_codezHyperParserTest.test_is_in_codefs���o���C��J�J����������'�'�'��C��J�J����������(�(�(��C��J�J����������(�(�(��C��J�J����������'�'�'��C��J�J����������(�(�(��C��K�K����������(�(�(�(�(rc��|j}d�}d�}|d��}|�||����|�||����|d��}|�||��d��|�||��||����|d��}|�||��d��|�||��||����|d��}|�||��d	��|�||����|d
��}|�||����|�||����dS)Nc�.�|�d���S)NF��	mustclose��get_surrounding_brackets��parsers r�without_mustclosezGHyperParserTest.test_get_surrounding_bracket.<locals>.without_mustcloseys���2�2�U�2�C�C�Crc�.�|�d���S)NTrTrVrXs r�with_mustclosezDHyperParserTest.test_get_surrounding_bracket.<locals>.with_mustclose~s���2�2�T�2�B�B�Brz3.2z5.6)z5.4�5.25z5.23)z5.21z5.24z6.15)z6.4z6.endz9.end)r7�assertIsNone�assertTupleEqual)rrErZr\rGs     r�test_get_surrounding_bracketz,HyperParserTest.test_get_surrounding_bracketvs����o��	D�	D�	D�
	C�	C�	C�

�C��J�J�����.�.��+�+�,�,�,����+�+�A�.�.�/�/�/��C��J�J�����/�/��2�2�O�D�D�D����/�/��2�2�N�N�1�4E�4E�F�F�F��C��K�K�����/�/��2�2�4D�E�E�E����/�/��2�2�N�N�1�4E�4E�F�F�F��C��K�K�����/�/��2�2�4D�E�E�E����.�.��+�+�,�,�,��C��L�L�����.�.��+�+�,�,�,����+�+�A�.�.�/�/�/�/�/rc�&�|j}|d��}|�|���d��|d��}|�t��5}|���ddd��n#1swxYwY|�dt
|j����|d��}|�|���d��|d��}|�|���d��|d	��}|�|���d
��|d��}|�|���d��|d��}|�|���d
��|d��}|�|���d��|d��}|�t��5}|���ddd��n#1swxYwY|�dt
|j����|d��}|�|���d
��|d��}|�|���d
��|d��}|�|���d
��|d��}|�|���d
��|d��}|�|���d��|d��}|�|���d��dS)Nz4.2zy z4.7zis inside a coder]z	range(10)z6.7�pyz6.8r;z7.9z8.endz	x.__len__z9.13zr'asdf'z9.17z10.0z10.6z10.11z11.3z11.11�Falsez12.6�cliché)r7rC�get_expressionr=r>r@rArB)rrErGrFs    r�test_get_expressionz#HyperParserTest.test_get_expression�s����o���C��J�J������)�)�+�+�T�2�2�2��C��J�J��
�
�
�z�
*�
*�	�b�
������	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��
�
�(�#�b�l�*;�*;�<�<�<��C��K�K������)�)�+�+�[�9�9�9��C��J�J������)�)�+�+�T�2�2�2��C��J�J������)�)�+�+�R�0�0�0��C��J�J������)�)�+�+�T�2�2�2��C��L�L������)�)�+�+�[�9�9�9��C��K�K������)�)�+�+�Y�7�7�7��C��K�K��
�
�
�z�
*�
*�	�b�
������	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��
�
�(�#�b�l�*;�*;�<�<�<��C��K�K������)�)�+�+�R�0�0�0��C��K�K������)�)�+�+�R�0�0�0��C��L�L������)�)�+�+�R�0�0�0��C��K�K������)�)�+�+�R�0�0�0��C��L�L������)�)�+�+�W�5�5�5��C��K�K������)�)�+�+�Y�7�7�7�7�7s$� B�B�B�H,�,H0�3H0c�2�d�}|�|d����|�|d����|�|d����|�|d����|�|d����|�|d����|�|d����|�|d	����|�|d
����|�|d����|�|d����|�|d
����|�|d����|�|d����|�|d����|�|d����|�|d����|�tjddd��td����|�tjddd��td����|�tjddd��td����|�|d����|�|d����|�|d����|�|d����|�|d����|�|d����|�|d ����|�|d!����dS)"Nc���tj|dt|����}|t|��krdS|dkrdSd�|t|����}t	|���)NrTFz'Unexpected result: {} (expected 0 or {})r�_eat_identifier�len�format�	Exception)�	candidate�result�err_msgs   r�is_valid_idz8HyperParserTest.test_eat_identifier.<locals>.is_valid_id�su�� �0��A�s�9�~�~�N�N�F���Y���'�
)��t��1��
)��u�C�J�J��C�	�N�N���� ��(�(�(r�2notid�valid_id�	_valid_id�	valid_id_�
_2valid_id�Truerc�None�for�import�return�clicherdua٢�2au٢aua²z+ varr��varz+varr<z.var�+� �:�?�^�\�"z
"a string")rJrLrCrrirj)rrps  r�test_eat_identifierz#HyperParserTest.test_eat_identifier�s���
	)�
	)�
	)�	
�����X�.�.�/�/�/�	
�����J�/�/�0�0�0������K�0�0�1�1�1������K�0�0�1�1�1������L�1�1�2�2�2�	
�����F�+�+�,�,�,������G�,�,�-�-�-������F�+�+�,�,�,�	
�����U�+�+�,�,�,������X�.�.�/�/�/������X�.�.�/�/�/�	
�����H�-�-�.�.�.������I�.�.�/�/�/������E�*�*�+�+�+�	
�����T�*�*�+�+�+������U�+�+�,�,�,������U�+�+�,�,�,�	
����4�W�a��C�C�S��Z�Z�P�P�P�����4�V�Q��B�B�C��J�J�O�O�O�����4�V�Q��B�B�C��J�J�O�O�O�	
�����S�)�)�*�*�*������S�)�)�*�*�*������S�)�)�*�*�*������S�)�)�*�*�*������S�)�)�*�*�*������T�*�*�+�+�+������S�)�)�*�*�*������\�2�2�3�3�3�3�3rc	��tj}tdd��D�]k}|�|d|zd|��|��|�|d|zd|��|��|�|dd|dz
zzd|��|��|�|dd|dz
zzd|��|��|�|dd|dz
zzd|��|��|�|d|dz
zdzd|��|��|�|d|zd|��d��|�|dd|dz
zzd|��d��|�|dd|dz
zzd|��d����mdS)N���ar�é�2r)rri�rangerC)r�eat_id�lengths   r�#test_eat_identifier_various_lengthsz3HyperParserTest.test_eat_identifier_various_lengthss����,���A�r�l�l�		N�		N�F����V�V�C�&�L�!�V�<�<�f�E�E�E����V�V�D�6�M�1�f�=�=�v�F�F�F����V�V�C�#��!��*<�$<�a��H�H�&�Q�Q�Q����V�V�D�3�&�1�*�+=�$=�q�&�I�I�6�R�R�R����V�V�D�3�&�1�*�+=�$=�q�&�I�I�6�R�R�R����V�V�D�F�Q�J�$7�#�$=�q�&�I�I�6�R�R�R����V�V�C�&�L�!�V�<�<�a�@�@�@����V�V�C�#��!��*<�$<�a��H�H�!�L�L�L����V�V�C�$�&�1�*�*=�$=�q�&�I�I�1�M�M�M�M�		N�		NrN)rrrr-�classmethodr&r*r/r4r7rHrNrQr`rfr�r�rrrrrs�������
H�	��-�-��[�-�����[��
.�.�.�.�.�.�0�0�0�$�$�$�(*�*�*�$)�)�)� 0�0�0�B28�28�28�h74�74�74�rN�N�N�N�Nrr�__main__�)�	verbosity)�idlelib.hyperparserr�unittest�test.supportr�tkinterrr�idlelib.editorrr	�TestCaserr�mainrrr�<module>r�s���!�+�+�+�+�+�+�����!�!�!�!�!�!���������'�'�'�'�'�'�	7�	7�	7�	7�	7�	7�	7�	7�{N�{N�{N�{N�{N�h�'�{N�{N�{N�|�z����H�M�A��������r