
    J/Ph                    T   d dl mZ d dl mZ d dlmZmZ d dlmZ d dlZd dl	m
Z
mZmZ d dlmZmZmZ d dlmZ d d	lmZ d d
lmZ d dlmZ d Zd Zd Zd Zd Zd Zd Zd Z d Z!d Z"d Z#d Z$d Z%d Z&d Z'd Z(d Z)d Z*d Z+d Z,d  Z-d! Z.d" Z/d# Z0d$ Z1d% Z2d& Z3d' Z4d( Z5d) Z6d* Z7d+ Z8d, Z9d- Z:d. Z;d/ Z<d0 Z=d1 Z>d2 Z?d3 Z@d4 ZAd5 ZBd6 ZCd7 ZDd8 ZEd9 ZFd: ZGd; ZHd< ZId= ZJd> ZKd? ZLd@ ZMdA ZNdB ZOdC ZPdD ZQdE ZRdF ZSdG ZTdH ZUdI ZVdJ ZWdK ZXdL ZYdM ZZdN Z[dO Z\dP Z]dQ Z^dR Z_dS Z`dT ZadU ZbdV ZcdW ZddX ZedY ZfdZ Zgd[ Zhd\ Zi G d] d^ee
          Zjg d_Zkg d`Zlg daZm G db dcej          Zn G dd deej          Zo G df dgej          Zp G dh diej          Zqerdjk    r ejs                     dS dS )k    )product)permutations)njittypeof)typesN)TestCaseno_pyobj_flagsMemoryLeakMixin)TypingErrorUnsupportedErrorUnsupportedBytecodeError)_MAX_UNICODE)_header_lead)overload)	PYVERSIONc                 4    t          d | D                       S )Nc              3   <   K   | ]}t          |          d k     V  dS )   Nord).0cs     X/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/numba/tests/test_unicode.py	<genexpr>zisascii.<locals>.<genexpr>   s,      ''s1vv|''''''    )allss    r   isasciir      s    ''Q''''''r   c                      dS N   大处着眼，小处着手。 r#   r   r   literal_usecaser$      s    ++r   c                     | S Nr#   xs    r   passthrough_usecaser)      s    Hr   c                     | |k    S r&   r#   r(   ys     r   
eq_usecaser-          6Mr   c                      t          |           S r&   lenr'   s    r   len_usecaser2   !       q66Mr   c                      t          |           S r&   )boolr'   s    r   bool_usecaser6   %   s    77Nr   c                     | |         S r&   r#   r(   is     r   getitem_usecaser:   )   s    Q4Kr   c                 ,    t          | |                   S r&   )hashr8   s     r   getitem_check_kind_usecaser=   -   s    !::r   c                 ,    |                      |          S r&   )zfillr+   s     r   zfill_usecaser@   1       771::r   c                     | |z   S r&   r#   r+   s     r   concat_usecaserC   5       q5Lr   c                     | |z  S r&   r#   r+   s     r   repeat_usecaserF   9   rD   r   c                     | |z  } | S r&   r#   r+   s     r   inplace_concat_usecaserH   =   s    FAHr   c                 
    | |v S r&   r#   r+   s     r   
in_usecaserJ   B   s    6Mr   c                     | |k     S r&   r#   r+   s     r   
lt_usecaserL   F       q5Lr   c                     | |k    S r&   r#   r+   s     r   
le_usecaserO   J   r.   r   c                     | |k    S r&   r#   r+   s     r   
gt_usecaserQ   N   rM   r   c                     | |k    S r&   r#   r+   s     r   
ge_usecaserS   R   r.   r   c                 ,    |                      |          S r&   )	partitionr   seps     r   partition_usecaserX   V   s    ;;sr   c                 ,    |                      |          S r&   findr+   s     r   find_usecaser\   Z       66!99r   c                 .    |                      ||          S r&   rZ   r(   r,   starts      r   find_with_start_only_usecasera   ^   s    66!Ur   c                 0    |                      |||          S r&   rZ   r(   r,   r`   ends       r   find_with_start_end_usecasere   b   s    66!UC   r   c                 ,    |                      |          S r&   )
rpartitionrV   s     r   rpartition_usecaserh   f   s    <<r   c                 ,    |                      |          S r&   countr+   s     r   count_usecaserl   j   rA   r   c                 .    |                      ||          S r&   rj   r_   s      r   count_with_start_usecasern   n       771er   c                 0    |                      |||          S r&   rj   rc   s       r   count_with_start_end_usecaserq   r       771eS!!!r   c                 ,    |                      |          S r&   rfindr+   s     r   rfind_usecaserv   v   rA   r   c                 .    |                      ||          S r&   rt   r_   s      r   rfind_with_start_only_usecaserx   z   ro   r   c                 0    |                      |||          S r&   rt   rc   s       r   rfind_with_start_end_usecaserz   ~   rr   r   c                 .    |                      ||          S r&   replace)r   r(   r,   s      r   replace_usecaser~      s    99Q??r   c                 0    |                      |||          S r&   r|   r   r(   r,   rk   s       r   replace_with_count_usecaser      s    99Q5!!!r   c                 ,    |                      |          S r&   rindexr+   s     r   rindex_usecaser          88A;;r   c                 .    |                      ||          S r&   r   r_   s      r   rindex_with_start_only_usecaser      s    88Aur   c                 0    |                      |||          S r&   r   rc   s       r   rindex_with_start_end_usecaser      s    88Auc"""r   c                 ,    |                      |          S r&   indexr+   s     r   index_usecaser      rA   r   c                 .    |                      ||          S r&   r   r_   s      r   index_with_start_only_usecaser      ro   r   c                 0    |                      |||          S r&   r   rc   s       r   index_with_start_end_usecaser      rr   r   c                 ,    |                      |          S r&   
startswithr+   s     r   startswith_usecaser      s    <<??r   c                 ,    |                      |          S r&   endswithr+   s     r   endswith_usecaser      s    ::a==r   c                 *    |                                  S r&   
expandtabsr   s    r   expandtabs_usecaser          <<>>r   c                 ,    |                      |          S r&   r   r   tabsizes     r   expandtabs_with_tabsize_usecaser      s    <<   r   c                 .    |                      |          S )N)r   r   r   s     r   %expandtabs_with_tabsize_kwarg_usecaser      s    <<<(((r   c                 .    |                      ||          S r&   r   r_   s      r   "startswith_with_start_only_usecaser      s    <<5!!!r   c                 0    |                      |||          S r&   r   rc   s       r   !startswith_with_start_end_usecaser      s    <<5#&&&r   c                 .    |                      ||          S r&   r   r_   s      r    endswith_with_start_only_usecaser      s    ::ar   c                 0    |                      |||          S r&   r   rc   s       r   endswith_with_start_end_usecaser      s    ::a$$$r   c                 ,    |                      |          S r&   splitr+   s     r   split_usecaser      rA   r   c                 .    |                      ||          S r&   r   r(   r,   maxsplits      r   split_with_maxsplit_usecaser          771hr   c                 0    |                      ||          S N)r   r   r   s      r   !split_with_maxsplit_kwarg_usecaser      s    771x7(((r   c                 *    |                                  S r&   r   r'   s    r   split_whitespace_usecaser          7799r   c                 *    |                                  S r&   
splitlinesr   s    r   splitlines_usecaser      r   r   c                 ,    |                      |          S r&   r   r   keependss     r    splitlines_with_keepends_usecaser      s    <<!!!r   c                 .    |                      |          S )N)r   r   r   s     r   &splitlines_with_keepends_kwarg_usecaser      s    <<<***r   c                 ,    |                      |          S r&   rsplitrV   s     r   rsplit_usecaser      s    88C==r   c                 .    |                      ||          S r&   r   r   rW   r   s      r   rsplit_with_maxsplit_usecaser      s    88C"""r   c                 0    |                      ||          S r   r   r   s      r   "rsplit_with_maxsplit_kwarg_usecaser      s    88C(8+++r   c                 *    |                                  S r&   r   r   s    r   rsplit_whitespace_usecaser          88::r   c                 *    |                                  S r&   lstripr'   s    r   lstrip_usecaser      r   r   c                 ,    |                      |          S r&   r   r(   charss     r   lstrip_usecase_charsr          88E??r   c                 *    |                                  S r&   rstripr'   s    r   rstrip_usecaser      r   r   c                 ,    |                      |          S r&   r   r   s     r   rstrip_usecase_charsr      r   r   c                 *    |                                  S r&   stripr'   s    r   strip_usecaser     r   r   c                 ,    |                      |          S r&   r   r   s     r   strip_usecase_charsr     s    775>>r   c                 ,    |                      |          S r&   )joinr+   s     r   join_usecaser   
  r]   r   c                 Z    dg}|                                  |                     |          S )N )popr   )r(   ls     r   join_empty_usecaser     s&    	AEEGGG66!99r   c                 ,    |                      |          S r&   centerr+   s     r   center_usecaser     r   r   c                 .    |                      ||          S r&   r   r(   r,   fillchars      r   center_usecase_fillcharr     s    88Ax   r   c                 ,    |                      |          S r&   ljustr+   s     r   ljust_usecaser     rA   r   c                 .    |                      ||          S r&   r   r   s      r   ljust_usecase_fillcharr   !  r   r   c                 ,    |                      |          S r&   rjustr+   s     r   rjust_usecaser  %  rA   r   c                 .    |                      ||          S r&   r   r   s      r   rjust_usecase_fillcharr  )  r   r   c                 *    |                                  S r&   )istitler'   s    r   istitle_usecaser  -      99;;r   c                 >    g }| D ]}|                     |           |S r&   append)r(   r   r9   s      r   iter_usecaser  1  s,    
