HEX
Server: Apache
System: Linux p3plzcpnl506847.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: slfopp7cb1df (5698090)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/python38/lib/python3.8/idlelib/idle_test/__pycache__/test_autoexpand.cpython-38.pyc
U

�i�_�@sldZddlmZddlZddlmZddlmZmZGdd�d�Z	Gdd	�d	ej
�Zed
krhej
dd�dS)
zTest autoexpand, coverage 100%.�)�
AutoExpandN)�requires)�Text�Tkc@seZdZdd�ZdS)�DummyEditwincCs
||_dS�N)�text)�selfr�r
�@/opt/python38/lib/python3.8/idlelib/idle_test/test_autoexpand.py�__init__szDummyEditwin.__init__N)�__name__�
__module__�__qualname__rr
r
r
rr	src@sTeZdZedd��Zedd��Zdd�Zdd�Zd	d
�Zdd�Z	d
d�Z
dd�ZdS)�AutoExpandTestcCs<td�t�|_t|j�|_tt|j��|_dd�|j_dS)NZguicSsdSrr
r
r
r
r�<lambda>�z+AutoExpandTest.setUpClass.<locals>.<lambda>)	rr�tkrrrr�auto_expandZbell��clsr
r
r�
setUpClasss
zAutoExpandTest.setUpClasscCs$|`|`t|d�r |j��|`dS)Nr)rr�hasattrrZdestroyrr
r
r�
tearDownClass's

zAutoExpandTest.tearDownClasscCs|j�dd�dS)N�1.0�end)r�delete)r	r
r
r�tearDown.szAutoExpandTest.tearDowncCs�|j}|jj}|j}||�d�|�dd�||�d�|�dd�||�d�|�dd�||�d�|�dd�||�d�|�dd�||�d	�|�d
d�||�d�|�dd�||�d�dS)
N��insert�tZhis�this� �isz
sample
string�stringz3.0rr)rr�getprevword�assertEqualrr)r	r�previous�equalr
r
r�test_get_prevword1s$z AutoExpandTest.test_get_prevwordcCs�|jj}|jj}|j}|j�dd�||j��ddddg�|d�||�d�|d�||�d�|d�||�d�|d�||�d�dS)Nrzab ac bx ad ab a�ab�ad�ac�a�event)rr%�expand_word_eventr&rr�getwords)r	r'�expandr(r
r
r�test_before_onlyMszAutoExpandTest.test_before_onlycCs�|j}|jj}|jj}|j}|�dd�|�dd�||j��ddddg�|d�||�d�|d�||�d�|d�||�d�|d�||�d�dS)	Nrz a, [ab] ac: () bx"" cd ac= ad yaz1.1r*r,r+r-r.�rrr%r/r&r�mark_setr0�r	rr'r1r(r
r
r�test_after_only]szAutoExpandTest.test_after_onlycCs�|j}|jj}|jj}|j}|�dd�|�dd�|�dd�||j��dddg�|d�||�d�|d�||�d�|d�||�d�dS)	Nrz	ab xy yz
z
a ac by acz2.1r*r,r-r.r3r5r
r
r�test_both_before_afterpsz%AutoExpandTest.test_both_before_aftercCs�|j}|jj}|j}||j��g�||d�d�|�dd�||j��g�|�dd�|�dd�|d�|jj}|�dd�|d�|jj}|�||�dS)Nr.�breakrz
bx cy dz azac xy a ac ad az1.7z1.end)	rrr/r&r0rr4�stateZassertNotEqual)r	rr1r(Z
initial_stateZ	new_stater
r
r�test_other_expand_cases�sz&AutoExpandTest.test_other_expand_casesN)r
rr�classmethodrrrr)r2r6r7r:r
r
r
rrs

r�__main__�)�	verbosity)�__doc__Zidlelib.autoexpandrZunittestZtest.supportr�tkinterrrrZTestCaserr
�mainr
r
r
r�<module>s