+
     Bi:                         R t ^ RIt^ RIHt ^ RIHt  ! R R4      t ! R R]]P                  4      t ! R R	]]P                  4      t	]
R
8X  d   ]P                  ! ^RR7       R# R# )zhTest mock_tk.Text class against tkinter.Text class

Run same tests with both by creating a mixin class.
N)requires)TclErrorc                   v   a  ] tR t^	t o RtRt]R,           tR tR tR t	R t
R tR	 tR
 tR tR tR tRtV tR# )TextTestz*Define items common to both sets of tests.zhello
world
c                    V P                  V P                  P                  R 4      R4       V P                  V P                  P                  R4      R4       R# )1.0r   end N)assertEqualtextgetselfs   &2/usr/lib/python3.14/idlelib/idle_test/test_text.py	test_initTextTest.test_init   s<    u-t4u-r2    c                    V P                   P                  pR F  pV P                  V! V4      R4       K  	  R F  pV P                  V! V4      R4       K  	  R# )g      ?r   2.0N)      333333?1.-1r   1.0 lineend1.end1.33insert)r	   g       @2.133.44)r   indexr   r   r   dexs   &  r   test_index_emptyTextTest.test_index_empty   sO    		CU3Z/ .CU3Z/ .r   c                D   V P                   P                  pV P                   P                  R V P                  4       R F  pV P	                  V! V4      R 4       K  	  R F  pV P	                  V! V4      R4       K  	  R F  pV P	                  V! V4      R4       K  	  R# )r   z1.5z3.0N)r   r   r   r   )r   r   r   )r	   r   )r   r   r   hwr   r    s   &  r   test_index_dataTextTest.test_index_data    s    				(+CU3Z/ , 2CU3Z/ 2 #CU3Z/ #r   c                l   V P                   P                  pV P                  pV P                   P                  R V P                  4       V! V! R4      R4       V! V! RR4      R4       V! V! R 4      R4       V! V! R R4      R4       V! V! R R4      R4       V! V! RR4      R4       V! V! R R4      R	4       V! V! R R
4      R	4       V! V! R4      R4       V! V! RR4      R4       V! V! R R4      V P                  4       V! V! R R4      V P
                  4       V! V! RR4      V P
                  4       R# )r   r	   r
   h1.11.3helelr   hello1.10r   2.3zello
worz2.5z0.0z5.0N)r   r   r   r   r%   hwn)r   r   Equals   &  r   test_getTextTest.test_get-   s   iimm  		(c%j"c%$c%j#c%%c%'c%&c%'1c% '*c- $'c%-c%)c%*c%*r   c                   V P                   P                  pV P                   P                  pV P                  pV! R V P                  4       V! V! R R4      V P
                  4       V! R R4       V! V! R R4      V P
                  4       V! R R4       V! V! R R4      R4       V! RR4       V! V! R R4      R4       V! RR4       V! V! R R4      R4       V! RR	4       V! V! R R4      R
4       V! RR4       V! V! R R4      R4       R# )r   r	   r
   *z*hello
world
r   z*hello*
world
r0   z*hello*
wor*ld
xz*hello*
wor*ldx
1.4zx
z*helx
lo*
wor*ldx
N)r   r   r   r   r%   r1   )r   r   r   r2   s   &   r   test_insertTextTest.test_insert@   s    !!iimm  udggc%*ubc%*ucc%!23}c"c%!34ucc%!45ucc%!56uec%!89r   c                b   V P                   P                  pV P                   P                  pV P                  pV P                   P	                  R V P
                  4       V! R4       V! V! R R4      V P                  4       V! R4       V! V! R R4      V P                  4       V! RR4       V! V! R R4      V P                  4       V! RR4       V! V! R R4      V P                  4       V! RR 4       V! V! R R4      V P                  4       V! RR4       V! V! R R4      V P                  4       R# )r   r   r	   z5.5r8   N)r   deleter   r   r   r%   r1   r   r<   r   r2   s   &   r   test_no_deleteTextTest.test_no_deleteZ   s    !!iimm  		(xc%*uc%*xc%*xc%*uec%*uec%*r   c                &   V P                   P                  pV P                   P                  pV P                  pV P                   P	                  R V P
                  4       V! R 4       V! V! R R4      R4       V! R R4       V! V! R R4      R4       V! R4       V! V! R R4      R4       V P                   P	                  RR4       V! R4       V! V! R R4      R4       V P                   P	                  RR4       V! RR	4       V! V! R R4      R4       R