A  	Hr   c                 *    |                                  S r&   titler'   s    r   r  r  8  r   r   c                  >    g } dD ]}|                      |           | S r!   r	  )r   r9   s     r   literal_iter_usecaser  <  s,    
A-  	Hr   c                 P    d}d}t          |           D ]\  }}||z  }|dz  }||fS )Nr   r      )	enumerate)r(   bufscanr9   r   s        r   enumerated_iter_usecaser  C  sC    
CD!  1q	9r   c                     t          |           }t          |           }t          |dz             D ]}t          |           d S )Nr  )r1   iterrangenext)r(   nr9   _s       r   iter_stopiteration_usecaser  L  sH    AAQA1q5\\  Q r   c                      d} t          |           }t          |           }t          |dz             D ]}t          |           d S )Nr"   r  )r  r1   r  r  )r   r9   r  r  s       r   "literal_iter_stopiteration_usecaser  S  sM    (AQAAA1q5\\  Q r   c                 *    |                                  S r&   )islowerr'   s    r   islower_usecaser"  [  r  r   c                 *    |                                  S r&   lowerr'   s    r   lower_usecaser&  _  r   r   c                      t          |           S r&   r   r'   s    r   ord_usecaser(  c  r3   r   c                      t          |           S r&   )chrr'   s    r   chr_usecaser+  g  r3   r   c                        e Zd Z fdZ xZS )BaseTestc                 V    t          t          |                                            d S r&   )superr-  setUp)self	__class__s    r   r0  zBaseTest.setUpl  s%    h##%%%%%r   )__name__
__module____qualname__r0  __classcell__)r2  s   @r   r-  r-  k  s8        & & & & & & & & &r   r-  )r   ascii12345
1234567890   ¡Y tú quién te crees?   🐍⚡r"   )r   aaar<  baababascascihr7  asciju   大处着眼，小处着手r"   u%   大处着眼，小处着手。🐍⚡) r   r   )r   r7  )r7  r   )zasc ii )r7  ci)r7  r7  )r7     Ă)r7     大处)r7     étú?)r   +   大处 着眼，小处着手。大大大处)rI  r   )rI  rD  )rI  rE  )rI  u   大处大处)rI  rI  )rI  rF  rI  rG  )rI  rH  )r      tú quién te crees?)rK  r   )rK  rD  )rK  rE  )rK  rK  )rK  rF  )rK  rG  )rK  rH  )ababababa)rL  r?  )rL  aba)
aaaaaaaaaar<  )rO     aĂ)aabbaaaabbaaaac                   2   e Zd Zd ZefdZefdZd Zd ZefdZ	efdZ
efdZefd	Zefd
ZefdZd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZefdZd Zd ZefdZ d Z!d Z"d  Z#d! Z$d" Z%d# Z&d$ Z'd% Z(d& Z)d' Z*d( Z+d) Z,d* Z-d+ Z.d, Z/d- Z0d. Z1d/ Z2d0 Z3d1 Z4d2 Z5d3 Z6d4 Z7d5 Z8d6 Z9d7 Z:d8 Z;d9 Z<d: Z=d; Z>d< Z?d= Z@d> ZAefd?ZBefd@ZCdA ZDdB ZEdC ZFdD ZGdE ZHdF ZIdG ZJdH ZKdI ZLdJ ZMdK ZNdL ZOdM ZPdN ZQdO ZRdP ZSdQ ZTdR ZUdS ZVdT ZWdU ZXefdVZYdW ZZdX Z[dY Z\dZ Z]d[ Z^efd\Z_efd]Z`efd^Zaefd_Zbefd`Zcda Zddb Zedc Zfdd Zgde Zhdf Zidg Zjdh Zkdi Zldj Zmdk Zndl Zodm Zpdn Zqdo Zrdp Zsdq Ztdr Zuds Zvdt Zwdu Zxdv Zydw Zzdx Z{dy Z|dz Z}d{S )|TestUnicodec                     t           }t          t                     }|                      |             |                       d S r&   )r$   r   assertPreciseEqualr1  pyfunccfuncs      r   test_literalzTestUnicode.test_literal  s<     _%%%%''22222r   c                     t           }t          |          }t          D ]*}|                      ||           ||                     +d S r&   )r)   r   UNICODE_EXAMPLESassertEqualr1  flagsrX  rY  r   s        r   test_passthroughzTestUnicode.test_passthrough  sT    $V! 	2 	2AVVAYYa1111	2 	2r   c           	         t           }t          |          }t          D ]}t          t                    D ]}|                      |||           |||          |d|           |                      ||d           ||d          |dd           |                      |d|           |d|          dd|           d S )Nz, r  )r-   r   r\  reversedr]  r1  r_  rX  rY  rM  r=  s         r   test_eqzTestUnicode.test_eq  s   V! 	A 	AA.// A A  1!&q!!!!QQ.?A A A   1!&q!!!!QQ.?A A A  1!&q!!!!QQ.?A A A AA	A 	Ar   c                     t           d             }t          d D ]9\  }}|                      |||          |                    ||                     :d S )Nc                 B    | dk    rd}nd }|dk     rd}nd }||k    rdS dS )Nr   concrete
      r#   )pred1pred2	resolved1	resolved2s       r   fooz)TestUnicode.test_eq_optional.<locals>.foo  sC    qyy&		 	qyy&		 	 I%%rrr   )r  ro  )r   r   r]  py_func)r1  rn  p1p2s       r   test_eq_optionalzTestUnicode.test_eq_optional  sp    		 	 
	   0 	? 	?HRSSR[[#++b"*=*=>>>>	? 	?r   c                    |}t          |          }t          D ];}|                      |||           |||          |j        d|d|d           <t	          t          d          D ]w\  }}|                      |||           |||          |j        d|d|d           |                      |||           |||          |j        d|d|d           xd S )Nz: "z", ""   r)r   UNICODE_ORDERING_EXAMPLESr]  r3  r   )r1  usecaserX  rY  rM  r=  s         r   _check_ordering_opzTestUnicode._check_ordering_op  sC   V + 	 	Aq!a$+$4$4$4aaa;    !!:a@@@ 	 	DAqq!a$+$4$4$4aaa;   q!a$+$4$4$4aaa;   	 	r   c                 :    |                      t                     d S r&   )r|  rL   r1  r_  s     r   test_ltzTestUnicode.test_lt      
+++++r   c                 :    |                      t                     d S r&   )r|  rO   r~  s     r   test_lezTestUnicode.test_le  r  r   c                 :    |                      t                     d S r&   )r|  rQ   r~  s     r   test_gtzTestUnicode.test_gt  r  r   c                 :    |                      t                     d S r&   )r|  rS   r~  s     r   test_gezTestUnicode.test_ge  r  r   c                     t           }t          |          }t          D ]*}|                      ||           ||                     +d S r&   )r2   r   r\  r]  r^  s        r   test_lenzTestUnicode.test_len  sT    V! 	2 	2AVVAYYa1111	2 	2r   c                     t           }t          |          }t          D ]*}|                      ||           ||                     +d S r&   )r6   r   r\  r]  r^  s        r   	test_boolzTestUnicode.test_bool  sT    V! 	2 	2AVVAYYa1111	2 	2r   c                     t           }t          |          }g d}d}|D ]?}|                      ||           ||          |                    |                     @d S )N	r   	zt	t	za	u   	⚡z	a	bc
ab	cu   🐍	⚡u   🐍⚡
		🐍	zabab			ab
	az*Results of "{}".expandtabs() must be equalmsg)r   r   r]  formatr1  rX  rY  casesr  r   s         r   test_expandtabszTestUnicode.test_expandtabs  s    #VN N N ; 	E 	EAVVAYYacjjmmDDDD	E 	Er   c                 V   t          t                    t          t                    g}ddg}g d}|D ]u}t          dd          D ]b}t	          ||          D ]O\  }}|                     |                    ||           |||          |                    ||                     Pcvd S )Nz,Results of "{}".expandtabs({}) must be equalz4Results of "{}".expandtabs(tabsize={}) must be equalr  rp  rh  r  )r   r   r   r  zipr]  rq  r  )r1  fnsmessagesr  r   r   fnr  s           r   test_expandtabs_with_tabsizez(TestUnicode.test_expandtabs_with_tabsize  s    3449::<BJLN N N  	A 	AA R== A A"311 A AGB$$RZZ7%;%;RR7^^),Aw)?)? % A A A AAA	A 	Ar   c                 N   t           }t          |          }t          j        t          f}|                     t                    5 } |dd           d d d            n# 1 swxY w Y   d                    |          }|                     |t          |j
                             d S )Nr  333333@z"tabsize" must be {}, not float)r   r   r   IntegerintassertRaisesr   r  assertInstr	exception)r1  rX  rY  accepted_typesraisesr  s         r   ,test_expandtabs_exception_noninteger_tabsizez8TestUnicode.test_expandtabs_exception_noninteger_tabsize+  s    0V--{++ 	vE$	 	 	 	 	 	 	 	 	 	 	 	 	 	 	/66~FFc3v/0011111s   AA!$A!c           	         t           }t          |          }g d}g d}ddg}|t          z   D ]R}dd|d d         |dd          |||z   g}||z   |z   D ],}|                      |||           |||                     -Sd S )	Nhello
helloworldr   
her  r  ellor   lowolor  r  ohellohellohellorD  r   r(      r   r   r\  r]  )	r1  rX  rY  cpython_strcpython_subs
extra_subsr   default_subsprefixs	            r   test_startswith_defaultz#TestUnicode.test_startswith_default5  s    #V111
 
 
 (-
// 	F 	FAQssVQqrrUAq1u=L&5
B F F  6!2!2EE!V4D4DEEEEF	F 	Fr   c                 P   t           }t          |          }g d}g d}ddg}|t          z   D ]x}dd|d d         |dd          |||z   g}||z   |z   D ]R}t          t	          d	d
                    d gz   D ].}	|                      ||||	           ||||	                     /Syd S Nr  r  r  rD  r   r(   r  r  ri  )r   r   r\  listr  r]  )
r1  rX  rY  r  r  r  r   r  r  r`   s
             r   test_startswith_with_startz&TestUnicode.test_startswith_with_startD  s   3V111
 
 
 (-
// 	> 	>AQssVQqrrUAq1u=L&5
B > >!%R..11TF: > >E$$VVAvu%=%=%*U1fe%<%<> > > >>>	> 	>r   c                    t           }t          |          }g d}g d}ddg}|t          z   D ]}dd|d d         |dd          |||z   g}||z   |z   D ]x}t          t	          d	d
                    d gz   D ]T}	t          t	          d	d
                    d gz   D ]0}
|                      ||||	|
           ||||	|
                     1Uyd S r  r   r   r\  r  r  r]  )r1  rX  rY  r  r  r  r   r  r  r`   rd   s              r   test_startswith_with_start_endz*TestUnicode.test_startswith_with_start_endU  sF   2V111
 
 
 (-
// 	G 	GAQssVQqrrUAq1u=L&5
B G G!%R..11TF: G GE#E#rNN33tf< G G((65#)F)F).q&%)E)EG G G GGGG	G 	Gr   c                    d}|                      t          |          5  t          t                    } |dd           d d d            n# 1 swxY w Y   d}|                      t          |          5  t          t                    } |ddd           d d d            n# 1 swxY w Y   d}|                      t          |          5  t          t
                    } |dddd	           d d d            d S # 1 swxY w Y   d S )
Nz9The arg 'prefix' should be a string or a tuple of stringsr  )r  r  z:When specified, the arg 'start' must be an Integer or Noner  zinvalid startz8When specified, the arg 'end' must be an Integer or Noner   zinvalid end)assertRaisesRegexr   r   r   r   r   )r1  msg_invalid_prefixrY  msg_invalid_startmsg_invalid_ends        r   &test_startswith_exception_invalid_argsz2TestUnicode.test_startswith_exception_invalid_argsg  s   G 	##K1CDD 	& 	&+,,EE'9%%%	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	& 	&
 I 	##K1BCC 	2 	2;<<EE'4111	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2
 G 	##KAA 	3 	3:;;EE'4M222	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3 	3s5   !AAA3"B!!B%(B%	#C99C= C=c           	         t           }t          |          }g d}g d}ddg}|t          z   D ]V}dd|d d         |dd          |||z   g}||z   |z   D ]0}|d	f}	|                      |||	           |||	                     1Wd S )
Nr  r  r  rD  r   r(   r  r  r  r  )
r1  rX  rY  r  r  r  r   r  sub_strr  s
             r   test_startswith_tuplez!TestUnicode.test_startswith_tuplez  s    #V111
 
 
 (-
// 	3 	3AQssVQqrrUAq1u=L',6C 3 3!4  6!2!2!&q&!1!13 3 3 33	3 	3r   c                    t           }t          |          }g d}g d}ddg}|t          z   D ]}dd|d d         |dd          |||z   g}||z   |z   D ]|}t          t	          d	d
                    d gz   D ]X}	t          t	          d	d
                    d gz   D ]4}
|df}|                      ||||	|
           ||||	|
                     5Y}d S )Nr  r  r  rD  r   r(   r  r  r  ri  r  r  )r1  rX  rY  r  r  r  r   r  r  r`   rd   r  s               r   test_startswith_tuple_argsz&TestUnicode.test_startswith_tuple_args  sO   2V111
 
 
 (-
// 	G 	GAQssVQqrrUAq1u=L',6C G G!%R..11TF: G GE#E#rNN33tf< G G")4((65#)F)F).q&%)E)EG G G GGGG	G 	Gr   c           
      4   t           }t          |          }g d}g d}ddg}|t          z   D ]j}dd|d d         |dd          |||z   g}||z   |z   D ]D}d	}	|                      |||           |||          |	                    ||          
           Ekd S )Nr  r  r  rD  r   r(   r  r  z)Results "{}".endswith("{}") must be equalr  r   r   r\  r]  r  )
r1  rX  rY  r  r  r  r   r  r  r  s
             r   test_endswith_defaultz!TestUnicode.test_endswith_default  s    !V 211
 
 
 (-
// 	= 	=AQssVQqrrUAq1u=L',6C = =A  7!3!3UU1g5F5F%(ZZ7%;%; ! = = = ==	= 	=r   c                    t           }t          |          }g d}g d}ddg}|t          z   D ]}dd|d d         |dd          |||z   g}||z   |z   D ]k}t          t	          d	d
                    d gz   D ]G}	d}
|                      ||||	           ||||	          |
                    |||	                     Hld S )Nr  r  r  rD  r   r(   r  r  r  ri  z-Results "{}".endswith("{}", {}) must be equalr  )r   r   r\  r  r  r]  r  )r1  rX  rY  r  r  r  r   r  r  r`   r  s              r   test_endswith_with_startz$TestUnicode.test_endswith_with_start  s3   1V 211
 
 
 (-
// 	H 	HAQssVQqrrUAq1u=L',6C H H!%R..11TF: H HEIC$$VVAw%>%>%*U1gu%=%=),Aw)F)F % H H H HHH	H 	Hr   c                    t           }t          |          }g d}g d}ddg}|t          z   D ]}dd|d d         |dd          |||z   g}||z   |z   D ]}t          t	          d	d
                    d gz   D ]n}	t          t	          d	d
                    d gz   D ]J}
d}|                      ||||	|
           ||||	|
          |                    |||	|
                     Kod S )Nr  r  r  rD  r   r(   r  r  r  ri  OResults "{}".endswith("{}", {}, {})                               must be equalr  r   r   r\  r  r  r]  r  )r1  rX  rY  r  r  r  r   r  r  r`   rd   r  s               r   test_endswith_with_start_endz(TestUnicode.test_endswith_with_start_end  si   0V 211
 
 
 (-
// 		Q 		QAQssVQqrrUAq1u=L',6C Q Q!%R..11TF: Q QE#E#rNN33tf< Q Q.((7E3)G)G).q'5#)F)F-0ZZ7E3-O-O ) Q Q Q QQQQ		Q 		Qr   c           
      <   t           }t          |          }g d}g d}ddg}|t          z   D ]n}dd|d d         |dd          |||z   g}||z   |z   D ]H}d	}	|d
f}
|                      |||
           |||
          |	                    ||
                     Iod S )Nr  r  r  rD  r   r(   r  r  z'Results "{}".endswith({}) must be equalr  r  r  )r1  rX  rY  r  r  r  r   r  r  r  
tuple_subss              r   test_endswith_tuplezTestUnicode.test_endswith_tuple  s   !V 211
 
 
 (-
// 	@ 	@AQssVQqrrUAq1u=L',6C @ @?%t_
  :!6!6!&q*!5!5%(ZZ:%>%> ! @ @ @ @@	@ 	@r   c                    t           }t          |          }g d}g d}ddg}|t          z   D ]}dd|d d         |dd          |||z   g}||z   |z   D ]}t          t	          d	d
                    d gz   D ]r}	t          t	          d	d
                    d gz   D ]N}
d}|df}|                      ||||	|
           ||||	|
          |                    |||	|
                     Osd S )Nr  r  r  rD  r   r(   r  r  r  ri  r  r  r  r  )r1  rX  rY  r  r  r  r   r  r  r`   rd   r  r  s                r   test_endswith_tuple_argsz$TestUnicode.test_endswith_tuple_args  sy   0V 211
 
 
 (-
// 	E 	EAQssVQqrrUAq1u=L',6C 	E 	E!%R..11TF: E EE#E#rNN33tf< E E.&-t_
((:uc)J)J).q*eS)I)I-0ZZ:8=s.D .D ) E E E E	EE	E	E 	Er   c                     t           }t          |          }t          D ]^}dd|d d d         |d d         |dd          |||z   g}|D ]4}|                      |||           |||          d|d|d           5_d S )	Nr   xxrp  r  r  'z' in ''?)rJ   r   r\  r]  )r1  r_  rX  rY  rM  extrassubstrs          r   test_inzTestUnicode.test_in  s    V! 	@ 	@A$$$B$3B31221q5AF  @ @  !2!2!&vq!1!1!14:FFAAA!>@ @ @ @@	@ 	@r   c                 Z   |                                   t          }t          |          }||fD ]h}|                     t                    5 } |dd           d d d            n# 1 swxY w Y   |                     dt          |j                             it          j	        t          j
        f}|                     t                    5 } |dd            d d d            n# 1 swxY w Y   d                    |          }|                     |t          |j                             d S NrM  r   empty separatorz"sep" must be {}, not none)disable_leak_checkrX   r   r  
