a  ze@sldZddlmZddlZddlmZddlmZmZGdddZ Gdd d ej Z e d krhej d d dS) zTest autoexpand, coverage 100%.) AutoExpandN)requires)TextTkc@seZdZddZdS) DummyEditwincCs ||_dSN)text)selfrr U/opt/bitninja-python-dojo/embedded/lib/python3.9/idlelib/idle_test/test_autoexpand.py__init__ szDummyEditwin.__init__N)__name__ __module__ __qualname__r r r r r r src@sTeZdZeddZeddZddZddZd d Zd d Z d dZ ddZ dS)AutoExpandTestcCs<tdt|_t|j|_tt|j|_dd|j_dS)NZguicSsdSrr r r r r z+AutoExpandTest.setUpClass..) rrtkrrrr auto_expandZbellclsr r r setUpClasss  zAutoExpandTest.setUpClasscCs$|`|`t|dr |j|`dS)Nr)rrhasattrrZdestroyrr r r tearDownClass's  zAutoExpandTest.tearDownClasscCs|jdddS)N1.0end)rdelete)r r r r tearDown.szAutoExpandTest.tearDowncCs|j}|jj}|j}||d|dd||d|dd||d|dd||d|dd||d|dd||d |d d||d|d d ||ddS) NinserttZhisthis isz sample stringstringz3.0rr)rr getprevword assertEqualrr)r rpreviousequalr r r test_get_prevword1s$              z AutoExpandTest.test_get_prevwordcCs|jj}|jj}|j}|jdd||jgd|d||d|d||d|d||d|d||ddS) Nrzab ac bx ad ab a)abadacaeventr*r+r,r-)rr%expand_word_eventr&rrgetwords)r r'expandr(r r r test_before_onlyMs   zAutoExpandTest.test_before_onlycCs|j}|jj}|jj}|j}|dd|dd||jgd|d||d|d||d|d||d|d||d dS) Nrz a, [ab] ac: () bx"" cd ac= ad yaz1.1)r*r,r+r-r.r*r,r+r-rrr%r/r&rmark_setr0r rr'r1r(r r r test_after_only]s     zAutoExpandTest.test_after_onlycCs|j}|jj}|jj}|j}|dd|dd|dd||jgd|d||d|d||d|d||d dS) Nrz ab xy yz z a ac by acz2.1)r*r,r-r.r*r,r-r3r5r r r test_both_before_afterps     z%AutoExpandTest.test_both_before_aftercCs|j}|jj}|j}||jg||dd|dd||jg|dd|dd|d|jj}|dd|d|jj}|||dS)Nr.breakrz bx cy dz azac xy a ac ad az1.7z1.end) rrr/r&r0rr4stateZassertNotEqual)r rr1r(Z initial_stateZ new_stater r r test_other_expand_casess    z&AutoExpandTest.test_other_expand_casesN) r rr classmethodrrrr)r2r6r7r:r r r r rs  r__main__) verbosity)__doc__Zidlelib.autoexpandrZunittestZ test.supportrtkinterrrrZTestCaserr mainr r r r s