+
     Bi>              
          ^ RI Ht ^ RIt^ RIt^ RIHt ^ RIHtHtH	t	H
t
Ht ^ RIHt ^ RIt^ RI Ht ]P                  P                   tR]P$                  ! R4      R	]P$                  ! R4      R
]P$                  ! R4      R]P$                  ! R4      /tRt ! R R4      t ! R R]P,                  4      t ! R R]P,                  4      t]R8X  d   ]P4                  ! ^R7       R# R# )    )codecontextN)requires)NSEWTkFrameTextTclError)mock)configmain 	highlightkeys
extensionsz
class C1:
    # Class comment.
    def __init__(self, a, b):
        self.a = a
        self.b = b
    def compare(self):
        if a > b:
            return a
        elif a < b:
            return b
        else:
            return None
c                   2   a  ] tR t^&t o R tR tR tRtV tR# )DummyEditwinc                D    Wn         Wn        W n        W0n        R V n        R# )r   N)roottop
text_frametextlabel)selfr   framer   s   &&&&9/usr/lib/python3.14/idlelib/idle_test/test_codecontext.py__init__DummyEditwin.__init__'   s    		
    c                \    \        \        V P                  P                  V4      4      4      # N)intfloatr   index)r   r#   s   &&r   	getlinenoDummyEditwin.getlineno.   s    5/011r   c                "    VR ,          V n         R# )r   N)r   )r   kwargss   &,r   update_menu_labelDummyEditwin.update_menu_label1   s    G_
r   )r   r   r   r   r   N)	__name__
__module____qualname____firstlineno__r   r$   r(   __static_attributes____classdictcell____classdict__s   @r   r   r   &   s     2% %r   r   c                      a  ] tR t^5t o ]R 4       t]R 4       tR tR tR t	R t
R tR tR	 tR
 tR tR t]P$                  P'                  ]P*                  R4      R 4       tR tR tRtV tR# )CodeContextTestc                x   \        R 4       \        4       ;qn        VP                  4        \	        V4      ;q n        \        V4      ;q0n        VP                  R\        4       VP                  RR^R7       VP                  ^^\        R7       \        WV4      V n        \        \         P"                  n        R# )gui1.0leftboth)sidefillexpand)rowcolumnstickyN)r   r   r   withdrawr   r   r   r   insertcode_samplepackgridr   r   editortestcfgr   idleConfuserCfg)clsr   r   r   s   &   r   
setUpClassCodeContextTest.setUpClass7   s    $x!$K'	u+%xE;'

VA
6		a$	/!$t4
'.$r   c                    \         \        P                  n        V P                  P
                  P                  R R4       V =V =V =V P                  P                  4        V P                  P                  4        V =R# )r6   endN)usercfgr   rF   rG   rD   r   deleter   r   update_idletasksdestroy)rH   s   &r   tearDownClassCodeContextTest.tearDownClassE   sZ    '.$

