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_undo.cpython-311.opt-1.pyc
�

��Vc����dZddlmZddlZddlmZed��ddlmZddlm	Z	m
Z
ddlmZGd	�d
ej
��Zedkrejdd
���dSdS)zTest undo, coverage 77%.�)�
UndoDelegatorN)�requires�gui)�Mock)�Text�Tk)�
Percolatorc�j�eZdZed���Zed���Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
dS)�UndoDelegatorTestc��t��|_t|j��|_t	|j��|_dS�N)r�rootr�textr	�
percolator��clss �/D:\Python311\Lib\idlelib\idle_test\test_undo.py�
setUpClasszUndoDelegatorTest.setUpClasss1���4�4������>�>���#�C�H�-�-�����c��|jj���|`|`|j���|`dSr
)r�redir�closerr�destroyrs r�
tearDownClasszUndoDelegatorTest.tearDownClasss?�����"�"�$�$�$��N�C�H���������H�H�Hrc��t��|_t��|j_|j�|j��dSr
)r�	delegatorr�bellr�insertfilter��selfs r�setUpzUndoDelegatorTest.setUps9��&�����"�f�f������$�$�T�^�4�4�4�4�4rc��|j�|j��|j�dd��|j���dS)N�1.0�end)r�removefilterrr�delete�
resetcachers r�tearDownzUndoDelegatorTest.tearDown"sL����$�$�T�^�4�4�4��	�����&�&�&���!�!�#�#�#�#�#rc��|j}|�dd��|�dd��|�d��|�|�dd��d��|�dd��|�dd	��|�d
d��|�dd��|�d��|�|�dd��d
��|�d��|�|�dd��d��|�d��|�|�dd��d��|�d��|j�d��|�|jj	j
��dS)N�insert�foobar�h�<<undo>>r#r$�
�foo�bar�1.2�1.4�hello�foarz1.6�1.3�event)rr*�event_generate�assertEqual�getr&r�
undo_event�
assertTruer�called�r rs  r�test_undo_eventz!UndoDelegatorTest.test_undo_event's����y�����H�h�'�'�'����H�c�"�"�"����J�'�'�'�������%��/�/��6�6�6����H�e�$�$�$����H�e�$�$�$����E�5�!�!�!����H�g�&�&�&����J�'�'�'�������%��/�/��8�8�8����J�'�'�'�������%��/�/��:�:�:����J�'�'�'�������%��/�/��7�7�7����J�'�'�'���!�!�'�*�*�*������+�2�3�3�3�3�3rc��|j}|�dd��|�dd��|�dd��|�d��|�d��|�|�dd��d��|�d��|�|jjj	��dS)Nr*r/r0r#r5r-z<<redo>>)
rr*r&r7r8r9r;rrr<r=s  r�test_redo_eventz!UndoDelegatorTest.test_redo_event=s����y�����H�e�$�$�$����H�e�$�$�$����E�5�!�!�!����J�'�'�'����J�'�'�'�������%��/�/��7�7�7����J�'�'�'������+�2�3�3�3�3�3rc�X�|j}|j}|�dd��|�dd��|�dd��|�|j|jfd��|�d��|�|j|jfd��d	S)
z�
        Dump_event cannot be tested directly without changing
        environment variables. So, test statements in dump_event
        indirectly
        r*r/r0r1r2)�Tr-)�FN)rrr*r&�assertTupleEqual�pointer�	can_merger7)r r�ds   r�test_dump_eventz!UndoDelegatorTest.test_dump_eventIs����y���N�����H�e�$�$�$����H�e�$�$�$����E�5�!�!�!����q�y�!�+�6�	�B�B�B����J�'�'�'����q�y�!�+�6�
�C�C�C�C�Crc�R�|j}|�|�����|j�dd��|�|�����t
��|_|�d��|�	|j
|j��|�|jj��|�d��|�	|jd��|�|jj��dS)Nr*�aTF���)
rr;�	get_savedrr*�assertFalser�saved_change_hook�	set_savedr8rE�savedr<)r rGs  r�test_get_set_savedz$UndoDelegatorTest.test_get_set_savedYs���
�N��������
�
�&�&�&��	����3�'�'�'���������'�'�'�"�f�f���	���D���������A�G�,�,�,�����+�2�3�3�3�	���E���������"�%�%�%�����+�2�3�3�3�3�3rc�4�|j}|�dd��|j���|�dd��|�dd��|j���|�|�dd��d��|j���|�dd��|j���|�|�dd��d��dS)Nr*r/r0r#r5)rr*r�undo_block_start�undo_block_stopr8r9r=s  r�test_undo_start_stopz&UndoDelegatorTest.test_undo_start_stopls����y�����H�e�$�$�$���'�'�)�)�)����H�e�$�$�$����H�e�$�$�$���&�&�(�(�(�������%��/�/��7�7�7�	
��'�'�)�)�)����H�e�$�$�$���&�&�(�(�(�������%��/�/��7�7�7�7�7rc���|j}dx|j_}t|dz��D]E}|�dd��|�t
|jj��|���FdS)N�
r*r/)rr�max_undo�ranger*�assertLessEqual�len�undolist)r rrX�is    r�test_addcmdzUndoDelegatorTest.test_addcmd}s{���y��-/�/����(��x�"�}�%�%�	I�	I�A��K�K��%�(�(�(�� � ��T�^�%<�!=�!=�x�H�H�H�H�	I�	IrN)�__name__�
__module__�__qualname__�classmethodrrr!r(r>r@rHrQrUr^�rrrrs��������.�.��[�.�
����[��5�5�5�
$�$�$�
4�4�4�,
4�
4�
4�D�D�D� 4�4�4�&8�8�8�"I�I�I�I�Irr�__main__rCF)�	verbosity�exit)�__doc__�idlelib.undor�unittest�test.supportr�
unittest.mockr�tkinterrr�idlelib.percolatorr	�TestCaserr_�mainrcrr�<module>rps�����'�&�&�&�&�&�����!�!�!�!�!�!���������������������)�)�)�)�)�)�uI�uI�uI�uI�uI��)�uI�uI�uI�p�z��+��H�M�A�E�*�*�*�*�*�*�+�+r