ValueErrorr  r  r  r   UnicodeTypeUnicodeCharSeqr   r  r1  rX  rY  funcr  r  r  s          r   $test_partition_exception_invalid_sepz0TestUnicode.test_partition_exception_invalid_sep  s   !!!"V UO 	D 	DD"":.. &S"              MM+S1A-B-BCCCC+U-AB{++ 	vE#t	 	 	 	 	 	 	 	 	 	 	 	 	 	 	*11.AAc3v/0011111$   A$$A(	+A(	
C##C'*C'c           	          t           }t          |          }g d}d}|D ]E\  }}|                      |||           |||          |                    ||                     Fd S )N	r      ⚡abcabcr  r;  r     🐍⚡🐍r  abababarM  r  r=  r  r   r  r?  r  rN  z-Results of "{}".partition("{}") must be equalr  )rX   r   r]  r  r1  rX  rY  CASESr  r   rW   s          r   test_partitionzTestUnicode.test_partition'  s    "V

 

 

 > 	5 	5FAsVVAs^^UU1c]]!$As!3!3  5 5 5 5	5 	5r   c                 T   t           }t          |          }d t          D             }dg dfdg dfddgfddgfd	d
gfdg dfdddgfddgfddgfddgfg
}||z   D ]L\  }}|D ]D}d}	|                      |||           |||          |	                    ||                     EMd S )Nc           	      @    g | ]}|d d|dd         |dd         |gfS r   r  Nr  r  r#   r   r   s     r   
<listcomp>z)TestUnicode.test_find.<locals>.<listcomp>?  E     
 
 
23QT1SbS61QRR5!,-
 
 
r   uf   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaĂrF  u   ȁu   Ġu   Ƞuh   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa􀌄   􀌄u   􀈄u   􂀄   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂarM    􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄a  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄ĂrF  daaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)rF  r  rP  u   a􀌄   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂr  u   Ă􀌄   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂa_a_  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄a_  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄Ă_   Ă_z%Results "{}".find("{}") must be equalr  )r\   r   r\  r]  r  )
r1  r_  rX  rY  r  r  r   subsr  r  s
             r   	test_findzTestUnicode.test_find;  sD   V
 
7G
 
 
 "#K#K#KL% (6 (6 (6 7!C5)%u-*XJ7JJJKl,>?@"TF+&/+i[9
 $l2 	= 	=GAt = ==  7!3!3UU1g5F5F%(ZZ7%;%; ! = = = ==	= 	=r   c                 L   t           }t          |          }t          D ]}dd|d d         |dd          |fD ]k}t          t	          dd                    d gz   D ]G}d}|                      ||||           ||||          |                    |||                     Hld S )	Nr   r  r  r  r  ri  z)Results "{}".find("{}", {}) must be equalr  )ra   r   r\  r  r  r]  r  r1  rX  rY  r   r  r`   r  s          r   test_find_with_start_onlyz%TestUnicode.test_find_with_start_onlyW  s    -V! 	H 	HAafaeQ7 H H!%R..11TF: H HEEC$$VVAw%>%>%*U1gu%=%=),Aw)F)F % H H H HHH	H 	Hr   c                 |   t           }t          |          }t          t          dd                    d gz   x}}t          D ]z}dd|d d         |dd          |fD ]`}t          ||          D ]M\  }}d}	|                      |||||           |||||          |	                    ||||                     Na{d S )	Nr  ri  r   r  r  r  z0Results of "{}".find("{}", {}, {}) must be equalr  )re   r   r  r  r\  r   r]  r  
r1  rX  rY  startsendsr   r  r`   rd   r  s
             r   test_find_with_start_endz$TestUnicode.test_find_with_start_endc  s   ,VU3^^,,v55! 	M 	MAafaeQ7 M M")&$"7"7 M MJE3LC$$VVAws%C%C%*U1guc%B%B),Aws)K)K % M M M MMM	M 	Mr   c                 p   t           }t          |          }t          j        t          j        f}dD ]\  }}}|                     t                    5 } |dd||           d d d            n# 1 swxY w Y   d                    ||          }|                     |t          |j
                             d S N))皙?   r`   )r         ?rd   r7  sciz"{}" must be {}, not float)re   r   r   r  NoneTyper  r   r  r  r  r  )	r1  rX  rY  acceptedr`   rd   namer  r  s	            r   (test_find_exception_noninteger_start_endz4TestUnicode.test_find_exception_noninteger_start_endp  s    ,VM5>2 D 	6 	6E3"";// 26gueS1112 2 2 2 2 2 2 2 2 2 2 2 2 2 2.55dHEECMM#s6#3445555		6 	6s   A,,A0	3A0	c                 Z   |                                   t          }t          |          }||fD ]h}|                     t                    5 } |dd           d d d            n# 1 swxY w Y   |                     dt          |j                             it          j	        t          j
        f}|                     t                    5 } |dd            d d d            n# 1 swxY w Y   d                    |          }|                     |t          |j                             d S r  )r  rh   r   r  r  r  r  r  r   r  r  r   r  r  s          r   %test_rpartition_exception_invalid_sepz1TestUnicode.test_rpartition_exception_invalid_sep{  s   !!!#V UO 	D 	DD"":.. &S"              MM+S1A-B-BCCCC+U-AB{++ 	vE#t	 	 	 	 	 	 	 	 	 	 	 	 	 	 	*11.AAc3v/0011111r  c           	          t           }t          |          }g d}d}|D ]E\  }}|                      |||           |||          |                    ||                     Fd S )Nr  z.Results of "{}".rpartition("{}") must be equalr  )rh   r   r]  r  r  s          r   test_rpartitionzTestUnicode.test_rpartition  s    #V

 

 

 ? 	5 	5FAsVVAs^^UU1c]]!$As!3!3  5 5 5 5	5 	5r   c                     t           }t          |          }d}t          D ]J\  }} |||          } |||          }|                     |||                    ||||                     Kd S )Nz6'{0}'.py_count('{1}') = {2}
'{0}'.c_count('{1}') = {3})rl   r   UNICODE_COUNT_EXAMPLESr]  r  )r1  rX  rY  	error_msgr   sub	py_resultc_results           r   
test_countzTestUnicode.test_count  s    VM	, 	L 	LFAsq#IuQ}}HY&--aiJJL L L L	L 	Lr   c                    t           }t          |          }ddz  }t          D ]\  }}t          dd          D ]J} ||||          } ||||          }|                     |||                    |||||                     K |||d           } |||d           }|                     |||                    ||d ||                     d S )N%s
%s)z '{0}'.py_count('{1}', {2}) = {3}z'{0}'.c_count('{1}', {2}) = {4}   )rn   r   r*  r  r]  r  )	r1  rX  rY  r+  r   r,  r9   r-  r.  s	            r   test_count_with_startz!TestUnicode.test_count_with_start  s%   )V  C C	 - 	9 	9FAs3^^ = ="F1c1--	 5C++  H!*!1!1!S!Y2:"< "<= = = = q#t,,IuQT**HY&--adI.68 89 9 9 9	9 	9r   c                    t           }t          |          }ddz  }t          D ]\  }}t          t	          dd          d          D ]P\  }} |||||          } |||||          }	|                     ||	|                    ||||||	                     Qt	          dd          D ]M} |||d |          } |||d |          }	|                     ||	|                    ||d |||	                     N |||d d           } |||d d           }	|                     ||	|                    ||d d ||	                      d S )Nr1  )%'{0}'.py_count('{1}', {2}, {3}) = {4}z$'{0}'.c_count('{1}', {2}, {3}) = {5}r2  r3  )r2  r3  )rq   r   r*  r   r  r]  r  )
r1  rX  rY  r+  r   r,  r9   jr-  r.  s
             r   test_count_with_start_endz%TestUnicode.test_count_with_start_end  s   -V  H H	 - 	9 	9FAsc2	:: = =1"F1c1a00	 5CA..  H!*!1!1!S!Q	2:"< "<= = = = 3^^ = ="F1c433	 5Cq11  H!*!1!1!S$92:"< "<= = = = q#tT22IuQT400HY&--adD).68 89 9 9 9#	9 	9r   c                    t          t                    }|                     t                    5 } |dddd           d d d            n# 1 swxY w Y   |                     dt          |j                             |                     t                    5 } |dddd           d d d            n# 1 swxY w Y   |                     dt          |j                             |                     t                    5 } |dddd           d d d            n# 1 swxY w Y   |                     d	t          |j                             d S )
Nr7  r   r  r  ,The slice indices must be an Integer or Noneg333333?      z(The substring must be a UnicodeType, not)r   rq   r  r   r  r  r  r1  rY  r  s      r   test_count_arg_type_checkz%TestUnicode.test_count_arg_type_check  s   122{++ 	(vE'33'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(D&*++	- 	- 	- {++ 	(vE'3Q'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(D&*++	- 	- 	- {++ 	%vE'2q!$$$	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	% 	%@&*++	- 	- 	- 	- 	-s5   A

AAB22B69B6?DD!Dc                    t           fd}|                     t                    5 } |dddd           d d d            n# 1 swxY w Y   |                     dt	          |j                             ddz  }t          j        t          j        t          j        t          j	        t          j                  t          j	        t          j                            } t          |g                    } dddd	          } |dddd	          }|                     |||                    dddd	||                     d S )
Nc                      t          j        t           j        t           j        t          j        t           j                  t          j        t           j                            } t          |g                     d S r&   )r   int64unicode_typeOptionalfloat64r   )argsbad_sigrX  s     r   try_compile_bad_optionalzPTestUnicode.test_count_optional_arg_type_check.<locals>.try_compile_bad_optional  s_    k%"4"'"4"'."?"?"'."?"?A AG D'OOF#####r   	   tú quis?u   tú皙?r:  r1  )r6  z''{0}'.c_count_op('{1}', {2}, {3}) = {5}r      )rq   r  r   r  r  r  r   rA  rB  rC  r   r]  r  )	r1  rG  r  r+  sig_optionalcfunc_optionalr-  r.  rX  s	           @r   "test_count_optional_arg_type_checkz.TestUnicode.test_count_optional_arg_type_check  s   -	$ 	$ 	$ 	$ 	$ {++ 	Cv$$[%cBBB	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	C 	CD&*++	- 	- 	-   K K	{5#5#(#5#(>%+#>#>#(>%+#>#>@ @ .|n--f55F;q!44	!>+ua;;H"))+uaI*24 4	5 	5 	5 	5 	5s   AA
Ac                 ^   t           }t          |          }d t          D             }dg dfdg dfdddgfd	d
gfdd
gfddgfdg dfdddgfddgfddgfddgfg}||z   D ]L\  }}|D ]D}d}|                      |||           |||          |                    ||                     EMd S )Nc           	      @    g | ]}|d d|dd         |dd         |gfS r   r#   r  s     r   r  z*TestUnicode.test_rfind.<locals>.<listcomp>  r  r   uf   Ăaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar  uh   􀌄aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar  abcdefghiabcabcr      aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂrM    a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄  Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄rF  r
  )rF  r  u   Ăau   􀌄ar  r  u   􀌄Ă   _aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂ_a  _a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄  _Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄   _Ăz&Results "{}".rfind("{}") must be equalr  )rv   r   r\  r]  r  	r1  rX  rY  r  r  r   r  r  r  s	            r   
test_rfindzTestUnicode.test_rfind
  sP   V
 
7G
 
 
 "#K#K#KL% (6 (6 (6 7eR[)!C5)%u-*XJ7JJJKl,>?@"TF+&/+i[9
 $l2 	= 	=GAt = =>  7!3!3UU1g5F5F%(ZZ7%;%; ! = = = ==	= 	=r   c                 L   t           }t          |          }t          D ]}dd|d d         |dd          |fD ]k}t          t	          dd                    d gz   D ]G}d}|                      ||||           ||||          |                    |||                     Hld S )	Nr   r  r  r  r  ri  z*Results "{}".rfind("{}", {}) must be equalr  )rx   r   r\  r  r  r]  r  r  s          r   test_rfind_with_start_onlyz&TestUnicode.test_rfind_with_start_only'  s    .V! 	H 	HAafaeQ7 H H!%R..11TF: H HEFC$$VVAw%>%>%*U1gu%=%=),Aw)F)F % H H H HHH	H 	Hr   c                    t           }t          |          }t          t          dd                    d gz   }t          t          dd                    d gz   }t          D ]z}dd|d d         |dd          |fD ]`}t          ||          D ]M\  }}d}	|                      |||||           |||||          |	                    ||||                     Na{d S )	Nr  ri  r   r  r  r  z1Results of "{}".rfind("{}", {}, {}) must be equalr  )rz   r   r  r  r\  r   r]  r  r  s
             r   test_rfind_with_start_endz%TestUnicode.test_rfind_with_start_end3  s#   -VeCnn%%.E#rNN##tf,! 	M 	MAafaeQ7 M M")&$"7"7 M MJE3MC$$VVAws%C%C%*U1guc%B%B),Aws)K)K % M M M MMM	M 	Mr   c                 V   t          t                    }t          D ]}dD ]}|                     t                    5 } |||           d d d            n# 1 swxY w Y   d                    t          j                  }|                     |t          |j
                             d S )N)Nr  F
must be {})r   rv   r\  r  r   r  r   r  r  r  r  )r1  rY  r   r  r  r  s         r   test_rfind_wrong_substrz#TestUnicode.test_rfind_wrong_substrA  s    ]##! 	: 	:A+ : :&&{33 &vE!W%%%& & & & & & & & & & & & & & &"))%*;<<c3v'7#8#89999	:	: 	:s   AAAc           
      
   t          t                    }t          j        t          j        f}t
          D ]M}dd|d d         |dd          |fD ]1}t          ddgddg          D ]\  }}|                     t                    5 } |||||           d d d            n# 1 swxY w Y   d		                    |          }| 
                    |t          |j                             t          ddgd