ue,J	38!!#Hr   c                  a a S P                   P                  ^ 4       RS P                   R&   \        P                  ! S P                  4      S n        RRRR/S n        \        P                  P                  oVV 3R lp\        P                  P                  P                  \        P                  RV4      pVP                  4        S P                  VP                  4       RS n        V 3R	 lp\        P                  P                  P                  \        P                  R
V4      pVP                  4        S P                  VP                  4       R# )r   TkFixedFontfont
backgroundz#abcdef
foregroundz#123456c                 :   < VR 8X  d   SP                   # S! W4      # context)highlight_cfg)themeelementorig_idleConf_GetHighlightr   s   &&r   mock_idleconf_GetHighlight9CodeContextTest.setUp.<locals>.mock_idleconf_GetHighlightV   s"    )#)))-e==r   GetHighlightc                    < SP                   # r    )font_override)r   
configTypesectionr   s   &&&r   mock_idleconf_GetFont4CodeContextTest.setUp.<locals>.mock_idleconf_GetFont`   s    %%%r   GetFontN)r   yviewr   CodeContextrD   ccr[   rF   ra   unittestr
   patchobjectstart
addCleanupstoprc   )r   r_   GetHighlight_patcherrf   GetFont_patcherr^   s   f    @r   setUpCodeContextTest.setUpN   s   		)		&))$++6*I*I7%0%9%9%F%F"	>  (}}2299  .2L N""$,112*	&"----44  )-BD,,-r   c                    V P                   P                  '       d%   V P                   P                  P                  4        V P                   P                  4        V P                   =V = R # r    )rk   rZ   rP   __del__r   s   &r   tearDownCodeContextTest.tearDowng   s>    77???GGOO##%GGOTWr   c                   V P                   pV P                  pV P                  pV! VP                  V4       V! VP                  VP                  4       V! VP                  R ,          VP                  R ,          4       V P                  VP                  4       V! VP                  R.4       V! VP                  ^4       V P                  V P                  P                  4       R# )rU   Nr   r   F)
assertEqualrD   rk   editwinr   assertIsNonerZ   info
topvisiblet1)r   eqedrk   s   &   r   	test_initCodeContextTest.test_initn   s    [[WW
2::r
277BGG
2776?BGGFO,"**%
277'()
2==!$''**%r   c                :    V P                   P                  4        R # r    )rk   rw   rx   s   &r   test_delCodeContextTest.test_del{   s    r   c                   V P                   P                  R R 4      ;qP                  n        V P                  P	                  4        V P                  \        4      ;_uu_ 4       pV P                  P                  P                  RRV4       RRR4       V P                  R\        XP                  4      4       R#   + '       g   i     L7; i)i'  c                      R # r     r   r   r   <lambda>5CodeContextTest.test_del_with_timer.<locals>.<lambda>   s    Dr   afterr   Nzdoesn't exist)r   r   rk   r   rw   assertRaisesr	   r   tkcallassertInstr	exception)r   timercms   &  r   test_del_with_timer#CodeContextTest.test_del_with_timer~   s    !YY__ULAA
x((BIILLgvu5 )os2<<'89 )(s   %(B<<C	c                    \         P                  P                  4        V P                  V P                  P
                  ^4       R# )   N)r   rj   reloadr~   rk   context_depthrx   s   &r   test_reloadCodeContextTest.test_reload   s.    &&(..3r   c                   V P                   pV P                  pVP                  pVP                  '       d   V! 4        V! 4        V P	                  VP                  4       V! VP                  R ,          V P
                  R ,          4       V! VP                  R,          V P                  R,          4       V! VP                  R,          V P                  R,          4       V! VP                  P                  RR4      R4       V! VP                  P                  R4       V! V P                  P                  P                  R	R
V P                  P                  4      ^,          R4       V! 4        V P                  VP                  4       V! VP                  P                  R4       V P                  V P                  P                  4       RP                  R VP!                  ^4      ^ ,           4       4      pVP
                  P#                  ^4       V! 4        V! VP                  P                  RR4      V4       V! 4        V! 4        V! VP                  P                  RR4      V4       R# )rU   fgrW   bgrV   r6   end-1cr   zHide Code Contextr   r   r   zShow Code Context
c              3   2   "   T F  q^,          x  K  	  R# 5i)   Nr   ).0xs   & r   	<genexpr>ACodeContextTest.test_toggle_code_context_event.<locals>.<genexpr>   s     "G1FAQ441Fs   N)r~   rk   toggle_code_context_eventrZ   assertIsNotNoner   r[   getr   r   r   r   r   r   r   joinget_contextri   )r   r   rk   toggleline11_contexts   &    r   test_toggle_code_context_event.CodeContextTest.test_toggle_code_context_event   s   WW-- :::H 	RZZ(
2::ftyy01
2::dT//=>
2::dT//=>
2::>>%*B/
2::01
499<<Wfdggjj9!<gF 	"**%
2::01$''**% "G1CA1F"GG
b
2::>>%*N; 	
2::>>%*N;r   c                \   V P                   pV P                  P                  pV P                  \        4      ;_uu_ 4        V! ^^ R7       RRR4       V! V! ^4      R.^ 34       V! V! ^4      R.^ 34       V! V! ^4      RR.^ 34       V! V! ^
4      . RO^ 34       V! V! ^4      . R	O^ 34       V! V! ^^R7      . R	O^ 34       V! V! ^^R7      . R
O^34       V! V! ^^R7      RR.^34       V! V! ^^R7      . R
O^34       V! V! ^^R7      RR.^34       R#   + '       g   i     L; i)   )stoplineN)
stopindentr   r   	class C1:class   r       def __init__(self, a, b):def   r           if a > b:if)r      r   z    def compare(self):r   r   
   r   z        elif a < b:elif)r   r   r   r   )r   r   r   )r~   rk   r   r   AssertionError)r   r   gcs   &  r   test_get_context CodeContextTest.test_get_context   s   WW   ~..q1 / 	2a501156 	2a501156 	2a50BDEFH 	I 	2b6 89:< 	=
 	2b6 = ?@A 	B 	2b1 !I KL M 	N 	2b1 !IJK M 	N 	2b1!B!G!IJK M 	N 	2bQ #KLM"O 	P 	2bQ#D#I#KLM"O 	PQ /.s    DD+	c                P   V P                   pV P                  pVP                  '       g   VP                  4        V P	                  VP                  4       4       V! VP                  R	.4       V! VP                  ^4       VP                  P                  ^4       VP                  4        V! VP                  R	.4       V! VP                  ^4       V! VP                  P                  RR4      R4       VP                  P                  ^4       VP                  4        V! VP                  R	R
.4       V! VP                  ^4       V! VP                  P                  RR4      R4       VP                  P                  ^4       VP                  4        V! VP                  R	R
.4       V! VP                  ^4       V! VP                  P                  RR4      R4       VP                  P                  ^4       VP                  4        V! VP                  . RO4       V! VP                  ^4       V! VP                  P                  RR4      R4       VP                  P                  ^4       VP                  4        V! VP                  . RO4       V! VP                  ^4       V! VP                  P                  RR4      R4       VP                  4        ^Vn        V! VP                  . RO4       V! VP                  ^4       V! VP                  P                  RR4      R4       VP                  P                  ^4       VP                  4        V! VP                  . RO4       V! VP                  ^4       V! VP                  P                  RR4      R4       R# )r   r   r6   r   r   r   z'class C1:
    def __init__(self, a, b):zFclass C1:
    def compare(self):
        if a > b:
        elif a < b:Nr|   r   )r|   r   r   )r|   r   r   r   r   )r~   rk   rZ   r   r   update_code_contextr   r   r   ri   r   r   )r   r   rk   s   &  r   test_update_code_context(CodeContextTest.test_update_code_context   s   WWzzz((* 	"0023
277'()
2==! 	a
 
277'()
2==!
2::>>%*B/ 	a
 
277')EFG
2==!
2::>>%*K8 	a
 
277')EFG
2==!
2::>>%*K8 	a
 
277 E 	F 	2==!
2::>>%* -L 	M 	b
 
277 = 	>
 	2=="
2::>>%* -B 	C 	 
277 = 	>
 	2=="
2::>>%* -B 	C 	a
 
277 E 	F 	2==!
2::>>%*,KLr   c                T   V P                   pV P                  pVP                  pVP                  '       g   VP	                  4        VP
                  P                  R 4       VP                  4        V! VP                  ^4       VP                  P                  RR4       V! 4        V! VP                  ^4       VP
                  P                  R4       VP                  4        V! VP                  ^4       VP                  P                  RR4       V! 4        V! VP                  ^4       ^Vn
        VP
                  P                  R4       VP                  4        V! VP                  ^4       VP                  P                  RR4       V! 4        V! VP                  ^4       VP
                  P                  R4       VP                  4        VP                  P                  RRR 4       VP                  P                  RR4       V! 4        V! VP                  ^4       R# )	z2.0r@   z1.5z12.0z3.0r6   z5.0selN)r~   rk   
jumptolinerZ   r   r   ri   r   r   mark_setr   tag_add)r   r   rk   jumps   &   r   test_jumptolineCodeContextTest.test_jumptoline.  s   WW}}zzz((* 	e
 
2==!


He,
2==! 	f
 
2=="


He,
2==! 
f
 
2=="


He,
2==! 	e
 


5%/


He,
2==!r   r   c                N   V P                   P                  '       d   V P                   P                  4        V P                   P                  4        VP	                  4        V P                   P                  4        V P                   P                  4        VP                  4        R # r    )rk   rZ   r   timer_eventassert_not_calledassert_called)r   mock_updates   &&r   test_timer_event CodeContextTest.test_timer_eventW  sk     77???GG--/%%' 	))+!!#r   c                   V P                   pV P                  pVP                  R ,          pRpV P                  W44       VP                  e   VP                  4        W@n        VP                  4        VP                  4        V! VP                  R ,          V4       W0n        VP                  4        V! VP                  R ,          V4       R# )rU   
TkTextFontN)r~   rk   r   assertNotEqualrZ   r   rc   update_font)r   r   rk   	orig_font	test_fonts   &    r   r   CodeContextTest.test_fontd  s    WWGGFO	 	I1 ::!((*&
 	$$&
2::fy) '

2::fy)r   c                  aa V P                   oV P                  o\        V P                  4      pR RRR/pVV3R lpSP                  '       d   SP                  4        W n        SP                  4        SP                  4        V! V4       SP                  4        V! V4       Wn        SP                  4        V! V4       R# )rV   z#222222rW   z#ffff00c                    < S! SP                   R ,          V R ,          4       S! SP                   R,          V R,          4       R# )rV   rW   NrY   )colorsrk   r   s   &r   assert_colors_are_equalFCodeContextTest.test_highlight_colors.<locals>.assert_colors_are_equal  s3    rzz,')=>rzz,')=>r   N)r~   rk   dictr[   rZ   r   update_highlight_colors)r   orig_colorstest_colorsr   rk   r   s   &   @@r   test_highlight_colors%CodeContextTest.test_highlight_colors}  s    WW4--.#YiH	?
 :::((*(
""$ 	$$&, 	""$, )
""$,r   )rk   rc   r[   N)r*   r+   r,   r-   classmethodrI   rQ   rt   ry   r   r   r   r   r   r   r   r   r
   rm   rn   r   rj   r   r   r   r.   r/   r0   s   @r   r3   r3   5   s     / /  .2%&:4"<H.P`OMb'R 
