
    /hh                         S r SSKJr  SSKrSSKJr  SSKJrJr   " S S5      r	 " S S	\R                  5      r\S
:X  a  \R                  " SS9  gg)zTest autoexpand, coverage 100%.    )
AutoExpandN)requires)TextTkc                       \ rS rSrS rSrg)DummyEditwin	   c                     Xl         g Ntext)selfr   s     J/opt/python-3.13.8/usr/lib/python3.13/idlelib/idle_test/test_autoexpand.py__init__DummyEditwin.__init__   s    	    r   N)__name__
__module____qualname____firstlineno__r   __static_attributes__ r   r   r   r   	   s    r   r   c                   X    \ rS rSr\S 5       r\S 5       rS rS rS r	S r
S rS	 rS
rg)AutoExpandTest   c                     [        S5        [        5       U l        [        U R                  5      U l        [        [        U R                  5      5      U l        S U R                  l        g )Nguic                      g r   r   r   r   r   <lambda>+AutoExpandTest.setUpClass.<locals>.<lambda>   s    tr   )	r   r   tkr   r   r   r   auto_expandbellclss    r   
setUpClassAutoExpandTest.setUpClass   sB    <$\#((%;<+r   c                 h    U ? U ?[        U S5      (       a  U R                  R	                  5         U ?g g )Nr!   )r   r"   hasattrr!   destroyr$   s    r   tearDownClassAutoExpandTest.tearDownClass'   s0    Hco3FFNN r   c                 <    U R                   R                  SS5        g )N1.0end)r   delete)r   s    r   tearDownAutoExpandTest.tearDown.   s    		&r   c                 <   U R                   nU R                  R                  nU R                  nU" U" 5       S5        UR	                  SS5        U" U" 5       S5        UR	                  SS5        U" U" 5       S5        UR	                  SS5        U" U" 5       S5        UR	                  SS5        U" U" 5       S5        UR	                  SS5        U" U" 5       S	5        UR                  S
S5        U" U" 5       S5        UR                  SS5        U" U" 5       S5        g )N insertthisthis isz
sample
stringstringz3.0r.   r/   )r   r"   getprevwordassertEqualr5   r0   )r   r   previousequals       r   test_get_prevword AutoExpandTest.test_get_prevword1   s    yy##//  hj"Hc"hj#He$hj&!Hc"hj"Hd#hj$H01hj(#E8$hj"E5!hj"r   c                    U R                   R                  nU R                   R                  nU R                  nU R                  R                  SS5        U" U R                   R                  5       / SQ5        U" S5        U" U" 5       S5        U" S5        U" U" 5       S5        U" S5        U" U" 5       S5        U" S5        U" U" 5       S5        g )	Nr5   zab ac bx ad ab a)abadacaeventrC   rD   rE   rF   )r"   r<   expand_word_eventr=   r   r5   getwords)r   r>   expandr?   s       r   test_before_onlyAutoExpandTest.test_before_onlyM   s    ##//!!33  		#56d'')+BCwhj$whj$whj$whj#r   c                    U R                   nU R                  R                  nU R                  R                  nU R                  nUR                  SS5        UR                  SS5        U" U R                  R                  5       / SQ5        U" S5        U" U" 5       S5        U" S5        U" U" 5       S5        U" S5        U" U" 5       S5        U" S5        U" U" 5       S	5        g )
Nr5   z a, [ab] ac: () bx"" cd ac= ad yaz1.1)rC   rE   rD   rF   rG   rC   rE   rD   rF   r   r"   r<   rH   r=   r5   mark_setrI   r   r   r>   rJ   r?   s        r   test_after_onlyAutoExpandTest.test_after_only]   s    yy##//!!33  H@Ah&d'')+BCwhj$whj$whj$whj#r   c                    U R                   nU R                  R                  nU R                  R                  nU R                  nUR                  SS5        UR                  SS5        UR                  SS5        U" U R                  R                  5       / SQ5        U" S5        U" U" 5       S5        U" S5        U" U" 5       S5        U" S5        U" U" 5       S	5        g )
Nr5   z	ab xy yz
z
a ac by acz2.1)rC   rE   rF   rG   rC   rE   rF   rN   rP   s        r   test_both_before_after%AutoExpandTest.test_both_before_afterp   s    yy##//!!33  Hl+Hl+h&d'')+<=whj$whj$whj#r   c                 ,   U R                   nU R                  R                  nU R                  nU" U R                  R	                  5       / 5        U" U" S5      S5        UR                  SS5        U" U R                  R	                  5       / 5        UR                  SS5        UR                  SS5        U" S5        U R                  R                  nUR                  SS5        U" S5        U R                  R                  nU R                  XE5        g )NrG   breakr5   z
bx cy dz azac xy a ac ad az1.7z1.end)	r   r"   rH   r=   rI   r5   rO   stateassertNotEqual)r   r   rJ   r?   initial_state	new_states         r   test_other_expand_cases&AutoExpandTest.test_other_expand_cases   s    yy!!33   	d'')2.fWow'Hl+d'')2. 	H/0h&w((..h(w$$**	M5r   r   N)r   r   r   r   classmethodr&   r+   r1   r@   rK   rQ   rT   r\   r   r   r   r   r   r      sF    , ,,  '8 &$6r   r   __main__   )	verbosity)__doc__idlelib.autoexpandr   unittesttest.supportr   tkinterr   r   r   TestCaser   r   mainr   r   r   <module>ri      sN    ! )  !  
I6X&& I6X zMMA r   