# )r   r   ellor*   llolloworldr+   r   r/   r   Nr   r<   r   r   r   r%   r=   s   &   r   test_delete_charTextTest.test_delete_chars   s    !!iimm  		(uc%!6*uec%!5) 	wc%!:.		%vc%!:.		%uec%!:.r   c                T   V P                   P                  pV P                   P                  pV P                  pV P                   P	                  R V P
                  4       V! R R4       V! V! R R4      R4       V! R R4       V! V! R R4      R4       V P                   P	                  R V P
                  4       V! R R4       V! V! R R4      R4       V! R R4       V! V! R R4      R4       V P                   P	                  R V P
                  4       V! RR4       V! V! R R4      R	4       R
# )r   r   r	   z
world
r   r   zworld
z1.2r0   zheld
NrD   r=   s   &   r   test_delete_sliceTextTest.test_delete_slice   s    !!iimm  		(um$c%-uec%&		(uec%+uec%&		(uec%*r   c                ^   V P                   P                  R R4       V P                   P                  RR4       V P                  V P                   P                  R R4      R4       V P                   P	                  RR4       V P                  V P                   P                  R R4      R4       R# )	r   r.   r+   z	1
2
3
4
5r	   zhel1
2
3
4
5lo
z5.1zhello
N)r   r   r   r   r<   r   s   &r   test_multiple_linesTextTest.test_multiple_lines   s}    		(		0ue46LM		&ue4i@r   c                x   V P                   P                  pV P                  pV P                   P                  R R4       V P	                  \
        VRRR4       R	 F\  w  r4rVrxV! V! RVR4      WC4       V! V! RVR4      WS4       V! V! RVR4      Wc4       V! V! RVR4      Ws4       V! V! RVR4      W4       K^  	  R# )
r   zFirst
Second
Third
z2.2opr*   r   r0   z3.3N))<TTFFF)z<=TTTFF)>FFFTT)z>=FFTTT)z==FFTFF)z!=TTFTT)r   comparer   r   assertRaisesr   )	r   rQ   r2   rN   less1less0equalgreater0greater1s	   &        r   test_compareTextTest.test_compare   s    ))##  		 89(GUD%@<7BuX '%U+U7'%U+U7'%U+U7'%U+X:'%U+X:<r    N)__name__
__module____qualname____firstlineno____doc__r%   r1   r   r"   r&   r3   r9   r>   rE   rH   rK   rX   __static_attributes____classdictcell____classdict__s   @r   r   r   	   sN     0	B
T'C
300+&:4+2/0+.A; ;r   r   c                   <   a  ] tR t^t o ]R 4       tR tR tRtV t	R# )MockTextTestc                    ^ RI Hp Wn        R# )    )TextN)idlelib.idle_test.mock_tkrh   )clsrh   s   & r   
setUpClassMockTextTest.setUpClass   s
    2r   c                0    V P                  4       V n        R # N)rh   r   r   s   &r   setUpMockTextTest.setUp   s    IIK	r   c                   V P                   P                  pV P                  pV P                   P                  R V P                  4       V! V! RR4      R4       V! V! RR4      R4       V! V! R^ 4      R4       V! V! R^ 4      R4       R# )r   r	   z3.1N)      )rs      )r   _decoder   r   r%   )r   decoder2   s   &  r   test_decodeMockTextTest.test_decode   sx    ""  		(fUB(fUB(fUQ(fUA'r   r   N)
r[   r\   r]   r^   classmethodrk   ro   rx   r`   ra   rb   s   @r   re   re      s&       	( 	(r   re   c                   F   a  ] tR t^t o ]R 4       t]R 4       tR tRtV t	R# )
TkTextTestc                P    \        R 4       ^ RIHpHp W n        V! 4       V n        R# )gui)Tkrh   N)r   tkinterr   rh   root)rj   r   rh   s   &  r   rk   TkTextTest.setUpClass   s    $4r   c                >    V P                   P                  4        V = R # rn   )r   destroy)rj   s   &r   tearDownClassTkTextTest.tearDownClass   s    Hr   c                F    V P                  V P                  4      V n        R # rn   )rh   r   r   r   s   &r   ro   TkTextTest.setUp   s    IIdii(	r   rz   N)
r[   r\   r]   r^   r{   rk   r   ro   r`   ra   rb   s   @r   r}   r}      s5        ) )r   r}   __main__F)	verbosityexit)r_   unittesttest.supportr   _tkinterr   r   TestCasere   r}   r[   mainrZ   r   r   <module>r      sg     ! v; v;r(8X.. (.)8,, )$ zMMAE* r   