ZZ{..0EF
$ G
$*2- -r   r3   c                   ,   a  ] tR tRt o R tR tRtV tR# )HelperFunctionTexti  c                    \         P                  pRpV F  w  r4V P                  V! V4      V4       K  	  V P                  V! R\        P                  ! R4      R7      R4       R# )    first word    (continuation)z^(\s*)([^\s]*))cN))r   )    first)z	first word)	r   )u
     ᧔᧒: )z  u   ᧔᧒)z	no spaces)r   no)r   r   r   )z# TEST COMMENTr   )r   )r   r   )r   z(continuation))r   get_spaces_firstwordr~   recompile)r   r   
test_lineslineexpected_outputs   &    r   test_get_spaces_firstword,HelperFunctionText.test_get_spaces_firstword  sa    ..
 &0!DSY8 &0 	1!zz*;<>3	5r   c                   V P                   p\        P                  p\        P	                  4       pV! V! V^ ,          4      \        P
                  RR34       V! V! V^,          4      R4       V! V! V^,          4      \        P
                  RR34       V! V! V^,          4      R4       V! V! V^,          4      R4       V! V! R4      R	4       R# )
r   r   Fz    # Class comment.	if a == b:N)r   r   r   )r   r   r   )r   r   r   )r   r  r   )r~   r   get_line_inforA   
splitlinesINFINITY)r   r   gliliness   &   r   test_get_line_info%HelperFunctionText.test_get_line_info  s    ''&&( 	3uQx=;//U;<
3uQx=34
3uQx=;//1GOP
3uQx=EF
3uQx=89
3~ 9:r   r   N)r*   r+   r,   r-   r  r  r.   r/   r0   s   @r   r   r     s     5&; ;r   r   __main__)	verbosity)idlelibr   rl   unittest.mocktest.supportr   tkinterr   r   r   r   r	   r
   r   r   rF   rG   rM   IdleUserConfParserrE   rA   r   TestCaser3   r   r*   r   r   r   r   <module>r     s        ! 3 3  	  


&
&
F%%b)**2.
F%%b)&++B/	"% %f-h'' f-R%;** %;P zMMA r   