dg          D ]\  }}|                     t                    5 } |||||           d d d            n# 1 swxY w Y   d	                    |          }| 
                    |t          |j                             3Od S )Nr   r  r  r  r  Frp  r  z"start" must be {}gTz"end" must be {})r   rz   r   r  r!  r\  r   r  r   r  r  r  r  )	r1  rY  r  r   r  r`   rd   r  r  s	            r   test_rfind_wrong_start_endz&TestUnicode.test_rfind_wrong_start_endK  s   122-8! 	> 	>AafaeQ7 > >")3,Q"@"@ > >JE3**;77 66a%5556 6 6 6 6 6 6 6 6 6 6 6 6 6 6.55nEECMM#s6+;'<'<==== #*2q'D$<"@"@ > >JE3**;77 66a%5556 6 6 6 6 6 6 6 6 6 6 6 6 6 6,33NCCCMM#s6+;'<'<====	>>	> 	>s$   B	B#&B#D6	6D:=D:c                 :   t           d         }|dd         }t          j        t          j        f}d                    |          }d }|                     t                    5 } |||dd           d d d            n# 1 swxY w Y   |                     |t          |j	                             d }|                     t                    5 } |||dd           d d d            n# 1 swxY w Y   |                     |t          |j	                             d S )Nr   r  rp  ra  c                     t          j        t           j        t           j        t          j        t           j                  t          j        t           j                            } t          |g          t                     d S r&   )r   rA  rB  rC  rD  intpr   rz   rE  wrong_sig_optionals     r    try_compile_wrong_start_optionalzYTestUnicode.test_rfind_wrong_start_end_optional.<locals>.try_compile_wrong_start_optionale  sd    !&U-?-2-?-2^EM-J-J-2^EJ-G-G"I "I 'D$%&&'CDDDDDr   r  c                     t          j        t           j        t           j        t          j        t           j                  t          j        t           j                            } t          |g          t                     d S r&   )r   rA  rB  rC  rg  rD  r   rz   rh  s     r   try_compile_wrong_end_optionalzWTestUnicode.test_rfind_wrong_start_end_optional.<locals>.try_compile_wrong_end_optionalp  sd    !&U-?-2-?-2^EJ-G-G-2^EM-J-J"L "L 'D$%&&'CDDDDDr   )
r\  r   r  r!  r  r  r   r  r  r  )r1  r   r  r  r  rj  r  rl  s           r   #test_rfind_wrong_start_end_optionalz/TestUnicode.test_rfind_wrong_start_end_optional_  s   QAbD'-8!!.11	E 	E 	E {++ 	Av,,Qa@@@	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	A 	Ac3v/00111	E 	E 	E {++ 	?v**1gq#>>>	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	?c3v/0011111s$   "A==BBC((C,/C,c           
      6   t           }t          |          }d t          D             }dg dfddgfddgfddgfd	d
gfdd
gfddgfg}||z   D ]L\  }}|D ]D}d}|                      |||           |||          |                    ||                     EMd S )Nc                 >    g | ]}|d |dd         |dd         |gfS r   Nr  r  r#   r  s     r   r  z+TestUnicode.test_rindex.<locals>.<listcomp>  C     
 
 
,-QQssVQqrrUA&'
 
 
r   rP  r   defrQ  rR  rM  rS  rT  rF  rU  rV  rW  rX  rY  z'Results "{}".rindex("{}") must be equalr  )r   r   r\  r]  r  rZ  s	            r   test_rindexzTestUnicode.test_rindex{  s   V
 
1A
 
 
 ///0!C5)%u-*XJ7"TF+&/+i[9
 $l2 	= 	=GAt = =?  7!3!3UU1g5F5F%(ZZ7%;%; ! = = = ==	= 	=r   c           
      6   t           }t          |          }d t          D             }dg dfddgfddgfddgfd	d
gfdd
gfddgfg}||z   D ]L\  }}|D ]D}d}|                      |||           |||          |                    ||                     EMd S )Nc                 >    g | ]}|d |dd         |dd         |gfS rp  r#   r  s     r   r  z*TestUnicode.test_index.<locals>.<listcomp>  rq  r   rP  rr  r  rM  r  r	  rF  r  r  r  r  r  z&Results "{}".index("{}") must be equalr  )r   r   r\  r]  r  rZ  s	            r   
test_indexzTestUnicode.test_index  s   V
 
1A
 
 
 ///0!C5)%u-*XJ7"TF+&/+i[9
 $l2 	= 	=GAt = =>  7!3!3UU1g5F5F%(ZZ7%;%; ! = = = ==	= 	=r   c                    t           t          g}ddg}g d}t          ||          D ]:\  }}t          |          }|D ]!}t	          |          }dt          t          d|dz                       f|d d         dgt          t          dd|z
                      z   f|d	d          t          t          d
                    t          t          dd
|z
                      z   f|dgt          t          dd|z
                      z   fg}	|	D ]Q\  }
}|d gz   D ]E}|                      |||
|           |||
|          |                    ||
|                     FR#<d S )Nz*Results "{}".index("{}", {}) must be equalz+Results "{}".rindex("{}", {}) must be equalr7  r8  r9  r:  r"   r   r  r  r   r     r  )	r   r   r  r   r1   r  r  r]  r  )r1  pyfuncsr  unicode_examplesrX  r  rY  r   r   r  r  r  r`   s                r   !test_index_rindex_with_start_onlyz-TestUnicode.test_index_rindex_with_start_only  s   013@AC
 
 
 w11 	L 	LKFCLLE% L LFFeCQ//001ssVaS4c1q5(9(9#:#::;qrrUDqNNT%QU2C2C-D-DDEd5a!e#4#45556	 (- L LOGV!'4& L L((7E)B)B).q'5)A)A-0ZZ7E-J-J ) L L L LLLL	L 	Lr   c                    t           t          g}ddg}g d}t          ||          D ]\  }}t          |          }|D ]}t	          |          }dt          t          d|dz                       t          t          |d                    f|d d         d	gt          t          dd|z
                      z   dd
gt          t          |dz
  d                    z   f|dd          t          t          d                    t          t          dd
                    z   t          t          |d                    f|d	gt          t          dd|z
                      z   t          t          |d                    fg}	|	D ]f\  }
}}t          |d gz   |          D ]K\  }}|                      |||
||           |||
||          |	                    ||
||                     Lgd S )Nz1Results of "{}".index("{}", {}, {}) must be equalz2Results of "{}".rindex("{}", {}, {}) must be equalry  r   rz  r  rh  r  r   rp  rw  r  r{  r  )
r   r   r  r   r1   r  r  r   r]  r  )r1  r|  r  r}  rX  r  rY  r   r   r  r  r  r  r`   rd   s                  r    test_index_rindex_with_start_endz,TestUnicode.test_index_rindex_with_start_end  s7   /1NOGHJ
 
 
 w11 	Q 	QKFCLLE% Q QFFeCQ//00$uQ||2D2DEssVaS4c1q5(9(9#:#::"XU1q5"%5%5 6 668qrrUDqNNT%R..-A-AA%2,,'')d5a!e#4#4555tE!RLL7I7IJ .3 Q Q)GVT&-fvot&D&D Q Q
s((7E3)G)G).q'5#)F)F-0ZZ7E3-O-O ) Q Q Q QQQQ	Q 	Qr   c                    |                                   g d}t          t          g}|D ]N}t          |          }|D ]8}t	          |          }dt          t          |dz   d                    |gf|d d         dgt          t          |dz
                      f|dd          t          t          d	d                    |gf|d gt          t          |                    fg}|D ]\  }}	}
t          |	|
          D ]v\  }}||fD ]l}|                     t                    5 } |||||           d d d            n# 1 swxY w Y   d
}| 
                    |t          |j                             mw:Pd S )Nry  r   r  rh  r  r   rw  r  r{  zsubstring not found)r  r   r   r   r1   r  r  r   r  r  r  r  r  )r1  r}  r|  rX  rY  r   r   r  r  r  r  r`   rd   r  r  r  s                   r   /test_index_rindex_exception_substring_not_foundz;TestUnicode.test_index_rindex_exception_substring_not_found  s   !!!
 
 
 01NO 	F 	FFLLE% F FFFeAE2..//!5ssVaS$uQU||"4"45qrrUDq"..4U1XX/	 .3 F F)GVT&-fd&;&; F F
s%+UO F FD!%!2!2:!>!> =& $Q < < <= = = = = = = = = = = = = = ="7C MM#s63C/D/DEEEE	FFFF	F 	Fs   "D==EEc           	         t           j        t           j        f}t          t          g}|D ]}t          |          }dD ]\  }}}|                     t                    5 } |dd||           d d d            n# 1 swxY w Y   d                    ||          }	| 	                    |	t          |j                             d S r  )r   r  r!  r   r   r   r  r   r  r  r  r  )
r1  r"  r|  rX  rY  r`   rd   r#  r  r  s
             r   0test_index_rindex_exception_noninteger_start_endz<TestUnicode.test_index_rindex_exception_noninteger_start_end  s   M5>2/1NO 	: 	:FLLE$H : : sD&&{33 6vE'5%5556 6 6 6 6 6 6 6 6 6 6 6 6 6 6299$IIc3v'7#8#89999	:	: 	:s   A77A;>A;c           	         t           }t          |          }t          D ]`}t          t	          |           t	          |                    D ]2}|                      |||           |||          d||fz             3ad S )N	'%s'[%d]?)r:   r   r\  r  r1   r]  )r1  rX  rY  r   r9   s        r   test_getitemzTestUnicode.test_getitem  s     V! 	7 	7ACFF7CFF++ 7 7  1!&q!!,1v!57 7 7 77	7 	7r   c           	          t           }t          |          }ddg}|D ]`}t          t          |           t          |                    D ]2}|                      |||           |||          d||fz             3ad S )Nu   aሴu   ¡着r  )r=   r   r  r1   r]  )r1  rX  rY  samplesr   r9   s         r   test_getitem_scalar_kindz$TestUnicode.test_getitem_scalar_kind  s     ,Vg& 	7 	7ACFF7CFF++ 7 7  1!&q!!,1v!57 7 7 77	7 	7r   c                 :   |                                   t          }t          |          }t          D ]}|                     t
                    5 } ||t          |                     d d d            n# 1 swxY w Y   |                     dt          |j	                             |                     t
                    5 } ||t          |                     d d d            n# 1 swxY w Y   |                     dt          |j	                             d S )Nzstring index out of range)
r  r:   r   r\  r  
IndexErrorr1   r  r  r  )r1  rX  rY  r   r  s        r   test_getitem_errorzTestUnicode.test_getitem_error#  s   !!! V! 	N 	NA"":.. "&q#a&&!!!" " " " " " " " " " " " " " "MM5s6;K7L7LMMM"":.. !&aQ   ! ! ! ! ! ! ! ! ! ! ! ! ! ! !MM5s6;K7L7LMMMM	N 	Ns$   A44A8	;A8	C''C+	.C+	c                    t           }t          |          }t          D ]}t          t	          t          |           t          |                              D ]~}t          t	          t          |           t          |                              D ]C}t          ||          }|                      |||           |||          d|||fz             Dd S )N'%s'[%d:%d]?)r:   r   r\  r  r  r1   slicer]  r1  rX  rY  r   r9   r7  sls          r   test_slice2zTestUnicode.test_slice22  s     V! 	A 	AA%QQ0011 A AeSVVGSVV4455 A AAq!B$$VVAr]]%*U1b\\%3q!Qi%?A A A AAA	A 	Ar   c                 `   t           }t          |          }t          D ]}ddt          |          t          |          dz   fD ]i}ddt          |          t          |          dz   fD ]C}t	          ||          }|                      |||           |||          d|||fz             Djd S )Nr  rp  r  r  r:   r   r\  r1   r  r]  r  s          r   test_slice2_errorzTestUnicode.test_slice2_error>  s     V! 	A 	AA"c!ffc!ffqj1 A Ab#a&&#a&&1*5 A AAq!B$$VVAr]]%*U1b\\%3q!Qi%?A A A AAA	A 	Ar   c                 j   t           }t          |          }ddg}|D ]}dddddt          |          t          |          dz   fD ]l}dddddt          |          t          |          dz   fD ]C}t          ||          }|                      |||           |||          d|||fz             Dmd S )	N	   abcሴሴu   ¡¡¡着着着r  rp  r   r  rw  r  )r=   r   r1   r  r]  )r1  rX  rY  r  r   r9   r7  r  s           r   test_getitem_slice2_kindz$TestUnicode.test_getitem_slice2_kindJ  s     ,V$&78 	A 	AA"aAs1vvs1vvz: A Ab!Q3q663q66A:> A AAq!B$$VVAr]]%*U1b\\%3q!Qi%?A A A AAA	A 	Ar   c                    t           }t          |          }t          D ]}t          t	          |           t	          |                    D ]x}t          t	          |           t	          |                    D ]J}dD ]E}t          |||          }|                      |||           |||          d||||fz             FKyd S )Nr  rp  r  rw  '%s'[%d:%d:%d]?)r:   r   r\  r  r1   r  r]  r1  rX  rY  r   r9   r7  kr  s           r   test_slice3zTestUnicode.test_slice3X  s     V! 	K 	KACFF7CFF++ K KAwA// K KA+ K K"1a^^((2).q"):aAq\)IK K K KKKK	K 	Kr   c                    t           }t          |          }g d}|D ]}t          t          |           t          |                    D ]x}t          t          |           t          |                    D ]J}dD ]E}t	          |||          }|                      |||           |||          d||||fz             FKyd S )N)r  u   aሴbሴc¡¡¡着着着u   ¡着¡着¡着u   着a着b着cu   ¡着a¡着b¡着cu   ¡着a着¡cr  r  )r=   r   r  r1   r  r]  )	r1  rX  rY  r  r   r9   r7  r  r  s	            r   test_getitem_slice3_kindz$TestUnicode.test_getitem_slice3_kinde  s    ,V$ $ $  	K 	KACFF7CFF++ K KAwA// K KA+ K K"1a^^((2).q"):aAq\)IK K K KKKK	K 	Kr   c                 n   t           }t          |          }t          D ]}ddt          |          t          |          dz   fD ]p}ddt          |          t          |          dz   fD ]J}dD ]E}t	          |||          }|                      |||           |||          d||||fz             FKqd S )Nr  rp  r  r  r  r  r  s           r   test_slice3_errorzTestUnicode.test_slice3_errorz  s     V! 	K 	KA"c!ffc!ffqj1 K Kb#a&&#a&&1*5 K KA+ K K"1a^^((2).q"):aAq\)IK K K KKKK	K 	Kr   c                 h    t           d             }d}|                      ||          d           dS )z
        Make sure ascii flag is False when ascii and non-ascii characters are
        mixed in output of Unicode slicing.
        c                 B    | d d d         j         | dd d         j         fS )Nrw  r  	_is_asciir   s    r   fz,TestUnicode.test_slice_ascii_flag.<locals>.f  s'    SSqS6#Qqt!tW%666r   u    ¿abc¡Y tú, quién te cre		es?)r   r  Nr   r]  r1  r  r   s      r   test_slice_ascii_flagz!TestUnicode.test_slice_ascii_flag  sH    
 
	7 	7 
	7 11v&&&&&r   c           	         t           }t          |          }g d}|                     t                    5 } ||d         d           d d d            n# 1 swxY w Y   |                     dt          |j                             |D ]?}t          dd          D ],}|                      |||           |||                     -@d S )N)r7  z+asciiz-asciiz-asc ii-r8  z-12345z+12345r   u   ¡Y tú crs?r;  u   +🐍⚡u   -🐍⚡u   大眼，小手。u   +大眼，小手。u   -大眼，小手。r   rI  z<width> must be an Integerri  )	r@   r   r  r   r  r  r  r  r]  )r1  rX  rY  ZFILL_INPUTSr  r   widths          r   
