B  f@sldZddlmZddlZddlmZddlmZmZGdddZ Gdd d ej Z e d krhej d d dS) zTest autoexpand, coverage 100%.) AutoExpandN)requires)TextTkc@seZdZddZdS) DummyEditwincCs ||_dS)N)text)selfrr F/opt/alt/python37/lib64/python3.7/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)NZguicSsdS)Nr r r r r z+AutoExpandTest.setUpClass..) rrtkrrrr auto_expandZbell)clsr r r setUpClasss  zAutoExpandTest.setUpClasscCs$|`|`t|dr |j|`dS)Nr)rrhasattrrZdestroy)rr r r tearDownClass's  zAutoExpandTest.tearDownClasscCs|jdddS)Nz1.0end)rdelete)rr 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.0z1.0r)rr getprevword assertEqualrr)rrpreviousequalr r r test_get_prevword1s$              z AutoExpandTest.test_get_prevwordcCs|jj}|jj}|j}|jdd||jddddg|d||d|d||d|d||d|d||ddS)Nrzab ac bx ad ab aabadacaevent)rr"expand_word_eventr#rrgetwords)rr$expandr%r r r test_before_onlyMs   zAutoExpandTest.test_before_onlycCs|j}|jj}|jj}|j}|dd|dd||jddddg|d||d|d||d|d||d|d||ddS) Nrz a, [ab] ac: () bx"" cd ac= ad yaz1.1r'r)r(r*r+)rrr"r,r#rmark_setr-)rrr$r.r%r r r test_after_only]s     zAutoExpandTest.test_after_onlycCs|j}|jj}|jj}|j}|dd|dd|dd||jdddg|d||d|d||d|d||ddS) Nrz ab xy yz z a ac by acz2.1r'r)r*r+)rrr"r,r#rr0r-)rrr$r.r%r 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#r-rr0stateZassertNotEqual)rrr.r%Z initial_stateZ new_stater r r test_other_expand_casess    z&AutoExpandTest.test_other_expand_casesN) r r r classmethodrrrr&r/r1r2r5r r r r rs  r__main__) verbosity)__doc__Zidlelib.autoexpandrZunittestZ test.supportrZtkinterrrrZTestCaserr mainr r r r s