+
     Biz#                         R t ^ RIHt ^ RIt^ RIHt ^ RIHtHt ^ RI	H
t
  ! R R4      t ! R R	]P                  4      t]R
8X  d   ]P                  ! ^R7       R# R# )zTest hyperparser, coverage 98%.)HyperParserN)requires)TkText)EditorWindowc                   V   a  ] tR t^	t o R t]P                  t]P                  tRtV t	R# )DummyEditwinc                J    Wn         ^V n        ^V n        RV n        RV n        R# )   >>>N)2   i  i  )textindentwidthtabwidthprompt_last_linenum_context_lines)selfr   s   &&9/usr/lib/python3.14/idlelib/idle_test/test_hyperparser.py__init__DummyEditwin.__init__
   s&    	 %!.    )r   r   r   r   r   N)
__name__
__module____qualname____firstlineno__r   r   _build_char_in_string_funcis_char_in_string__static_attributes____classdictcell____classdict__s   @r   r   r   	   s$     / ".!H!H$66r   r   c                      a  ] tR t^t o Rt]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RtV tR# )HyperParserTestu#  """This is a module docstring"""
# this line is a comment
x = "this is a string"
y = 'this is also a string'
l = [i for i in range(10)]
m = [py*py for # comment
       py in l]
x.__len__
z = ((r'asdf')+('a')))
[x for x in
for = False
cliché = "this is a string with unicode, what a cliché"c                    \        R 4       \        4       V n        V P                  P                  4        \	        V P                  4      V n        \        V P
                  4      V n        R# )guiN)r   r   rootwithdrawr   r   r   editwinclss   &r   
setUpClassHyperParserTest.setUpClass%   sA    4>"388,r   c                F    V = V =V P                  P                  4        V =R # )N)r   r'   r%   destroyr(   s   &r   tearDownClassHyperParserTest.tearDownClass-   s     HckHr   c                R    V P                   P                  R V P                  4       R# )insertN)r   r1   coder   s   &r   setUpHyperParserTest.setUp3   s    		499-r   c                `    V P                   P                  R R4       RV P                  n        R# )1.0endr   N)r   deleter'   r   r3   s   &r   tearDownHyperParserTest.tearDown6   s"    		&(-%r   c                .    \        V P                  V4      # )z.
Return a parser object with index at 'index'
)r   r'   )r   indexs   &&r   
get_parserHyperParserTest.get_parser:   s     4<<//r   c                j   V P                  \        4      ;_uu_ 4       pV P                  P                  RRR4       V P	                  R4      pRRR4       V P                  R\        XP                  4      4       RV P                  n	        V P	                  R4      pV P                  VP                  V P                  P                  RR4      4       V P                  P                  RV P                  P                  RR4      ^,          4       V P	                  R	4      pR#   + '       g   i     L; i)
z&
test corner cases in the init method
consoler7   z1.endz1.5Nprecedes r8   z54.5)assertRaises
ValueErrorr   tag_addr>   assertInstr	exceptionr'   r   assertEqualrawtextgetr1   )r   veps   &  r   	test_initHyperParserTest.test_init@   s     z**bIIi8&A + 	j#bll"34 )+% OOE"DIIMM%$?@ 					eU ;A =>OOF# +*s   /D""D2	c                @   V P                   pV! R 4      pV P                  VP                  4       4       V! R4      pV P                  VP                  4       4       V! R4      pV P                  VP                  4       4       V! R4      pV P                  VP                  4       4       V! R4      pV P                  VP                  4       4       V! R4      pV P                  VP                  4       4       V! R4      pV P                  VP                  4       4       R# )r7   z1.4z2.3z3.3z3.7z4.6z12.54N)r>   assertFalseis_in_string
assertTruer   rL   rN   s   &  r   test_is_in_string!HyperParserTest.test_is_in_stringT   s    ooJ)*J()J)*J)*J()J()L()r   c                   V P                   pV! R 4      pV P                  VP                  4       4       V! R4      pV P                  VP                  4       4       V! R4      pV P                  VP                  4       4       V! R4      pV P                  VP                  4       4       V! R4      pV P                  VP                  4       4       V! R4      pV P                  VP                  4       4       R# )r7   z1.1z2.5z3.4z3.6z4.14N)r>   rT   
is_in_coderR   rU   s   &  r   test_is_in_codeHyperParserTest.test_is_in_codef   s    ooJ'J(J(J'J(K(r   c                h   V P                   pR  pR pV! R4      pV P                  V! V4      4       V P                  V! V4      4       V! R4      pV P                  V! V4      R4       V P                  V! V4      V! V4      4       V! R4      pV P                  V! V4      R	4       V P                  V! V4      V! V4      4       V! R4      pV P                  V! V4      R
4       V P                  V! V4      4       V! R4      pV P                  V! V4      4       V P                  V! V4      4       R# )c                 &    V P                  R R7      # )F	mustcloseget_surrounding_bracketsparsers   &r   without_mustcloseGHyperParserTest.test_get_surrounding_bracket.<locals>.without_mustclosey   s     22U2CCr   c                 &    V P                  R R7      # )Tr^   r`   rb   s   &r   with_mustcloseDHyperParserTest.test_get_surrounding_bracket.<locals>.with_mustclose~   s     22T2BBr   z3.2z5.6z5.23z6.15z9.endN)z5.45.25)z5.21z5.24)z6.4z6.end)r>   assertIsNoneassertTupleEqual)r   rL   rd   rg   rN   s   &    r   test_get_surrounding_bracket,HyperParserTest.test_get_surrounding_bracketv   s!   oo	D
	C
 J.+,+A./J/2OD/2N14EFK/24DE/2N14EFK/24DE.+,L.+,+A./r   c                
   V P                   pV! R 4      pV P                  VP                  4       R4       V! R4      pV P                  \        4      ;_uu_ 4       pVP                  4        RRR4       V P                  R\        XP                  4      4       V! R4      pV P                  VP                  4       R4       V! R4      pV P                  VP                  4       R4       V! R	4      pV P                  VP                  4       R
4       V! R4      pV P                  VP                  4       R4       V! R4      pV P                  VP                  4       R4       V! R4      pV P                  VP                  4       R4       V! R4      pV P                  \        4      ;_uu_ 4       pVP                  4        RRR4       V P                  R\        VP                  4      4       V! R4      pV P                  VP                  4       R
4       V! R4      pV P                  VP                  4       R
4       V! R4      pV P                  VP                  4       R
4       V! R4      pV P                  VP                  4       R
4       V! R4      pV P                  VP                  4       R4       V! R4      pV P                  VP                  4       R4       R#   + '       g   i     EL{; i  + '       g   i     EL<; i)z4.2zy z4.7Nzis inside a coderi   z	range(10)z6.7pyz6.8rC   z7.9z8.endz	x.__len__z9.13zr'asdf'z9.17z10.0z10.6z10.11z11.3z11.11Falsez12.6   cliché)r>   rJ   get_expressionrD   rE   rG   rH   rI   )r   rL   rN   rM   s   &   r   test_get_expression#HyperParserTest.test_get_expression   sh   ooJ))+T2Jz**b +(#bll*;<K))+[9J))+T2J))+R0J))+T2L))+[9K))+Y7Kz**b +(#bll*;<K))+R0K))+R0L))+R0K))+R0L))+W5K))+Y7W +**. +**s   K-K1K.	1L	c                   R  pV P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R	4      4       V P                  V! R
4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  \        P                  ! R^ ^4      \        R4      4       V P                  \        P                  ! R^ ^4      \        R4      4       V P                  \        P                  ! R^ ^4      \        R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       V P                  V! R4      4       R# )c                     \         P                  ! V ^ \        V 4      4      pV\        V 4      8X  d   R# V^ 8X  d   R# RP                  V\        V 4      4      p\	        V4      h)    TFz'Unexpected result: {} (expected 0 or {})r   _eat_identifierlenformat	Exception)	candidateresulterr_msgs   &  r   is_valid_id8HyperParserTest.test_eat_identifier.<locals>.is_valid_id   sY     00As9~NFY'1CJJC	N  ((r   2notidvalid_id	_valid_id	valid_id_
_2valid_idTruerp   Noneforimportreturnclicherq   u   a٢2au   ٢au   a²z+ varvarz+varz.var+ :?^\"z
"a string"N)rR   rT   rJ   r   rx   ry   )r   r   s   & r   test_eat_identifier#HyperParserTest.test_eat_identifier   sG   
	) 	X./ 	J/0K01K01L12 	F+,G,-F+, 	U+,X./X./ 	H-.I./E*+ 	T*+U+,U+, 	44WaCSZP44VQBCJO44VQBCJO 	S)*S)*S)*S)*S)*T*+S)*\23r   c           	     J   \         P                  p\        ^^4       EF  pV P                  V! RV,          ^ V4      V4       V P                  V! RV,          ^ V4      V4       V P                  V! RRV^,
          ,          ,           ^ V4      V4       V P                  V! RRV^,
          ,          ,           ^ V4      V4       V P                  V! RRV^,
          ,          ,           ^ V4      V4       V P                  V! RV^,
          ,          R,           ^ V4      V4       V P                  V! RV,          ^ V4      ^ 4       V P                  V! RRV^,
          ,          ,           ^ V4      ^ 4       V P                  V! RRV^,
          ,          ,           ^ V4      ^ 4       EK  	  R# )   a   é2r   N)r   rx   rangerJ   )r   eat_idlengths   &  r   #test_eat_identifier_various_lengths3HyperParserTest.test_eat_identifier_various_lengths  s^   ,,ArlFVC&L!V<fEVD6M1f=vFVC#!*<$<aH&QVD3&1*+=$=q&I6RVD3&1*+=$=q&I6RVDFQJ$7#$=q&I6RVC&L!V<a@VC#!*<$<aH!LVC$&1**=$=q&I1M #r    N)r   r   r   r   r2   classmethodr*   r.   r4   r:   r>   rO   rV   rZ   rl   rs   r   r   r   r   r   s   @r   r"   r"      st     H 	 - -  
..0$(*$) 0B28h74rN Nr   r"   __main__)	verbosity)__doc__idlelib.hyperparserr   unittesttest.supportr   tkinterr   r   idlelib.editorr   r   TestCaser"   r   mainr   r   r   <module>r      sS    ! +  !  '	7 	7{Nh'' {N| zMMA r   