test_zfillzTestUnicode.test_zfill  s.   V
 
 
$ {++ 	(vE,q/3'''	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	( 	(2C8H4I4IJJJ 	2 	2Ar2 2 2  5!1!1!&q%2 2 2 22	2 	2s   AAAc                     t           }t          |          }t          D ]G}t          d d d         D ]4}|                      |||           |||          d|d|d           5Hd S Nrp  r  z' + 'r  )rC   r   r\  r]  rc  s         r   test_concatzTestUnicode.test_concat  s    V! 	: 	:A%ddd+ : :  1!&q!3411aaa!8: : : ::	: 	:r   c           	          t           }t          |          }t          D ][}dD ]V}|                      |||           |||                     |                      |||           |||                     W\d S )N)rp  r   r  rw  r  r{  r  r;  rJ     F   )rF   r   r\  r]  rc  s         r   test_repeatzTestUnicode.test_repeat  s    V! 	. 	.A9 . .  1!&q!. . .  1!&q!. . . ..	. 	.r   c                 2   |                                   t          t                    }|                     t                    5 } |dd           d d d            n# 1 swxY w Y   |                     t          dz   t          |j                             d S )Nhig      @z" Function(<built-in function mul>))	r  r   rF   r  r   r  r   r  r  r=  s      r   test_repeat_exception_floatz'TestUnicode.test_repeat_exception_float  s    !!!^$${++ 	vE$	 	 	 	 	 	 	 	 	 	 	 	 	 	 	l%II&*++	- 	- 	- 	- 	-s   AA #A c                 4   |                                   t          }t          |          }||fD ]h}|                     t                    5 } |dd           d d d            n# 1 swxY w Y   |                     dt          |j                             id S NrM  r   r  )r  r   r   r  r  r  r  r  r1  rX  rY  r  r  s        r   test_split_exception_empty_sepz*TestUnicode.test_split_exception_empty_sep  s    !!!V UO 	D 	DD"":.. &S"              MM+S1A-B-BCCCC	D 	D   A$$A(	+A(	c                    t           }t          |          }dD ]m}|                     t                    5 } |d|d           d d d            n# 1 swxY w Y   |                     dt          |j                  d|z             nd S )NrD  NrM  r  rD  z"non-integer maxsplit with sep = %s)r   r   r  r   r  r  r  )r1  rX  rY  rW   r  s        r   (test_split_exception_noninteger_maxsplitz4TestUnicode.test_split_exception_noninteger_maxsplit  s    ,V  	F 	FC"";// %6c3$$$% % % % % % % % % % % % % % %MM)S)9%:%:>DF F F F	F 	Fs   AA	A	c           
          t           }t          |          }g d}|D ]7\  }}|                      |||           |||          d|d|d           8d S )N
) a Nr  r  r  r  r  r  r  r  r  r  z	'.split('')?)r   r   r]  )r1  rX  rY  r  test_strsplitters         r   
test_splitzTestUnicode.test_split  s    V
 
 
 #( 	I 	IHhVVHh77"U8X6664<HHhhhGI I I I	I 	Ir   c           
          g d}t           dft          dffD ]P\  }}t          |          }|D ]9\  }}}|                      ||||           ||||          ||||fz             :Qd S )N
)r  Nr  )r   r  r  )r  r  r  )r;  r  r  )r  r  r  )r  rM  rw  )r  r=  r  )r  r   rw  )r  r?  r  )r  rN  r  z'%s'.split('%s', %d)?z'%s'.split('%s', maxsplit=%d)?)r   r   r   r]  )r1  r  rX  fmt_strrY  r  r  r   s           r   test_split_with_maxsplitz$TestUnicode.test_split_with_maxsplit  s    
 
 
 "=!8!:!B!A!C D 		K 		KOFG
 LLE05 K K,(H  (H!E!E!&x8!D!D!(Hh+I!IK K K KK		K 		Kr   c                    t           }t          |          }d                    t          t          g d                    }ddddddd|z   d	z   g}|D ]/}|                      ||           ||          d
|d           0d S )Nr   	   rh     r<                           i  i    i   i   i   i   i   i   i   i   i	   i
   i(   i)   i/   i_   i 0  r     🐍 ⚡   🐍 ⚡ 🐍   🐍   ⚡ 🐍       🐍   ⚡ 🐍    🐍
   ⚡ 🐍  r  z
'.split()?)r   r   r   mapr*  r]  )r1  rX  rY  all_whitespacer  r  s         r   test_split_whitespacez!TestUnicode.test_split_whitespace  s     *V S +
 +
 +
 " "   n$|3
  	< 	<HVVH--"U8___08:< < < <	< 	<r   c                    t           }t          |          }t          j        t          t          j        t          f}dD ]\  }}|                     t                    5 } |d|           d d d            n# 1 swxY w Y   d	                    ||          }| 
                    |t          |j                             d S )N))noneN)rB  None
z"keepends" must be {}, not {})r   r   r   r  r  Booleanr5   r  r   r  r  r  r  )r1  rX  rY  r  tyr   r  r  s           r   %test_split_exception_invalid_keependsz1TestUnicode.test_split_exception_invalid_keepends0  s    1V-emTBF 	6 	6LB"";// &6dH%%%& & & & & & & & & & & & & & &188LLCMM#s6#3445555		6 	6s   A55A9	<A9	c                     t           }t          |          }g d}d}|D ]?}|                      ||           ||          |                    |                     @d S )Nr   r  z
abcabc
u   🐍⚡u   🐍⚡🐍u    aba babaz

abcz*Results of "{}".splitlines() must be equalr  )r   r   r]  r  r  s         r   test_splitlineszTestUnicode.test_splitlines;  s    #VM M M ; 	E 	EAVVAYYacjjmmDDDD	E 	Er   c           
      0   t           t          g}ddg}g d}g d}t          ||          D ]j\  }}t          |          }t	          ||          D ]E\  }}	|                      |||	           |||	          |                    ||	                     Fkd S )Nz,Results of "{}".splitlines({}) must be equalz5Results of "{}".splitlines(keepends={}) must be equalr  )TFr   r  rp  d   r  )r   r   r  r   r   r]  r  )
r1  r|  r  r  all_keependsrX  r  rY  r   r   s
             r   test_splitlines_with_keependsz)TestUnicode.test_splitlines_with_keependsF  s    ,2

 ;C
M M M333w11 	> 	>KFCLLE&ul;; > >8  8!4!4eeAx6H6H%(ZZ8%<%< ! > > > >>	> 	>r   c                 4   |                                   t          }t          |          }||fD ]h}|                     t                    5 } |dd           d d d            n# 1 swxY w Y   |                     dt          |j                             id S r  )r  r   r   r  r  r  r  r  r  s        r   test_rsplit_exception_empty_sepz+TestUnicode.test_rsplit_exception_empty_sepY  s    !!!V UO 	D 	DD"":.. &S"              MM+S1A-B-BCCCC	D 	Dr  c                 Z   t           }t          |          }t          j        t          f}dD ]~}|                     t                    5 } |d|d           d d d            n# 1 swxY w Y   d                    |          }|                     |t          |j
                             d S )Nr  rM  r  z "maxsplit" must be {}, not float)r   r   r   r  r  r  r   r  r  r  r  )r1  rX  rY  r  rW   r  r  s          r   )test_rsplit_exception_noninteger_maxsplitz5TestUnicode.test_rsplit_exception_noninteger_maxsplite  s    -V-- 	6 	6C"";// %6c3$$$% % % % % % % % % % % % % % %4;;NKKCMM#s6#3445555		6 	6s   A""A&	)A&	c           	          t           }t          |          }g d}d}|D ]E\  }}|                      |||           |||          |                    ||                     Fd S )Nr  z*Results of "{}".rsplit("{}") must be equalr  )r   r   r]  r  r  s          r   test_rsplitzTestUnicode.test_rsplitp  s    V
 
 
 ; 	5 	5FAsVVAs^^UU1c]]!$As!3!3  5 5 5 5	5 	5r   c                    t           t          g}g d}ddg}t          ||          D ]`\  }}t          |          }|D ]I\  }}}	|                      ||||	           ||||	          |                    |||	                     Jad S )Nr  z.Results of "{}".rsplit("{}", {}) must be equalz7Results of "{}".rsplit("{}", maxsplit={}) must be equalr  )r   r   r  r   r]  r  )
r1  r|  r  r  rX  r  rY  r  rW   r   s
             r   test_rsplit_with_maxsplitz%TestUnicode.test_rsplit_with_maxsplit  s    /57
 
 
 =E

 w11 	J 	JKFCLLE+0 J J'#x  #x!@!@!&xh!?!?%(ZZ#x%H%H ! J J J JJ	J 	Jr   c                 *   t           }t          |          }d                    t          t          g d                    }ddddddd|z   d	z   g}d
}|D ]>}|                      ||           ||          |                    |                     ?d S )Nr   r  r  r  r  r  r  r  r  z&Results of "{}".rsplit() must be equal)r   r   r   r  r*  r]  r  )r1  rX  rY  r  r  r  r   s          r   test_rsplit_whitespacez"TestUnicode.test_rsplit_whitespace  s    *V S +
 +
 +
 " "   n$|3
 7 	A 	AAVVAYYa#**Q--@@@@	A 	Ar   c                     t           }t          |          }ddg}|D ]/}|                      ||           ||          d|d           0d S )Nr      🐍🐍🐍r  z'.join([])?)r   r   r]  )r1  rX  rY  r  rW   s        r   test_join_emptyzTestUnicode.test_join_empty  s|     $V 

  	8 	8CVVC[["U3ZZZ1468 8 8 8	8 	8r   c                 2   t           }t          |          }|                     t                    5 } |dg d           d d d            n# 1 swxY w Y   t	          |j                  }|                     d|           |                     d|           d S )Nr   )r  rw  r  z,During: resolving callee type: BoundFunctionzreflected list(int)r   r   r  r   r  r  r  )r1  rX  rY  r  exc_messages        r   test_join_non_string_exceptionz*TestUnicode.test_join_non_string_exception  s    V {++ 	!vE"iii   	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	! 	!
 &*++:	
 	
 	

 	*K88888s   AAAc           
          t           }t          |          }dg dfdg dfdg dfddgdz  fg}|D ]7\  }}|                      |||           |||          d|d	|d
           8d S )Nr   )r   r   r   rM  )rM  bbbbr   r     ⚡⚡r  r  '.join('r  r   r   r]  r1  rX  rY  r  rW   partss         r   	test_joinzTestUnicode.test_join  s    V ,,,###$hZ!^,	
   	@ 	@JCVVC//"U3...3633>@ @ @ @	@ 	@r   c           
          t           }t          |          }ddg}|D ]7\  }}|                      |||           |||          d|d|d           8d S )N)rQ  123)r  r  r  r  r  r  r  s         r   test_join_interleave_strz$TestUnicode.test_join_interleave_str  s    V &

   	@ 	@JCVVC//"U3...3633>@ @ @ @	@ 	@r   c                    t           dft          dft          dffD ]\  }}t          |          }|                     t
                    5 } |t          d         d           d d d            n# 1 swxY w Y   |                     dt          |j	                             t          D ]F}t          dd          D ]3}|                      |||           |||          d	|||fz             4Gd S )
Nr   r   r   r   rI  The width must be an Integerr  ri  z'%s'.%s(%d)?)r   r   r  r   r  r   r\  r  r  r  r  r]  )r1  rX  	case_namerY  r  r   r  s          r   test_justificationzTestUnicode.test_justification  sj   #18"<#0'":#0'":"< 	M 	MFI LLE"";// 06&q)3///0 0 0 0 0 0 0 0 0 0 0 0 0 0 0MM8#f>N:O:OPPP% M M"2r]] M ME$$VVAu%5%5%*U1e__%3q)U6K%KM M M MMM	M 	Ms   	A--A1	4A1	c                    t           dft          dft          dffD ]\  }}t          |          }dD ]}|                     t
                    5 } |t          d         d|           d d d            n# 1 swxY w Y   |                     dt          |j	                             t          D ]I}t          dd	          D ]6}|                      ||||           ||||          d
||||fz             7Jƌd S )Nr   r   r   )rD  +   úu   处r   rI  r  r  ri  z'%s'.%s(%d, '%s')?)r   r   r  r   r  r   r\  r  r  r  r  r]  )r1  rX  r  rY  r   r  r   r  s           r   test_justification_fillcharz'TestUnicode.test_justification_fillchar  s   #:H"E#97"C#97"C"E 	L 	LFI LLE 4 L L&&{33 >vE*1-sH===> > > > > > > > > > > > > > ><!&"2335 5 5 * L LA!&r2 L L((5()C)C).q%)B)B)=IAFAIAK *KL L L LLLL	L 	Ls   A22A69A6c                 Z   |                                   t          t          t          fD ] }t	          |          }dD ]t}|                     t                    5 } |t          d         d|           d d d            n# 1 swxY w Y   |                     dt          |j
                             udD ]t}|                     t                    5 } |t          d         d|           d d d            n# 1 swxY w Y   |                     dt          |j
                             ud S )N)r   z+0u   quiénu   处着r   ri  z&The fill character must be exactly one)r  rI  z"The fillchar must be a UnicodeType)r  r   r   r  r   r  r  r\  r  r  r  r   )r1  rX  rY  r   r  s        r   %test_justification_fillchar_exceptionz1TestUnicode.test_justification_fillchar_exception!  s   !!!.--/ 	5 	5F LLE ; 5 5&&z22 =fE*1-r8<<<= = = = = = = = = = = = = = =F!&"2335 5 5 5 % 5 5&&{33 =vE*1-r8<<<= = = = = = = = = = = = = = =B!&"2335 5 5 55	5 	5s$   A>>BBC55C9<C9c                     t           }t          |          }t          D ]G}t          d d d         D ]4}|                      |||           |||          d|d|d           5Hd S r  )rH   r   r\  r]  rc  s         r   test_inplace_concatzTestUnicode.test_inplace_concat7  s    'V! 	: 	:A%ddd+ : :  1!&q!3411aaa!8: : : ::	: 	:r   c                     d }t          |          }g d}g d}d}t          dgz   |z   |z   D ]?}|                      ||           ||          |                    |                     @d S )Nc                 *    |                                  S r&   )isidentifierr   s    r   rX  z-TestUnicode.test_isidentifier.<locals>.pyfuncA  s    >>###r   )rM  Zr  b0bcb_   µu   𝔘𝔫𝔦𝔠𝔬𝔡𝔢rD  [   ©0   u   u   u   u   abu   abu	   abau	   abaz,Results of "{}".isidentifier() must be equalr   r  r   r\  r]  r  r1  rX  rY  cpythoncpython_extrasr  r   s          r   test_isidentifierzTestUnicode.test_isidentifier@  s    	$ 	$ 	$ VH H H@ @ @ =!RD(72^C 	E 	EAVVAYYacjjmmDDDD	E 	Er   c                 T   g d}t           dft          dft          dffD ]L\  }t                    }|D ]5\  }}|                      |           ||          d|d|d           6Mt
          dft          dft          dffD ]\  }t                    }t          j	        t          j	        t          j
        t          j	                            } t          |g                    }fd}||fD ]h}	|                     t                    5 }
 |	d	d
           d d d            n# 1 swxY w Y   |                     dt          |
j                             i||fD ]?}	|D ]:\  }}|                      ||           |	||          d|d|d|d           ;@!d S )N))ass ciiai)r+  N)assciiai )zasscii r.  )	 asscii  r.  )r/  zasci )r/  r   )z      rD  )r   rD  rC  )r   Nr  )
  asscii  r.  )r0  r   )r0  N)rK     étú? )     tú quién te crees?   r1  )u     tú qrees?   r   )r2  NrJ  )    大处大处  r   )z	
abcd	z	a)r3  N)z	 abcd 	N)z
 abcd 
N)z abcd N)z abcd N)z abcd N)u
    abcd N)u	   abcd Nr   r   r   r  z'.z()?c                      t          j        t           j        t          j        t           j                            } t	          |g                     d S r&   )r   rB  rC  rD  r   )rE  badrX  s     r   rG  z8TestUnicode.test_strip.<locals>.try_compile_bad_optional  sI    ();).)F)FH HcUF#####r   rH  rI  z%The arg must be a UnicodeType or Nonez('r  )r   r   r   r   r]  r   r   r   r   rB  rC  r  r   r  r  r  )r1  STRIP_CASESr  rY  stringr   sig1rL  rG  r  r  rX  s              @r   
test_stripzTestUnicode.test_stripQ  s   
 
 
D $1'":#18"<#18"<"> 	E 	EFI LLE!, E E  !&v17!CE E E EE
 $7"@#7"B#7"B"D 	A 	AFI LLE%e&8&+nU5G&H&HJ JD)T4&\\&11N$ $ $ $ $
 55 5 5&&{33 )vB{C((() ) ) ) ) ) ) ) ) ) ) ) ) ) )E!&"2335 5 5 5 ^+ A A%0 A AMFE$$VVFE%:%:%'R%6%6%69?9>&@A A A AAA)	A 	As   D..D25D2c                     d }t          |          }g d}g d}d}t          dgz   |z   |z   D ]?}|                      ||           ||          |                    |                     @d S )Nc                 *    |                                  S r&   )isspacer   s    r   rX  z(TestUnicode.test_isspace.<locals>.pyfunc      99;;r   )	u    u    u   —   𐐁   𐐧   𐐩   𐑎   🐍   👯r#  z'Results of "{}".isspace() must be equalr   r  r%  r&  s          r   test_isspacezTestUnicode.test_isspace  s    	 	 	 VK K K@ @ @ 8!RD(72^C 	E 	EAVVAYYacjjmmDDDD	E 	Er   c           
         t           }t          |          }d}d t          D             }g d}t          |z   |z   }|D ]D} ||          } ||          }	|                     ||	|                    |||	                     Ed S )Nz0'{0}'.py_istitle() = {1}
'{0}'.c_istitle() = {2}c                 6    g | ]}|                                 S r#   r  r   r(   s     r   r  z,TestUnicode.test_istitle.<locals>.<listcomp>  s     ===q===r   )r   z    z  AA  z  Ab  1A123A12Bcdz+abA12AbcA12abcu   %^Abc 5 $% Def𐐁𐐩u   𐐧𐑎r@  rA  u   🐍 Isu   🐍 NOTu   👯Is   ῼu   Greek ῼitlecases ...)r  r   r\  r]  r  )
r1  rX  rY  r+  unicode_titlespecialISTITLE_EXAMPLESr   r-  r.  s
             r   test_istitlezTestUnicode.test_istitle  s     VG	==,<===
 
 
, ,m;gE! 	G 	GAq		IuQxxHY&--aHEEG G G G	G 	Gr   c                     d }t          |          }g d}d}t          |z   D ]?}|                      ||           ||          |                    |                     @d S )Nc                 *    |                                  S r&   )isprintabler   s    r   rX  z,TestUnicode.test_isprintable.<locals>.pyfunc  s    ==??"r   )	r   rD  abcdefgzabcdefg
u   ʹu   ͸r$  rC  u   󠀠z+Results of "{}".isprintable() must be equalr  r%  r1  rX  rY  r'  r  r   s         r   test_isprintablezTestUnicode.test_isprintable  s    	# 	# 	# V9 9 9 <!G+ 	E 	EAVVAYYacjjmmDDDD	E 	Er   c                 h    d }t          |          }dg}|                      ||  ||            d S )Nc                     | d d          S r&   r#   rM  s    r   rX  z0TestUnicode.test_pointless_slice.<locals>.pyfunc  s    QQQ4Kr   rM  r  r1  r_  rX  rY  rE  s        r   test_pointless_slicez TestUnicode.test_pointless_slice  sK    	 	 	Vut55555r   c                 h    d }t          |          }dg}|                      ||  ||            d S )Nc                     | d d d         S )Nrp  r#   rZ  s    r   rX  z/TestUnicode.test_walk_backwards.<locals>.pyfunc  s    TTrT7Nr   rM  r  r[  s        r   test_walk_backwardszTestUnicode.test_walk_backwards  sK    	 	 	Vut55555r   c                 h    d }t          |          }dg}|                      ||  ||            d S )Nc                     | d d d         S Nrw  r#   rZ  s    r   rX  z-TestUnicode.test_stride_slice.<locals>.pyfunc  s    SSqS6Mr   rM  r  r[  s        r   test_stride_slicezTestUnicode.test_stride_slice  sK    	 	 	Vut55555r   c                 j    d }t          |          }ddg}|                      ||  ||            d S )Nc                     | |k     S r&   r#   rM  r=  s     r   rX  z)TestUnicode.test_basic_lt.<locals>.pyfunc      q5Lr   r?  r=  r  r[  s        r   test_basic_ltzTestUnicode.test_basic_lt  M    	 	 	Vc{t55555r   c                 j    d }t          |          }ddg}|                      ||  ||            d S )Nc                     | |k    S r&   r#   rf  s     r   rX  z)TestUnicode.test_basic_gt.<locals>.pyfunc  rg  r   r?  r=  r  r[  s        r   test_basic_gtzTestUnicode.test_basic_gt  ri  r   c           	          d }t          |          }t          t          d          D ]@\  }}dD ]8}|||g}|                      ||  || d                    |                     9Ad S )Nc                     | dk    r||k    S | dk    r||k    S | dk    r||k     S | dk    r||k    S | dk    r||k    S | dk    r||k    S d S )N==!=<><=>=r#   optionr(   r,   s      r   rX  z+TestUnicode.test_comparison.<locals>.pyfunc  ss    ~~Av4Av31u31u4Av4Avtr   rw  rx  ro  rp  rq  rr  rs  rt  r   failed on {}r  )r   r   rz  r]  r  )r1  rX  rY  r(   r,   cmpoprE  s          r   test_comparisonzTestUnicode.test_comparison   s    	 	 	  V !:a@@@ 	B 	BDAq? B Bq!}  t%3%:%:4%@%@ ! B B B BB	B 	Br   c                     d }t          |          }dg}|                      ||  ||            dg}|                      ||  ||            d S )Nc                 P    d}t          |           r|dz   | z   dz   S | |z   dz   | z   S )NrQ  b123IOr
  r0   )r(   rQ  s     r   rX  z/TestUnicode.test_literal_concat.<locals>.pyfunc  s<    C1vv +V|a'$..3w**r   r(   r   r  r1  rX  rY  rE  s       r   test_literal_concatzTestUnicode.test_literal_concat  sv    	+ 	+ 	+ Vut555tt55555r   c                     d }t          |          }dD ]6}|g}|                      ||  || d                    |                     7d S )Nc                     d}d}| dk    r||k    S | dk    r||k    S | dk    r||k     S | dk    r||k    S | dk    r||k    S | dk    r||k    S d S )	Na123aa12ro  rp  rq  rr  rs  rt  r#   ru  s      r   rX  z3TestUnicode.test_literal_comparison.<locals>.pyfunc(  s}    AA~~Av4Av31u31u4Av4Avtr   rw  rx  r  r   r]  r  )r1  rX  rY  ry  rE  s        r   test_literal_comparisonz#TestUnicode.test_literal_comparison'  s    	 	 	$ V; 	> 	>E7DVVT]EE4L!/!6!6t!<!<  > > > >	> 	>r   c                 v    d }t          |          }|                      |             |                       d S )Nc                       t          d          S NrQ  r0   r#   r   r   rX  z,TestUnicode.test_literal_len.<locals>.pyfuncA  s    u::r   r  rW  s      r   test_literal_lenzTestUnicode.test_literal_len@  sD    	 	 	V5577+++++r   c                     d }t          |          }dddt          dd           t          d d          fD ]6}|g}|                      ||  || d                    |                     7d S )Nc                     d|          S r  r#   )whichs    r   rX  z0TestUnicode.test_literal_getitem.<locals>.pyfuncG  s    <r   rp  r   r  rx  r  )r   r  r]  r  r1  rX  rY  rM  rE  s        r   test_literal_getitemz TestUnicode.test_literal_getitemF  s    	  	  	 VaE!TNNE$OO< 	> 	>A3DVVT]EE4L!/!6!6t!<!<  > > > >	> 	>r   c                     d }t          |          }dD ]6}|g}|                      ||  || d                    |                     7d S )Nc                 
    | dv S )N
9876zabiuhr#   r'   s    r   rX  z+TestUnicode.test_literal_in.<locals>.pyfuncP  s    $$r   )rM  9rH  r   8uha987rx  r  r  r  s        r   test_literal_inzTestUnicode.test_literal_inO  s    	% 	% 	% V3 	> 	>A3DVVT]EE4L!/!6!6t!<!<  > > > >	> 	>r   c                     d }t          |          }t          dd          D ]3}|                      ||  || d                    |                     4d S )Nc                 V    d                     |           d                    |          fS )NrQ  cde)r   r   r+   s     r   rX  z0TestUnicode.test_literal_xyzwith.<locals>.pyfuncZ  s'    ##A&&q(9(999r   rU  rw  rx  rx  r  )r   r   r]  r  r  s       r   test_literal_xyzwithz TestUnicode.test_literal_xyzwithY  s    	: 	: 	: V a000 	> 	>DVVT]EE4L!/!6!6t!<!<  > > > >	> 	>r   c                     d }t          |          }dD ]6}|g}|                      ||  || d                    |                     7d S )Nc                 V    d                     |           |                      d          fS )NrQ  rM  rZ   r'   s    r   rX  z-TestUnicode.test_literal_find.<locals>.pyfuncc  s!    ::a==!&&++--r   )r?  rx  r  r  r  s        r   test_literal_findzTestUnicode.test_literal_findb  s    	. 	. 	. V 	> 	>A3DVVT]EE4L!/!6!6t!<!<  > > > >	> 	>r   c                     d }t          |          }t          D ]6}|g}|                      ||  || d                    |                     7d S )Nc                     |  S r&   r#   r'   s    r   rX  z$TestUnicode.test_not.<locals>.pyfuncm  s	    5Lr   rx  r  r%  r  s        r   test_notzTestUnicode.test_notl  s    	 	 	 V! 	> 	>A3DVVT]EE4L!/!6!6t!<!<  > > > >	> 	>r   c                     d }t          |          }g d}dg}d}t          dgz   |z   |z   D ]?}|                      ||           ||          |                    |                     @d S )Nc                 *    |                                  S r&   )
capitalizer'   s    r   rX  z+TestUnicode.test_capitalize.<locals>.pyfuncw  s    <<>>!r   )	   𐑏   𐑏𐑏   𐐧𐑏   𐑏𐐧
   X𐐧x𐑏u   hİu   ῒİu   ﬁnnish   AͅΣ   𐀀􀀀z*Results of "{}".capitalize() must be equalr   r  r%  r&  s          r   test_capitalizezTestUnicode.test_capitalizev  s    	" 	" 	" V@ @ @ 11:!RD(72^C 	E 	EAVVAYYacjjmmDDDD	E 	Er   c                    d }t          |          }d t          D             }g d}g d}d |D             }t          |z   |z   |z   |z   D ]6}|g}|                      ||  || d                    |                     7d S )Nc                 *    |                                  S r&   )isupperr'   s    r   rX  z(TestUnicode.test_isupper.<locals>.pyfunc  r=  r   c                 6    g | ]}|                                 S r#   upperrG  s     r   r  z,TestUnicode.test_isupper.<locals>.<listcomp>       666!''))666r   AA12Aaa12au   大AA12Au   大aa12au   AAAǄAu	   A 1 1 大u   Ⅷ   ⅷr>  r?  r@  rA  rB  rC  c                     g | ]}|d z  S r{  r#   rG  s     r   r  z,TestUnicode.test_isupper.<locals>.<listcomp>      +++aAE+++r   rx  r  r%  )	r1  rX  rY  uppersr  r'  fourxcpyrM  rE  s	            r   test_isupperzTestUnicode.test_isupper  s    	 	 	 V66%5666RRR= = =++7+++!F*V3g=H 	> 	>A3DVVT]EE4L!/!6!6t!<!<  > > > >	> 	>r   c                     d }t          |          }t          D ]6}|g}|                      ||  || d                    |                     7d S )Nc                 *    |                                  S r&   r  r'   s    r   rX  z&TestUnicode.test_upper.<locals>.pyfunc  s    7799r   rx  r  r%  r  s        r   
test_upperzTestUnicode.test_upper  s    	 	 	 V! 	> 	>A3DVVT]EE4L!/!6!6t!<!<  > > > >	> 	>r   c                     d }t          |          }g d}dg}d}t          dgz   |z   |z   D ]?}|                      ||           ||          |                    |                     @d S )Nc                 *    |                                  S r&   )casefoldr'   s    r   rX  z)TestUnicode.test_casefold.<locals>.pyfunc      ::<<r   )r  hELlo   ß   ﬁ   Σr  r  r  z(Results of "{}".casefold() must be equalr   r  r%  r&  s          r   test_casefoldzTestUnicode.test_casefold  s    	  	  	  V. . . 118!RD(72^C 	E 	EAVVAYYacjjmmDDDD	E 	Er   c                     d }t          |          }g d}g d}d}t          dgz   |z   |z   D ]?}|                      ||           ||          |                    |                     @d S )Nc                 *    |                                  S r&   )isalphar'   s    r   rX  z(TestUnicode.test_isalpha.<locals>.pyfunc  r=  r   )rM  r>  r?  r@  rA  rB  rC  r#  z'Results of "{}".isalpha() must be equalr   r  r%  r1  rX  rY  r'  r  r  r   s          r   test_isalphazTestUnicode.test_isalpha  s    	 	 	 V= = =8 8 8 8!RD(61G; 	E 	EAVVAYYacjjmmDDDD	E 	Er   c                     d }t          |          }g d}d}t          |z   D ]?}|                      ||           ||          |                    |                     @d S )Nc                 *    |                                  S r&   )r   r'   s    r   rX  z(TestUnicode.test_isascii.<locals>.pyfunc  r=  r   )r    z       érD  z'Results of "{}".isascii() must be equalr  r%  rV  s         r   test_isasciizTestUnicode.test_isascii  s    	 	 	 V HGG7!G+ 	E 	EAVVAYYacjjmmDDDD	E 	Er   c                     t           }t          |          }g d}d}t          dgz   |z   D ]?}|                      ||           ||          |                    |                     @d S )N)	r  r  u   𐑏𐑏 𐑏𐑏u   𐐧𐑏 𐐧𐑏u   𐑏𐐧 𐑏𐐧u   X𐐧x𐑏 X𐐧x𐑏u   ﬁNNISHu	   AΣ ᾡxyu   AΣAz%Results of "{}".title() must be equalr   r  )r  r   r\  r]  r  rV  s         r   
test_titlezTestUnicode.test_title  s    V? ? ? 6!RD(72 	E 	EAVVAYYacjjmmDDDD	E 	Er   c                     d }t          |          }g d}dg}d}t          dgz   |z   |z   D ]?}|                      ||           ||          |                    |                     @d S )Nc                 *    |                                  S r&   )swapcaser'   s    r   rX  z)TestUnicode.test_swapcase.<locals>.pyfunc  r  r   )r  r?  r  r  r  r  r     İr     ͅΣr     AͅΣar  u   AΣͅ   Σͅ r  r  u   ῒr  z(Results of "{}".swapcase() must be equalr   r  r%  r&  s          r   test_swapcasezTestUnicode.test_swapcase  s    	  	  	  V- - - 118!RD(72^C 	E 	EAVVAYYacjjmmDDDD	E 	Er   c                 .   t           }t          |          }d t          D             }g d}g d}|d |D             z  }d}t          |z   dgz   |z   |z   D ]?}|                      ||           ||          |                    |                     @d S )Nc                 6    g | ]}|                                 S r#   r$  rG  s     r   r  z,TestUnicode.test_islower.<locals>.<listcomp>  r  r   r  r  c                     g | ]}|d z  S r  r#   rG  s     r   r  z,TestUnicode.test_islower.<locals>.<listcomp>  r  r   z'Results of "{}".islower() must be equalr   r  )r"  r   r\  r]  r  )r1  rX  rY  lowersr  r'  r  r   s           r   test_islowerzTestUnicode.test_islower  s     V66%5666RRRK K K++7++++7!F*bT1F:WD 	E 	EAVVAYYacjjmmDDDD	E 	Er   c                     d }t          |          }g d}g d}d}t          dgz   |z   |z   D ]?}|                      ||           ||          |                    |                     @d S )Nc                 *    |                                  S r&   )isalnumr'   s    r   rX  z(TestUnicode.test_isalnum.<locals>.pyfunc	  r=  r   )r>  r?  r@  rA     𝟶   𑁦   𐒠   🄇r#  z'Results of "{}".isalnum() must be equalr   r  r%  r  s          r   test_isalnumzTestUnicode.test_isalnum	  s    	 	 	 VK K K8 8 8 8!RD(61G; 	E 	EAVVAYYacjjmmDDDD	E 	Er   c                 $   t           }t          |          }g d}g d}g d}d}|                    |           d}t          dgz   |z   |z   |z   D ]?}|                      ||           ||          |                    |                     @d S )Nr  )r>  r?  rA  rC  u   𐐧𐐧r  r  r  )r  r  r  r  r  u   򏿾r  u   AΣ΢z%Results of "{}".lower() must be equalr   r  )r&  r   r
  r\  r]  r  )	r1  rX  rY  r  r'  sigmaextra_sigmar  r   s	            r   
test_lowerzTestUnicode.test_lower	  s    VRRR7 7 7: : : &[!!!5!RD(61G;eC 	E 	EAVVAYYacjjmmDDDD	E 	Er   c                     d }t          |          }g d}g d}d}t          dgz   |z   |z   D ]?}|                      ||           ||          |                    |                     @d S )Nc                 *    |                                  S r&   )	isnumericr'   s    r   rX  z*TestUnicode.test_isnumeric.<locals>.pyfunc/	      ;;== r   )r   rM  r"     ①   ¼   ٠
01234567890123456789ar>  r?  r@  rA  rB  rC     𑁥r  r  r  r  r#  z)Results of "{}".isnumeric() must be equalr   r  r%  r&  s          r   test_isnumericzTestUnicode.test_isnumeric.	      	! 	! 	! VK K K
- - - :!RD(72^C 	E 	EAVVAYYacjjmmDDDD	E 	Er   c                     d }t          |          }g d}g d}d}t          dgz   |z   |z   D ]?}|                      ||           ||          |                    |                     @d S )Nc                 *    |                                  S r&   )isdigitr'   s    r   rX  z(TestUnicode.test_isdigit.<locals>.pyfuncB	  r=  r   )r  r  r  r>  r?  r@  rA  rB  rC  r  r  r  r  r  r#  z'Results of "{}".isdigit() must be equalr   r  r%  r&  s          r   test_isdigitzTestUnicode.test_isdigitA	  s    	 	 	 V! ! !
@ @ @ 8!RD(72^C 	E 	EAVVAYYacjjmmDDDD	E 	Er   c                     d }t          |          }g d}g d}d}t          dgz   |z   |z   D ]?}|                      ||           ||          |                    |                     @d S )Nc                 *    |                                  S r&   )	isdecimalr'   s    r   rX  z*TestUnicode.test_isdecimal.<locals>.pyfuncU	  r  r   )r   rM  r"  r  r  r  r  r  r>  r?  r@  rA  rB  rC  r  r  r  r  r  r#  z)Results of "{}".isdecimal() must be equalr   r  r%  r&  s          r   test_isdecimalzTestUnicode.test_isdecimalT	  r  r   c                     t           }t          |          }g d}|D ]=\  }}}|                      ||||           ||||          d|d|d|d           >d S )N
)rQ  r   A)r   r  r  )r  r  r  )r;  r  r  )r  r  r  )r  rM  r  )r  r=  r  )r  r   r  )r  r?  r  )r  rN  r  r  '.replace('', 'r  )r~   r   r]  )r1  rX  rY  r  r  old_strnew_strs          r   test_replacezTestUnicode.test_replaceg	  s     V
 
 
 +0 	; 	;&HgwVVHgw??"U8Wg>>>&hh:; ; ; ;	; 	;r   c                     t           }t          |          }g d}g d}|D ]G\  }}}|D ]>}|                      |||||           |||||          d|d|d|d|d	           ?Hd S )Nr  )rp  r  r   r  r  r  r	  r  )r   r   r]  )	r1  rX  rY  r  
count_testr  r
  r  rk   s	            r   test_replace_with_countz#TestUnicode.test_replace_with_count~	  s    +V
 
 
 #]]
*/ 	F 	F&Hgw# F F  '7E!J!J!&x'5!I!I!I"*((GGGWWWeee"EF F F FF	F 	Fr   c                    d }t          |          }|                     t                    5 } |dddd           d d d            n# 1 swxY w Y   d}|                     |t	          |j                             |                     t                    5 } |dddd           d d d            n# 1 swxY w Y   d	}|                     |t	          |j                             |                     t                    5 } |dddd           d d d            n# 1 swxY w Y   d	}|                     |t	          |j                             d S )
Nc                 0    |                      |||          S r&   r|   r   s       r   rX  z4TestUnicode.test_replace_unsupported.<locals>.pyfunc	  s    99Q5)))r   
abababababbaqqqg      @z7Unsupported parameters. The parameters must be Integer.r   r  z!The object must be a UnicodeType.)r   r  r   r  r  r  )r1  rX  rY  r  r  s        r   test_replace_unsupportedz$TestUnicode.test_replace_unsupported	  s   	* 	* 	* V{++ 	2vE,eS111	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2 	2Gc3v/00111{++ 	-vE,5!,,,	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	- 	-1c3v/00111{++ 	,vE,a+++	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	,1c3v/0011111s5   AAAB22B69B6DD #D N)~r3  r4  r5  rZ  r	   r`  rd  rt  r|  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r$  r&  r(  r/  r4  r8  r>  rM  r[  r]  r_  rb  rd  rm  rt  rw  r~  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r  r  r)  r9  rD  rQ  rW  r\  r_  rc  rh  rl  rz  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r  r  r  r  r#   r   r   rT  rT    s       3 3 3
 &4 2 2 2 2 + A A A A? ? ?,  4 + , , , , + , , , , + , , , , + , , , , , 2 2 2 2 - 2 2 2 2	E 	E 	EA A A2 2 2F F F> > >"G G G$3 3 3&3 3 3"G G G&= = =&H H H*Q Q Q.@ @ @*E E E2 + @ @ @ @2 2 2$5 5 5( - = = = =8
H 
H 
HM M M	6 	6 	62 2 2$5 5 5(	L 	L 	L9 9 9(9 9 96- - -$5 5 5:= = =:
H 
H 
HM M M: : :> > >(2 2 28= = =0= = =0L L L8Q Q Q:F F F:	: 	: 	:7 7 77 7 7N N N
A 
A 
A
A 
A 
AA A AK K KK K K*K K K
' 
' 
'2 2 2> !/ : : : : !/ . . . .- - -
D 
D 
D	F 	F 	FI I I,K K K2< < <:	6 	6 	6	E 	E 	E> > >&
D 
D 
D	6 	6 	65 5 5*J J J6A A A48 8 8 9 9 9&@ @ @ @ @ @M M M L L L*5 5 5, )7 : : : :E E E"HA HA HATE E E""G "G "GHE E E *8 6 6 6 6 )7 6 6 6 6 '5 6 6 6 6 #1 6 6 6 6 #1 6 6 6 6B B B26 6 6> > >2, , ,> > >> > >> > >> > >> > >E E E"> > >&> > >E E EE E E$E E EE E E E E E&E E E E E E$E E E.E E E&E E E&E E E&; ; ;.F F F42 2 2 2 2r   rT  c                   2    e Zd Zd Zd Zd Zd Zd Zd ZdS )TestUnicodeInTuplec                    t           d             }|                     |                                 |                       t           d             }|                     |                                 |                       d S )Nc                      ddk     S )N)rR  bbr#   r#   r   r   r  z9TestUnicodeInTuple.test_const_unicode_in_tuple.<locals>.f	      W$$r   c                      ddk     S )N)ccr  r#   r#   r   r   r  z9TestUnicodeInTuple.test_const_unicode_in_tuple.<locals>.f	  r  r   r   r]  rq  r1  r  s     r   test_const_unicode_in_tuplez.TestUnicodeInTuple.test_const_unicode_in_tuple	  s    		% 	% 
	% 	aacc***		% 	% 
	% 	aacc*****r   c                    t           d             }|                     |                                 |                       t           d             }|                     |                                 |                       d S )Nc                      ddk     S )NrR  r  )r  r  r#   r#   r   r   r  z@TestUnicodeInTuple.test_const_unicode_in_hetero_tuple.<locals>.f	      y((r   c                      ddk     S )Nr$  )rR  rw  r#   r#   r   r   r  z@TestUnicodeInTuple.test_const_unicode_in_hetero_tuple.<locals>.f	  r%  r   r  r   s     r   "test_const_unicode_in_hetero_tuplez5TestUnicodeInTuple.test_const_unicode_in_hetero_tuple	  s    		) 	) 
	) 	aacc***		) 	) 
	) 	aacc*****r   c                     t           d             }t          D ].}|                      ||          t          |                     /d S )Nc                     | j         S r&   r  r   s    r   r  z3TestUnicodeInTuple.test_ascii_flag_unbox.<locals>.f	  s
    ;r   )r   r\  r]  r   r  s      r   test_ascii_flag_unboxz(TestUnicodeInTuple.test_ascii_flag_unbox	  s]    		 	 
	 " 	/ 	/AQQqTT71::....	/ 	/r   c                 b    t           d             }|                      |            d           d S )Nc                      d} d}d}d}d                     | |g          j        d                     | |g          j        d                     | |g          j        d                     ||g          j        fS )NrQ  r
  r;  r"   ,)r   r  s1s2s3s4s       r   r  z2TestUnicodeInTuple.test_ascii_flag_join.<locals>.f	  sx    BBB1BHHb"X&&0NNB8,,6HHb"X&&0HHb"X&&02 2r   )r  r   r   r   r  r   s     r   test_ascii_flag_joinz'TestUnicodeInTuple.test_ascii_flag_join	  s?    		2 	2 
	2 	l+++++r   c                 b    t           d             }|                      |            d           d S )Nc                  v    d} d}| d         j         | dd          j         |d         j         |dd          j         fS )Nabc123u   🐍⚡🐍⚡🐍⚡r   rw  r  )r/  r0  s     r   r  z5TestUnicodeInTuple.test_ascii_flag_getitem.<locals>.f	  sB    B(BqEORV%5r!uqrrF$& &r   )r  r  r   r   r  r   s     r   test_ascii_flag_getitemz*TestUnicodeInTuple.test_ascii_flag_getitem	  s?    		& 	& 
	& 	l+++++r   c                 b    t           d             }|                      |            d           d S )Nc                  p    d} d}d}d}| |z   j         | |z   j         ||z   j         | dz  j         |dz  j         fS )NrQ  r
  r;  r"   rw  r  r.  s       r   r  z5TestUnicodeInTuple.test_ascii_flag_add_mul.<locals>.f	  sR    BBB1B"W'"W'"W'!V&!V&	( (r   )r  r   r   r  r   r  r   s     r   test_ascii_flag_add_mulz*TestUnicodeInTuple.test_ascii_flag_add_mul	  s?    			( 		( 
		( 	o.....r   N)	r3  r4  r5  r!  r'  r*  r3  r7  r:  r#   r   r   r  r  	  sn        + + ++ + +/ / /, , ,, , ,/ / / / /r   r  c                   ,    e Zd Zd Zd Zd Zd Zd ZdS )TestUnicodeIterationc                     t           }t          |          }t          D ]*}|                      ||           ||                     +d S r&   )r  r   r\  rV  r1  rX  rY  rM  s       r   test_unicode_iterz&TestUnicodeIteration.test_unicode_iter	  sT    V! 	9 	9A##FF1IIuuQxx8888	9 	9r   c                 ~    t           }t          |          }|                      |             |                       d S r&   )r  r   rV  rW  s      r   test_unicode_literal_iterz.TestUnicodeIteration.test_unicode_literal_iter
  s:    %V%%''22222r   c                     t           }t          |          }t          D ]*}|                      ||           ||                     +d S r&   )r  r   r\  rV  r>  s       r   test_unicode_enumerate_iterz0TestUnicodeIteration.test_unicode_enumerate_iter
  sT    (V! 	9 	9A##FF1IIuuQxx8888	9 	9r   c                     |                                   t          }t          |          }||fD ]I}t          D ]?}|                     t
                    5   ||           d d d            n# 1 swxY w Y   @Jd S r&   )r  r  r   r\  r  StopIteration)r1  rX  rY  r  rM  s        r   test_unicode_stopiteration_iterz4TestUnicodeIteration.test_unicode_stopiteration_iter
  s    !!!+V% 	 	A%  &&}55  AaDDD              	 	s   A,,A03A0c                     t           }t          |          }||fD ]>}|                     t                    5   |             d d d            n# 1 swxY w Y   ?d S r&   )r  r   r  rE  )r1  rX  rY  r  s       r   'test_unicode_literal_stopiteration_iterz<TestUnicodeIteration.test_unicode_literal_stopiteration_iter
  s    3V% 	 	A""=11                	 	s   AA	A	N)r3  r4  r5  r?  rA  rC  rF  rH  r#   r   r   r<  r<  	  s_        9 9 93 3 3
9 9 9      r   r<  c                   2    e Zd Zd Zd Zd Zd Zd Zd ZdS )TestUnicodeAuxillaryc                     t           }t          |          }t          D ]/}|D ]*}|                      ||           ||                     +0d S r&   )r(  r   r\  rV  )r1  rX  rY  exrM  s        r   test_ordzTestUnicodeAuxillary.test_ord!
  sh    V" 	= 	=B = =''q		5588<<<<=	= 	=r   c                    |                                   t          }t          |          }||fD ]l}dD ]g}|                     t                    5 } ||           d d d            n# 1 swxY w Y   |                     dt          |j                             hm|                     t                    5 } |d           d d d            n# 1 swxY w Y   |                     t          t          |j                             d S )N)r   rQ  zord() expected a charactergGz?)
r  r(  r   r  	TypeErrorr  r  r  r   r   )r1  rX  rY  r  chr  s         r   test_ord_invalidz%TestUnicodeAuxillary.test_ord_invalid(
  s   !!!V UO 	5 	5D! 5 5&&y11 VDHHH              :!&"2335 5 5 55 {++ 	vE$KKK	 	 	 	 	 	 	 	 	 	 	 	 	 	 	lC(8$9$9:::::s$   A''A+.A+6CCCc                 &   t           }t          |          }t          D ]>}|D ]9}t          |          }|                      ||           ||                     :?dt
          fD ]*}|                      ||           ||                     +d S )Nr   )r+  r   r\  r   rV  r   )r1  rX  rY  rL  r(   rM  s         r   test_chrzTestUnicodeAuxillary.test_chr;
  s    V" 	= 	=B = =FF''q		5588<<<<= |$ 	9 	9A##FF1IIuuQxx8888	9 	9r   c                    t           }t          |          }||fD ]v}dt          dz   fD ]g}|                     t                    5 } ||           d d d            n# 1 swxY w Y   |                     dt          |j                             hw|                     t                    5 } |d           d d d            n# 1 swxY w Y   |                     t          t          |j                             d S )Nr  r  zchr() arg not in rangerQ  )
r+  r   r   r  r  r  r  r  r   r   )r1  rX  rY  r  vr  s         r   test_chr_invalidz%TestUnicodeAuxillary.test_chr_invalidF
  sz   V UO 	O 	OD,*+ O O&&z22 fDGGG              6F<L8M8MNNNNO {++ 	vE%LLL	 	 	 	 	 	 	 	 	 	 	 	 	 	 	lC(8$9$9:::::s$   AA!$A!,CCCc                 2   d t                    d             }t          fd            }d}|                     |                    |           ||                     |                     t
          j        t
          j        j        j	                   d S )Nc                     dS )NTr#   r'   s    r   barz7TestUnicodeAuxillary.test_unicode_type_mro.<locals>.barX
  s    4r   c                 ~    dt          | t          j                  rt          | t          j                  rdfdS )NFTc                     S r&   r#   r(   oks    r   <lambda>zLTestUnicodeAuxillary.test_unicode_type_mro.<locals>.ol_bar.<locals>.<lambda>a
  s    R r   )
isinstancer   r  Hashabler\  s    @r   ol_barz:TestUnicodeAuxillary.test_unicode_type_mro.<locals>.ol_bar[
  sB    B!U.// a00 B<<<r   c                      |           S r&   r#   )strinstrY  s    r   rn  z7TestUnicodeAuxillary.test_unicode_type_mro.<locals>.fooc
  s    3w<<r   rQ  )
r   r   r]  rq  r  r   r`  rB  r2  __mro__)r1  ra  rn  instrY  s       @r   test_unicode_type_mroz*TestUnicodeAuxillary.test_unicode_type_mroV
  s    	 	 	 
#	  	  
	  
	  	  	  	  
	  T**CCII666ene&8&B&JKKKKKr   c                    d }d }d }d }d }|                       |d           t          |          d                     |                       |d           t          |          d                     |                       |d           t          |          d                     d	d
g} t          |          |          }dt          |           d}|                      ||           t          t          f}	|                     |	          5 }
 t          |          d	d
g           ddd           n# 1 swxY w Y   t          dv r+d}|                     |t          |
j	                             nHt          dv r+d}|                     |t          |
j	                             nt          t                    |                       |             t          |                                 dS )z@test f-string support, which requires bytecode handling
        c                     d| dz    dS )NAA_r  _Br#   rZ  s    r   impl1z2TestUnicodeAuxillary.test_f_strings.<locals>.impl1o
  s    "Q???"r   c                     | dz    S rb  r#   rZ  s    r   impl2z2TestUnicodeAuxillary.test_f_strings.<locals>.impl2s
  s    !e:r   c                     d|  S )NABC_r#   rZ  s    r   impl3z2TestUnicodeAuxillary.test_f_strings.<locals>.impl3w
  s    !::r   c                     d| dS )Nro  r"  r#   rZ  s    r   impl4z2TestUnicodeAuxillary.test_f_strings.<locals>.impl4{
  s    !<<<r   c                       S r&   r#   r#   r   r   impl5z2TestUnicodeAuxillary.test_f_strings.<locals>.impl5
  s    Jr   r  rw  DEr  BzABC_<object type:rr  N))r  r  z,Use of unsupported opcode (FORMAT_WITH_SPEC)))r  rh  )r  r  )r  r<  z*format spec in f-strings not supported yet)r]  r   r   r   r   r  r   r  r  r  NotImplementedError)r1  rk  rm  rp  rr  rt  list_arggotexpectedunsupported_errorsr  r  s               r   test_f_stringsz#TestUnicodeAuxillary.test_f_stringsk
  sS   	# 	# 	#	 	 		 	 		  	  	 	 	 	 	q;4;;q>>222q;4;;q>>222tkd5kk$&7&7888 :d5kk(##:vh'7'7:::h''' /0HI122 	$fDKKc
###	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$ 	$
""@CMM#s6#3445555555>CMM#s6#3445555%i000+$u++--00000s   D>>EEN)	r3  r4  r5  rM  rQ  rS  rV  rf  r|  r#   r   r   rJ  rJ  
  sq        = = =; ; ;&	9 	9 	9; ; ; L L L*.1 .1 .1 .1 .1r   rJ  __main__)t	itertoolsr   r   numbar   r   
numba.corer   unittestnumba.tests.supportr   r	   r
   numba.core.errorsr   r   r   numba.cpython.unicoder   numba.core.types.functionsr   numba.extendingr   numba.core.utilsr   r   r$   r)   r-   r2   r6   r:   r=   r@   rC   rF   rH   rJ   rL   rO   rQ   rS   rX   r\   ra   re   rh   rl   rn   rq   rv   rx   rz   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r  r  r  r  r  r  r  r"  r&  r(  r+  r-  r\  rz  r*  rT  r  r<  rJ  r3  mainr#   r   r   <module>r     s          " " " " " "                K K K K K K K K K K9 9 9 9 9 9 9 9 9 9 . . . . . . 3 3 3 3 3 3 $ $ $ $ $ $ & & & & & &( ( (, , ,                    
                ! ! !      " " "    " " "  " " "    # # #    " " "      ! ! !) ) )" " "' ' '     % % %       ) ) )    " " "+ + +  # # #, , ,                    ! ! !                                    & & & & & & & &
      "! ! ! H|2 |2 |2 |2 |2( |2 |2 |2~?J/ J/ J/ J/ J/ J/ J/ J/Z! ! ! ! !8 ! ! !Hz1 z1 z1 z1 z18 z1 z1 z1z zHMOOOOO r   