o
    1&i                    @   s  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d Zdd Zdd Zdd Zdd Zdd Zdd Zdd Z dd Z!dd Z"d d! Z#d"d# Z$d$d% Z%d&d' Z&d(d) Z'd*d+ Z(d,d- Z)d.d/ Z*d0d1 Z+d2d3 Z,d4d5 Z-d6d7 Z.d8d9 Z/d:d; Z0d<d= Z1d>d? Z2d@dA Z3dBdC Z4dDdE Z5dFdG Z6dHdI Z7dJdK Z8dLdM Z9dNdO Z:dPdQ Z;dRdS Z<dTdU Z=dVdW Z>dXdY Z?dZd[ Z@d\d] ZAd^d_ ZBd`da ZCdbdc ZDddde ZEdfdg ZFdhdi ZGdjdk ZHdldm ZIdndo ZJdpdq ZKdrds ZLdtdu ZMdvdw ZNdxdy ZOdzd{ ZPd|d} ZQd~d ZRdd ZSdd ZTdd ZUdd ZVdd ZWdd ZXdd ZYdd ZZdd Z[dd Z\dd Z]dd Z^dd Z_dd Z`dd Zadd Zbdd Zcdd Zddd Zedd Zfdd Zgdd Zhdd ZiG dd dee
Zjg dZkg dZlg dZmG dd dejZnG dd dejZoG dd dejZpG dd dejZqerdkres  dS dS )    )product)permutations)njittypeof)typesN)TestCaseno_pyobj_flagsMemoryLeakMixin)TypingErrorUnsupportedErrorUnsupportedBytecodeError)_MAX_UNICODE)_header_lead)overload)	PYVERSIONc                 C   s   t dd | D S )Nc                 s   s    | ]	}t |d k V  qdS )   Nord).0c r   CC:\wamp64\www\opt\env\Lib\site-packages\numba/tests/test_unicode.py	<genexpr>   s    zisascii.<locals>.<genexpr>)allsr   r   r   isascii      r   c                   C      dS N   大处着眼，小处着手。r   r   r   r   r   literal_usecase      r!   c                 C   s   | S Nr   xr   r   r   passthrough_usecase   r"   r&   c                 C   s   | |kS r#   r   r%   yr   r   r   
eq_usecase      r)   c                 C      t | S r#   lenr$   r   r   r   len_usecase!   r*   r.   c                 C   r+   r#   )boolr$   r   r   r   bool_usecase%   r*   r0   c                 C   s   | | S r#   r   r%   ir   r   r   getitem_usecase)   r*   r3   c                 C   s   t | | S r#   )hashr1   r   r   r   getitem_check_kind_usecase-      r5   c                 C   
   |  |S r#   )zfillr'   r   r   r   zfill_usecase1      
r9   c                 C   s   | | S r#   r   r'   r   r   r   concat_usecase5   r*   r;   c                 C   s   | | S r#   r   r'   r   r   r   repeat_usecase9   r*   r<   c                 C   s   | |7 } | S r#   r   r'   r   r   r   inplace_concat_usecase=   s   r=   c                 C   s   | |v S r#   r   r'   r   r   r   
in_usecaseB   r*   r>   c                 C      | |k S r#   r   r'   r   r   r   
lt_usecaseF   r*   r@   c                 C   s   | |kS r#   r   r'   r   r   r   
le_usecaseJ   r*   rA   c                 C      | |kS r#   r   r'   r   r   r   
gt_usecaseN   r*   rC   c                 C   s   | |kS r#   r   r'   r   r   r   
ge_usecaseR   r*   rD   c                 C   r7   r#   )	partitionr   sepr   r   r   partition_usecaseV   r:   rH   c                 C   r7   r#   findr'   r   r   r   find_usecaseZ   r:   rK   c                 C      |  ||S r#   rI   r%   r(   startr   r   r   find_with_start_only_usecase^   r6   rO   c                 C      |  |||S r#   rI   r%   r(   rN   endr   r   r   find_with_start_end_usecaseb      rS   c                 C   r7   r#   )
rpartitionrF   r   r   r   rpartition_usecasef   r:   rV   c                 C   r7   r#   countr'   r   r   r   count_usecasej   r:   rY   c                 C   rL   r#   rW   rM   r   r   r   count_with_start_usecasen   r6   rZ   c                 C   rP   r#   rW   rQ   r   r   r   count_with_start_end_usecaser   rT   r[   c                 C   r7   r#   rfindr'   r   r   r   rfind_usecasev   r:   r^   c                 C   rL   r#   r\   rM   r   r   r   rfind_with_start_only_usecasez   r6   r_   c                 C   rP   r#   r\   rQ   r   r   r   rfind_with_start_end_usecase~   rT   r`   c                 C   rL   r#   replace)r   r%   r(   r   r   r   replace_usecase   r6   rc   c                 C   rP   r#   ra   r   r%   r(   rX   r   r   r   replace_with_count_usecase   rT   re   c                 C   r7   r#   rindexr'   r   r   r   rindex_usecase   r:   rh   c                 C   rL   r#   rf   rM   r   r   r   rindex_with_start_only_usecase   r6   ri   c                 C   rP   r#   rf   rQ   r   r   r   rindex_with_start_end_usecase   rT   rj   c                 C   r7   r#   indexr'   r   r   r   index_usecase   r:   rm   c                 C   rL   r#   rk   rM   r   r   r   index_with_start_only_usecase   r6   rn   c                 C   rP   r#   rk   rQ   r   r   r   index_with_start_end_usecase   rT   ro   c                 C   r7   r#   
startswithr'   r   r   r   startswith_usecase   r:   rr   c                 C   r7   r#   endswithr'   r   r   r   endswith_usecase   r:   ru   c                 C      |   S r#   
expandtabsr   r   r   r   expandtabs_usecase   r*   ry   c                 C   r7   r#   rw   r   tabsizer   r   r   expandtabs_with_tabsize_usecase   r:   r|   c                 C      | j |dS )N)r{   rw   rz   r   r   r   %expandtabs_with_tabsize_kwarg_usecase   r6   r~   c                 C   rL   r#   rp   rM   r   r   r   "startswith_with_start_only_usecase   r6   r   c                 C   rP   r#   rp   rQ   r   r   r   !startswith_with_start_end_usecase   rT   r   c                 C   rL   r#   rs   rM   r   r   r    endswith_with_start_only_usecase   r6   r   c                 C   rP   r#   rs   rQ   r   r   r   endswith_with_start_end_usecase   rT   r   c                 C   r7   r#   splitr'   r   r   r   split_usecase   r:   r   c                 C   rL   r#   r   r%   r(   maxsplitr   r   r   split_with_maxsplit_usecase   r6   r   c                 C      | j ||dS N)r   r   r   r   r   r   !split_with_maxsplit_kwarg_usecase   rT   r   c                 C   rv   r#   r   r$   r   r   r   split_whitespace_usecase   r*   r   c                 C   rv   r#   
splitlinesr   r   r   r   splitlines_usecase   r*   r   c                 C   r7   r#   r   r   keependsr   r   r    splitlines_with_keepends_usecase   r:   r   c                 C   r}   )N)r   r   r   r   r   r   &splitlines_with_keepends_kwarg_usecase   r6   r   c                 C   r7   r#   rsplitrF   r   r   r   rsplit_usecase   r:   r   c                 C   rL   r#   r   r   rG   r   r   r   r   rsplit_with_maxsplit_usecase   r6   r   c                 C   r   r   r   r   r   r   r   "rsplit_with_maxsplit_kwarg_usecase   rT   r   c                 C   rv   r#   r   r   r   r   r   rsplit_whitespace_usecase   r*   r   c                 C   rv   r#   lstripr$   r   r   r   lstrip_usecase   r*   r   c                 C   r7   r#   r   r%   charsr   r   r   lstrip_usecase_chars   r:   r   c                 C   rv   r#   rstripr$   r   r   r   rstrip_usecase   r*   r   c                 C   r7   r#   r   r   r   r   r   rstrip_usecase_chars   r:   r   c                 C   rv   r#   stripr$   r   r   r   strip_usecase  r*   r   c                 C   r7   r#   r   r   r   r   r   strip_usecase_chars  r:   r   c                 C   r7   r#   )joinr'   r   r   r   join_usecase
  r:   r   c                 C   s   dg}|   | |S )N )popr   )r%   lr   r   r   join_empty_usecase  s   
r   c                 C   r7   r#   centerr'   r   r   r   center_usecase  r:   r   c                 C   rL   r#   r   r%   r(   fillcharr   r   r   center_usecase_fillchar  r6   r   c                 C   r7   r#   ljustr'   r   r   r   ljust_usecase  r:   r   c                 C   rL   r#   r   r   r   r   r   ljust_usecase_fillchar!  r6   r   c                 C   r7   r#   rjustr'   r   r   r   rjust_usecase%  r:   r   c                 C   rL   r#   r   r   r   r   r   rjust_usecase_fillchar)  r6   r   c                 C   rv   r#   )istitler$   r   r   r   istitle_usecase-  r*   r   c                 C   s   g }| D ]}| | q|S r#   append)r%   r   r2   r   r   r   iter_usecase1     r   c                 C   rv   r#   titler$   r   r   r   r   8  r*   r   c                  C   s   g } dD ]}|  | q| S r   r   )r   r2   r   r   r   literal_iter_usecase<  r   r   c                 C   s2   d}d}t | D ]\}}||7 }|d7 }q||fS )Nr   r      )	enumerate)r%   bufscanr2   r   r   r   r   enumerated_iter_usecaseC  s   
r   c                 C   s.   t | }t| }t|d D ]}t| qd S )Nr   )r-   iterrangenext)r%   nr2   _r   r   r   iter_stopiteration_usecaseL  s
   
r   c                  C   s2   d} t | }t| }t|d D ]}t| qd S )Nr    r   )r   r-   r   r   )r   r2   r   r   r   r   r   "literal_iter_stopiteration_usecaseS  s   
r   c                 C   rv   r#   )islowerr$   r   r   r   islower_usecase[  r*   r   c                 C   rv   r#   lowerr$   r   r   r   lower_usecase_  r*   r   c                 C   r+   r#   r   r$   r   r   r   ord_usecasec  r*   r   c                 C   r+   r#   )chrr$   r   r   r   chr_usecaseg  r*   r   c                       s   e Zd Z fddZ  ZS )BaseTestc                    s   t t|   d S r#   )superr   setUp)self	__class__r   r   r   l  r   zBaseTest.setUp)__name__
__module____qualname__r   __classcell__r   r   r   r   r   k  s    r   )r   ascii12345
1234567890   ¡Y tú quién te crees?   🐍⚡r    )r   aaar   bZaababascZascihr   Zasciju   大处着眼，小处着手r    u%   大处着眼，小处着手。🐍⚡) r   r   )r   r   )r   r   )zasc ii )r   ci)r   r   )r      Ă)r      大处)r      étú?)r   +   大处 着眼，小处着手。大大大处)r   r   )r   r   )r   r   )r   u   大处大处)r   r   )r   r   r   r   )r   r   )r      tú quién te crees?)r   r   )r   r   )r   r   )r   r   )r   r   )r   r   )r   r   )ababababa)r   r   )r   aba)
aaaaaaaaaar   )r      aĂ)Zaabbaaaabbaaaac                   @   s$  e Zd Zdd ZefddZefddZdd Zd	d
 ZefddZ	efddZ
efddZefddZefddZefddZdd Zdd Zdd Zdd Zdd  Zd!d" Zd#d$ Zd%d& Zd'd( Zd)d* Zd+d, Zd-d. Zd/d0 Zd1d2 Zefd3d4Zd5d6 Zd7d8 Zefd9d:Z d;d< Z!d=d> Z"d?d@ Z#dAdB Z$dCdD Z%dEdF Z&dGdH Z'dIdJ Z(dKdL Z)dMdN Z*dOdP Z+dQdR Z,dSdT Z-dUdV Z.dWdX Z/dYdZ Z0d[d\ Z1d]d^ Z2d_d` Z3dadb Z4dcdd Z5dedf Z6dgdh Z7didj Z8dkdl Z9dmdn Z:dodp Z;dqdr Z<dsdt Z=dudv Z>dwdx Z?dydz Z@d{d| ZAefd}d~ZBefddZCdd ZDdd ZEdd ZFdd ZGdd ZHdd ZIdd ZJdd ZKdd ZLdd ZMdd ZNdd ZOdd ZPdd ZQdd ZRdd ZSdd ZTdd ZUdd ZVdd ZWdd ZXefddZYdd ZZdd Z[dd Z\dd Z]dd Z^efddZ_efddZ`efddZaefddZbefddZcdd ZdddĄ ZeddƄ ZfddȄ Zgddʄ Zhdd̄ Zidd΄ ZjddЄ Zkdd҄ ZlddԄ Zmddք Zndd؄ Zoddڄ Zpdd܄ Zqddބ Zrdd Zsdd Ztdd Zudd Zvdd Zwdd Zxdd Zydd Zzdd Z{dd Z|dd Z}dS )TestUnicodec                 C   s    t }tt }| | |  d S r#   )r!   r   assertPreciseEqualr   pyfunccfuncr   r   r   test_literal     zTestUnicode.test_literalc                 C   .   t }t|}tD ]}| |||| qd S r#   )r&   r   UNICODE_EXAMPLESassertEqualr   flagsr   r   r   r   r   r   test_passthrough  
   zTestUnicode.test_passthroughc              	   C   s   t }t|}tD ]<}ttD ]5}| ||||||d||f  | ||d||dd|df  | |d||d|dd|f  qqd S )Nz%s, %sr   )r)   r   r  reversedr  r   r  r   r   r   r   r   r   r   test_eq  s   zTestUnicode.test_eqc                 C   s<   t dd }td D ]\}}| |||||| q
d S )Nc                 S   s4   | dkrd}nd }|dk rd}nd }||krdS dS )Nr   Zconcrete
      r   )Zpred1Zpred2Z	resolved1Z	resolved2r   r   r   foo  s   z)TestUnicode.test_eq_optional.<locals>.foo)r   r  )r   r   r  py_func)r   r  p1p2r   r   r   test_eq_optional  s
   
zTestUnicode.test_eq_optionalc              	   C   s   |}t |}tD ]}| ||||||d|j||f  qttddD ]*\}}| ||||||d|j||f  | ||||||d|j||f  q$d S )Nz%s: "%s", "%s"   r)r   UNICODE_ORDERING_EXAMPLESr  r   r   )r   Zusecaser   r   r   r   r   r   r   _check_ordering_op  s(   zTestUnicode._check_ordering_opc                 C      |  t d S r#   )r  r@   r   r  r   r   r   test_lt  rT   zTestUnicode.test_ltc                 C   r  r#   )r  rA   r  r   r   r   test_le  rT   zTestUnicode.test_lec                 C   r  r#   )r  rC   r  r   r   r   test_gt  rT   zTestUnicode.test_gtc                 C   r  r#   )r  rD   r  r   r   r   test_ge  rT   zTestUnicode.test_gec                 C   r  r#   )r.   r   r  r  r  r   r   r   test_len  r	  zTestUnicode.test_lenc                 C   r  r#   )r0   r   r  r  r  r   r   r   	test_bool  r	  zTestUnicode.test_boolc                 C   D   t }t|}g d}d}|D ]}| j||||||d q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)ry   r   r  formatr   r   r   casesr'  r   r   r   r   test_expandtabs      zTestUnicode.test_expandtabsc              
   C   sx   t tt tg}ddg}g d}|D ]'}tddD ]}t||D ]\}}| j|||||||||d q qqd S )Nz,Results of "{}".expandtabs({}) must be equalz4Results of "{}".expandtabs(tabsize={}) must be equalr$  r  r  r&  )r   r|   r~   r   zipr  r  r(  )r   fnsmessagesr*  r   r{   fnr'  r   r   r   test_expandtabs_with_tabsize  s    
z(TestUnicode.test_expandtabs_with_tabsizec                 C   sj   t }t|}tjtf}| t}|dd W d    n1 s 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)r   r   r   accepted_typesraisesr'  r   r   r   ,test_expandtabs_exception_noninteger_tabsize+  s   

z8TestUnicode.test_expandtabs_exception_noninteger_tabsizec           	      C   s   t }t|}g d}g d}ddg}|t D ])}dd|d d |dd  ||| g}|| | D ]}| |||||| q0qd S )	Nhello
helloworldr   
her=  r>  Zellor   Zlowolor@  rA  ohellohellohellor   r   r%      rr   r   r  r  )	r   r   r   cpython_strcpython_subs
extra_subsr   default_subsprefixr   r   r   test_startswith_default5  s   $z#TestUnicode.test_startswith_defaultc           
   
   C   s   t }t|}g d}g d}ddg}|t D ]8}dd|d d |dd  ||| g}|| | D ]}ttd	d
d g D ]}	| ||||	||||	 q<q0qd S Nr<  r?  rC  r   r   r%   rD  rE  r  )r   r   r  listr   r  )
r   r   r   rG  rH  rI  r   rJ  rK  rN   r   r   r   test_startswith_with_startD  s   $
z&TestUnicode.test_startswith_with_startc                 C   s   t }t|}g d}g d}ddg}|t D ]G}dd|d d |dd  ||| g}|| | D ],}ttd	d
d g D ]}	ttd	d
d g D ]}
| ||||	|
||||	|
 qHq<q0qd S rM  r   r   r  rO  r   r  )r   r   r   rG  rH  rI  r   rJ  rK  rN   rR   r   r   r   test_startswith_with_start_endU  s"   $z*TestUnicode.test_startswith_with_start_endc                 C   s   d}|  t| tt}|dd W d    n1 sw   Y  d}|  t| tt}|ddd W d    n1 s>w   Y  d}|  t| tt}|dddd	 W d    d S 1 sbw   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   rr   r   r   )r   Zmsg_invalid_prefixr   Zmsg_invalid_startZmsg_invalid_endr   r   r   &test_startswith_exception_invalid_argsg  s$   "z2TestUnicode.test_startswith_exception_invalid_argsc           
      C   s   t }t|}g d}g d}ddg}|t D ]-}dd|d d |dd  ||| g}|| | D ]}|d	f}	| |||	|||	 q0qd S )
Nr<  r?  rC  r   r   r%   rD  rE  rA  rF  )
r   r   r   rG  rH  rI  r   rJ  sub_strrK  r   r   r   test_startswith_tuplez  s   $z!TestUnicode.test_startswith_tuplec                 C   s   t }t|}g d}g d}ddg}|t D ]K}dd|d d |dd  ||| g}|| | D ]0}ttd	d
d g D ]#}	ttd	d
d g D ]}
|df}| ||||	|
||||	|
 qHq<q0qd S )Nr<  r?  rC  r   r   r%   rD  rE  rN  r  rA  rQ  )r   r   r   rG  rH  rI  r   rJ  rU  rN   rR   rK  r   r   r   test_startswith_tuple_args  s$   $z&TestUnicode.test_startswith_tuple_argsc           
   	   C   s   t }t|}g d}g d}ddg}|t D ]1}dd|d d |dd  ||| g}|| | D ]}d	}	| j|||||||	||d
 q0qd S )Nr<  r?  rC  r   r   r%   rD  rE  z)Results "{}".endswith("{}") must be equalr&  ru   r   r  r  r(  )
r   r   r   rG  rH  rI  r   rJ  rU  r'  r   r   r   test_endswith_default  s   $
z!TestUnicode.test_endswith_defaultc                 C   s   t }t|}g d}g d}ddg}|t D ]A}dd|d d |dd  ||| g}|| | D ]&}ttd	d
d g D ]}	d}
| j||||	||||	|
|||	d q<q0qd S )Nr<  r?  rC  r   r   r%   rD  rE  rN  r  z-Results "{}".endswith("{}", {}) must be equalr&  )r   r   r  rO  r   r  r(  )r   r   r   rG  rH  rI  r   rJ  rU  rN   r'  r   r   r   test_endswith_with_start  s"   $
z$TestUnicode.test_endswith_with_startc                 C   s   t }t|}g d}g d}ddg}|t D ]Q}dd|d d |dd  ||| g}|| | D ]6}ttd	d
d g D ])}	ttd	d
d g D ]}
d}| j||||	|
||||	|
||||	|
d qHq<q0qd S )Nr<  r?  rC  r   r   r%   rD  rE  rN  r  OResults "{}".endswith("{}", {}, {})                               must be equalr&  r   r   r  rO  r   r  r(  )r   r   r   rG  rH  rI  r   rJ  rU  rN   rR   r'  r   r   r   test_endswith_with_start_end  s&   $z(TestUnicode.test_endswith_with_start_endc              	   C   s   t }t|}g d}g d}ddg}|t D ]5}dd|d d |dd  ||| g}|| | D ]}d	}	|d
f}
| j|||
|||
|	||
d q0qd S )Nr<  r?  rC  r   r   r%   rD  rE  z'Results "{}".endswith({}) must be equalrA  r&  rX  )r   r   r   rG  rH  rI  r   rJ  rU  r'  
tuple_subsr   r   r   test_endswith_tuple  s    $
zTestUnicode.test_endswith_tuplec                 C   s   t }t|}g d}g d}ddg}|t D ]U}dd|d d |dd  ||| g}|| | D ]:}ttd	d
d g D ]-}	ttd	d
d g D ] }
d}|df}| j||||	|
||||	|
||||	|
d qHq<q0qd S )Nr<  r?  rC  r   r   r%   rD  rE  rN  r  r[  rA  r&  r\  )r   r   r   rG  rH  rI  r   rJ  rU  rN   rR   r'  r^  r   r   r   test_endswith_tuple_args  s,   $z$TestUnicode.test_endswith_tuple_argsc              	   C   sv   t }t|}tD ]0}dd|d d d |d d |dd  ||| g}|D ]}| ||||||d||f  q$qd S )Nr   xxr  rD  rE  z'%s' in '%s'?)r>   r   r  r  )r   r  r   r   r   extrassubstrr   r   r   test_in  s   0
zTestUnicode.test_inc              	   C      |    t}t|}||fD ]%}| t}|dd W d    n1 s%w   Y  | dt|j qtj	tj
f}| t}|dd  W d    n1 sOw   Y  d|}| |t|j d S Nr   r   empty separatorz"sep" must be {}, not none)disable_leak_checkrH   r   r5  
ValueErrorr6  r7  r8  r   UnicodeTypeUnicodeCharSeqr
   r(  r   r   r   funcr:  r9  r'  r   r   r   $test_partition_exception_invalid_sep     
z0TestUnicode.test_partition_exception_invalid_sepc                 C   N   t }t|}g d}d}|D ]\}}| j|||||||||d qd S )N	r      ⚡abcabcrs  r   rs     🐍⚡🐍rs  abababar   rz  r   rz  r   rz  r   rz  r   z-Results of "{}".partition("{}") must be equalr&  )rH   r   r  r(  r   r   r   CASESr'  r   rG   r   r   r   test_partition'     
zTestUnicode.test_partitionc           
      C   s   t }t|}d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
}|| D ]\}}|D ]}d}	| j|||||||	||d qEq?d S )Nc              	   S   .   g | ]}|d d|dd |dd |gfqS r   ra  NrD  rE  r   r   r   r   r   r   
<listcomp>?      "z)TestUnicode.test_find.<locals>.<listcomp>uf   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaĂr   u   ȁu   Ġu   Ƞuh   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa􀌄   􀌄u   􀈄u   􂀄   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂar     􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄a  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄Ăr   daaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)r   r  r   u   a􀌄   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂr  u   Ă􀌄   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂa_a_  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄a_  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄Ă_   Ă_z%Results "{}".find("{}") must be equalr&  )rK   r   r  r  r(  )
r   r  r   r   rJ  rH  r   subsrU  r'  r   r   r   	test_find;  s0   




zTestUnicode.test_findc                 C      t }t|}tD ]8}dd|d d |dd  |fD ]&}ttddd g D ]}d}| j||||||||||||d q%qqd S )	Nr   ra  rD  rE  rN  r  z)Results "{}".find("{}", {}) must be equalr&  )rO   r   r  rO  r   r  r(  r   r   r   r   rU  rN   r'  r   r   r   test_find_with_start_onlyW     "
z%TestUnicode.test_find_with_start_onlyc           
      C   s   t }t|}ttddd g  }}tD ]8}dd|d d |dd  |fD ]&}t||D ]\}}d}	| j|||||||||||	||||d q,q%qd S )	NrN  r  r   ra  rD  rE  z0Results of "{}".find("{}", {}, {}) must be equalr&  )rS   r   rO  r   r  r   r  r(  
r   r   r   startsendsr   rU  rN   rR   r'  r   r   r   test_find_with_start_endc  s   "z$TestUnicode.test_find_with_start_endc           	   	   C   s   t }t|}tjtjf}dD ]0\}}}| t}|dd|| W d    n1 s*w   Y  d||}| |t	|j
 qd S N))皙?   rN   )r         ?rR   r   Zsciz"{}" must be {}, not float)rS   r   r   r3  NoneTyper5  r
   r(  r6  r7  r8  )	r   r   r   acceptedrN   rR   namer:  r'  r   r   r   (test_find_exception_noninteger_start_endp  s   z4TestUnicode.test_find_exception_noninteger_start_endc              	   C   re  rf  )rh  rV   r   r5  ri  r6  r7  r8  r   rj  rk  r
   r(  rl  r   r   r   %test_rpartition_exception_invalid_sep{  ro  z1TestUnicode.test_rpartition_exception_invalid_sepc                 C   rp  )Nrq  z.Results of "{}".rpartition("{}") must be equalr&  )rV   r   r  r(  r  r   r   r   test_rpartition  r  zTestUnicode.test_rpartitionc                 C   sP   t }t|}d}tD ]\}}|||}|||}| ||||||| q
d S )Nz6'{0}'.py_count('{1}') = {2}
'{0}'.c_count('{1}') = {3})rY   r   UNICODE_COUNT_EXAMPLESr  r(  )r   r   r   	error_msgr   sub	py_resultc_resultr   r   r   
test_count  s   

zTestUnicode.test_countc           	      C   s   t }t|}dd }tD ]@\}}tddD ]}||||}||||}| |||||||| q|||d }|||d }| |||||d || qd S )N%s
%s)z '{0}'.py_count('{1}', {2}) = {3}z'{0}'.c_count('{1}', {2}) = {4}   )rZ   r   r  r   r  r(  )	r   r   r   r  r   r  r2   r  r  r   r   r   test_count_with_start  s(   z!TestUnicode.test_count_with_startc           
      C   s   t }t|}dd }tD ]p\}}ttdddD ]!\}}|||||}|||||}	| ||	|||||||	 qtddD ]}|||d |}|||d |}	| ||	|||d |||	 q?|||d d }|||d d }	| ||	|||d d ||	 qd S )Nr  )%'{0}'.py_count('{1}', {2}, {3}) = {4}z$'{0}'.c_count('{1}', {2}, {3}) = {5}r  r  )r  r  )r[   r   r  r   r   r  r(  )
r   r   r   r  r   r  r2   jr  r  r   r   r   test_count_with_start_end  s8   z%TestUnicode.test_count_with_start_endc                 C   s   t t}| t}|dddd W d    n1 sw   Y  | dt|j | t}|dddd W d    n1 s@w   Y  | dt|j | t}|dddd W d    n1 sew   Y  | d	t|j d S )
Nr   r   r   r  ,The slice indices must be an Integer or Noneg333333?      z(The substring must be a UnicodeType, not)r   r[   r5  r
   r6  r7  r8  r   r   r:  r   r   r   test_count_arg_type_check  s&   z%TestUnicode.test_count_arg_type_checkc                    s   t   fdd}| t}|dddd W d    n1 sw   Y  | dt|j dd }ttjtjt	tjt	tj}t
|g } ddd	d
}|ddd	d
}| |||ddd	d
|| d S )Nc                     s6   t t jt jt t jt t j}t|g  d S r#   )r   int64unicode_typeOptionalfloat64r   )argsZbad_sigr   r   r   try_compile_bad_optional     

zPTestUnicode.test_count_optional_arg_type_check.<locals>.try_compile_bad_optional	   tú quis?u   tú皙?r  r  )r  z''{0}'.c_count_op('{1}', {2}, {3}) = {5}r      )r[   r5  r
   r6  r7  r8  r   r  r  r  r   r  r(  )r   r  r:  r  Zsig_optionalcfunc_optionalr  r  r   r  r   "test_count_optional_arg_type_check  s,   

z.TestUnicode.test_count_optional_arg_type_checkc           	      C   s   t }t|}d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}|| D ]\}}|D ]}d}| j|||||||||d qJqDd S )Nc              	   S   r  r  r   r  r   r   r   r    r  z*TestUnicode.test_rfind.<locals>.<listcomp>uf   Ăaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar  uh   􀌄aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar  abcdefghiabcabcr      aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂr     a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄  Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄r   r  )r   r  u   Ăau   􀌄ar  r  u   􀌄Ă   _aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂ_a  _a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄  _Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄   _Ăz&Results "{}".rfind("{}") must be equalr&  )r^   r   r  r  r(  	r   r   r   rJ  rH  r   r  rU  r'  r   r   r   
test_rfind
  s2   





zTestUnicode.test_rfindc                 C   r  )	Nr   ra  rD  rE  rN  r  z*Results "{}".rfind("{}", {}) must be equalr&  )r_   r   r  rO  r   r  r(  r  r   r   r   test_rfind_with_start_only'  r  z&TestUnicode.test_rfind_with_start_onlyc           
      C   s   t }t|}ttddd g }ttddd g }tD ]8}dd|d d |dd  |fD ]&}t||D ]\}}d}	| j|||||||||||	||||d q4q-qd S )	NrN  r  r   ra  rD  rE  z1Results of "{}".rfind("{}", {}, {}) must be equalr&  )r`   r   rO  r   r  r   r  r(  r  r   r   r   test_rfind_with_start_end3  s   "z%TestUnicode.test_rfind_with_start_endc              
   C   sr   t t}tD ]0}dD ]+}| t}||| W d    n1 s!w   Y  dtj}| |t	|j
 q
qd S )N)Nr   F
must be {})r   r^   r  r5  r
   r(  r   rj  r6  r7  r8  )r   r   r   rU  r:  r'  r   r   r   test_rfind_wrong_substrA  s   z#TestUnicode.test_rfind_wrong_substrc           	      C   s&  t t}tjtjf}tD ]}dd|d d |dd  |fD ]r}tddgddgD ].\}}| t}||||| W d    n1 sCw   Y  d		|}| 
|t|j q(tddgd
dgD ].\}}| t}||||| W d    n1 s{w   Y  d	|}| 
|t|j q`qqd S )Nr   ra  rD  rE  r  Fr  r   z"start" must be {}gTz"end" must be {})r   r`   r   r3  r  r  r   r5  r
   r(  r6  r7  r8  )	r   r   r9  r   rU  rN   rR   r:  r'  r   r   r   test_rfind_wrong_start_endK  s&   "

z&TestUnicode.test_rfind_wrong_start_endc                 C   s   t d }|dd }tjtjf}d|}dd }| t}|||dd W d    n1 s0w   Y  | |t|j	 dd	 }| t}|||dd W d    n1 sYw   Y  | |t|j	 d S )
Nr   r   r  r  c                  W   6   t t jt jt t jt t j}t|gt d S r#   )r   r  r  r  r  intpr   r`   r  Zwrong_sig_optionalr   r   r    try_compile_wrong_start_optionale  r  zYTestUnicode.test_rfind_wrong_start_end_optional.<locals>.try_compile_wrong_start_optionalr  c                  W   r  r#   )r   r  r  r  r  r  r   r`   r  r   r   r   try_compile_wrong_end_optionalp  r  zWTestUnicode.test_rfind_wrong_start_end_optional.<locals>.try_compile_wrong_end_optional)
r  r   r3  r  r(  r5  r
   r6  r7  r8  )r   r   rU  r9  r'  r  r:  r  r   r   r   #test_rfind_wrong_start_end_optional_  s   
z/TestUnicode.test_rfind_wrong_start_end_optionalc           	   	   C      t }t|}d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}|| D ]\}}|D ]}d}| j|||||||||d q6q0d S )Nc                 S   ,   g | ]}|d |dd |dd |gfqS r   NrD  rE  r   r  r   r   r   r         z+TestUnicode.test_rindex.<locals>.<listcomp>r  r   defr  r  r   r  r  r   r  r  r  r  r  z'Results "{}".rindex("{}") must be equalr&  )rh   r   r  r  r(  r  r   r   r   test_rindex{  *   
	
zTestUnicode.test_rindexc           	   	   C   r  )Nc                 S   r  r  r   r  r   r   r   r    r  z*TestUnicode.test_index.<locals>.<listcomp>r  r  r  r   r  r  r   r  r  r  r  r  z&Results "{}".index("{}") must be equalr&  )rm   r   r  r  r(  r  r   r   r   
test_index  r  zTestUnicode.test_indexc                 C   s  t tg}ddg}g d}t||D ]s\}}t|}|D ]h}t|}dttd|d f|d d dgttdd|  f|d	d  ttd
ttdd
|  f|dgttdd|  fg}	|	D ]!\}
}|d g D ]}| j|||
||||
||||
|d qjqaqqd S )Nz*Results "{}".index("{}", {}) must be equalz+Results "{}".rindex("{}", {}) must be equalr   r   r   r   r    r   r   rD  r   rE     r&  )	rn   ri   r-  r   r-   rO  r   r  r(  )r   pyfuncsr/  unicode_examplesr   r'  r   r   r   r*  rU  r  rN   r   r   r   !test_index_rindex_with_start_only  s4   "(
z-TestUnicode.test_index_rindex_with_start_onlyc                 C   sX  t tg}ddg}g d}t||D ]\}}t|}|D ]}t|}dttd|d tt|df|d d d	gttdd|  dd
gtt|d d f|dd  ttdttdd
 tt|df|d	gttdd|  tt|dfg}	|	D ]*\}
}}t|d g |D ]\}}| j|||
|||||
|||	||
||d qq}qqd S )Nz1Results of "{}".index("{}", {}, {}) must be equalz2Results of "{}".rindex("{}", {}, {}) must be equalr  r   r  r   r  rD  r   r  r  rE  r  r&  )
ro   rj   r-  r   r-   rO  r   r   r  r(  )r   r  r/  r  r   r'  r   r   r   r*  rU  r  r  rN   rR   r   r   r    test_index_rindex_with_start_end  s8     "&z,TestUnicode.test_index_rindex_with_start_endc                 C   s(  |    g d}ttg}|D ]}t|}|D ]z}t|}dtt|d d|gf|d d dgtt|d f|dd  ttd	d|gf|d gtt|fg}|D ]=\}}	}
t|	|
D ]2\}}||fD ])}| t	}||||| W d    n1 s}w   Y  d
}| 
|t|j qdq\qRqqd S )Nr  r   r   r  rD  r   r  rE  r  zsubstring not found)rh  ro   rj   r   r-   rO  r   r   r5  ri  r6  r7  r8  )r   r  r  r   r   r   r   r*  rU  r  r  rN   rR   rm  r:  r'  r   r   r   /test_index_rindex_exception_substring_not_found  s2   z;TestUnicode.test_index_rindex_exception_substring_not_foundc           
   
   C   s   t jt jf}ttg}|D ]9}t|}dD ]0\}}}| t}|dd|| W d    n1 s0w   Y  d||}	| 	|	t
|j qqd S r  )r   r3  r  ro   rj   r   r5  r
   r(  r6  r7  r8  )
r   r  r  r   r   rN   rR   r  r:  r'  r   r   r   0test_index_rindex_exception_noninteger_start_end  s   z<TestUnicode.test_index_rindex_exception_noninteger_start_endc              	   C   sV   t }t|}tD ] }tt| t|D ]}| ||||||d||f  qqd S )N	'%s'[%d]?)r3   r   r  r   r-   r  )r   r   r   r   r2   r   r   r   test_getitem  s   
zTestUnicode.test_getitemc              	   C   s^   t }t|}ddg}|D ] }tt| t|D ]}| ||||||d||f  qqd S )Nu   aሴu   ¡着r  )r5   r   r   r-   r  )r   r   r   samplesr   r2   r   r   r   test_getitem_scalar_kind  s   
z$TestUnicode.test_getitem_scalar_kindc              	   C   s   |    t}t|}tD ]L}| t}||t| W d    n1 s%w   Y  | dt|j	 | t}||t| W d    n1 sJw   Y  | dt|j	 qd S )Nzstring index out of range)
rh  r3   r   r  r5  
IndexErrorr-   r6  r7  r8  )r   r   r   r   r:  r   r   r   test_getitem_error#  s   zTestUnicode.test_getitem_errorc                 C   s   t }t|}tD ]7}ttt| t|D ](}ttt| t|D ]}t||}| ||||||d|||f  q$qqd S )N'%s'[%d:%d]?)r3   r   r  rO  r   r-   slicer  r   r   r   r   r2   r  slr   r   r   test_slice22     
zTestUnicode.test_slice2c                 C   s   t }t|}tD ]7}ddt|t|d fD ](}ddt|t|d fD ]}t||}| ||||||d|||f  q$qqd S )NrD  r  r   r  r3   r   r  r-   r  r  r  r   r   r   test_slice2_error>  r  zTestUnicode.test_slice2_errorc                 C   s   t }t|}ddg}|D ]=}dddddt|t|d fD ]+}dddddt|t|d fD ]}t||}| ||||||d|||f  q.qqd S )	N	   abcሴሴu   ¡¡¡着着着rD  r  r   r   r  r  )r5   r   r-   r  r  )r   r   r   r  r   r2   r  r  r   r   r   test_getitem_slice2_kindJ  s   ""
z$TestUnicode.test_getitem_slice2_kindc                 C   s   t }t|}tD ]:}tt| t|D ]-}tt| t|D ] }dD ]}t|||}| ||||||d||||f  q$q qqd S )NrD  r  r   r  '%s'[%d:%d:%d]?)r3   r   r  r   r-   r  r  r   r   r   r   r2   r  kr  r   r   r   test_slice3X  s   zTestUnicode.test_slice3c           	      C   s   t }t|}g d}|D ]:}tt| t|D ]-}tt| t|D ] }dD ]}t|||}| ||||||d||||f  q(q$qqd S )N)r  u   aሴbሴc¡¡¡着着着u   ¡着¡着¡着u   着a着b着cu   ¡着a¡着b¡着cu   ¡着a着¡cr  r  )r5   r   r   r-   r  r  )	r   r   r   r  r   r2   r  r  r  r   r   r   test_getitem_slice3_kinde  s    z$TestUnicode.test_getitem_slice3_kindc                 C   s   t }t|}tD ]>}ddt|t|d fD ]/}ddt|t|d fD ] }dD ]}t|||}| ||||||d||||f  q(q$qqd S )NrD  r  r   r  r  r  r  r   r   r   test_slice3_errorz  s   zTestUnicode.test_slice3_errorc                 C   s$   t d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                 S   s    | d d d j | dd d j fS )Nr  r   	_is_asciir   r   r   r   f  s    z,TestUnicode.test_slice_ascii_flag.<locals>.fu    ¿abc¡Y tú, quién te cre		es?)r   r   Nr   r  r   r
  r   r   r   r   test_slice_ascii_flag  s   
z!TestUnicode.test_slice_ascii_flagc                 C   s   t }t|}g d}| t}||d d W d    n1 s!w   Y  | dt|j |D ]}tddD ]}| |||||| q8q1d S )N)r   z+asciiz-asciiz-asc ii-r   z-12345z+12345r   u   ¡Y tú crs?r   u   +🐍⚡u   -🐍⚡u   大眼，小手。u   +大眼，小手。u   -大眼，小手。r   r  z<width> must be an Integerr  )	r9   r   r5  r
   r6  r7  r8  r   r  )r   r   r   ZZFILL_INPUTSr:  r   widthr   r   r   
test_zfill  s   zTestUnicode.test_zfillc              	   C   P   t }t|}tD ]}td d d D ]}| ||||||d||f  qqd S Nr  z'%s' + '%s'?)r;   r   r  r  r  r   r   r   test_concat     
zTestUnicode.test_concatc                 C   sT   t }t|}tD ]}dD ]}| |||||| | |||||| qqd S )N)r  r   r   r  rE  r  r  r  r     F   )r<   r   r  r  r  r   r   r   test_repeat  s   zTestUnicode.test_repeatc                 C   s^   |    tt}| t}|dd W d    n1 sw   Y  | td t|j d S )Nhig      @z" Function(<built-in function mul>))	rh  r   r<   r5  r
   r6  r   r7  r8  r  r   r   r   test_repeat_exception_float  s   
z'TestUnicode.test_repeat_exception_floatc              	   C   l   |    t}t|}||fD ]%}| t}|dd W d    n1 s%w   Y  | dt|j qd S Nr   r   rg  )rh  r   r   r5  ri  r6  r7  r8  r   r   r   rm  r:  r   r   r   test_split_exception_empty_sep     z*TestUnicode.test_split_exception_empty_sepc              	   C   sh   t }t|}dD ])}| t}|d|d W d    n1 s w   Y  | dt|jd|  qd S )Nr   Nr   r2  r  z"non-integer maxsplit with sep = %s)r   r   r5  r
   r6  r7  r8  )r   r   r   rG   r:  r   r   r   (test_split_exception_noninteger_maxsplit  s   z4TestUnicode.test_split_exception_noninteger_maxsplitc                 C   sH   t }t|}g d}|D ]\}}| ||||||d||f  qd S )N
) a Nrr  rt  rv  rw  ry  r{  r|  r}  r~  z'%s'.split('%s')?)r   r   r  )r   r   r   r  test_strsplitterr   r   r   
test_split  s   
zTestUnicode.test_splitc              
   C   sf   g d}t dftdffD ]$\}}t|}|D ]\}}}| ||||||||||||f  qqd S )N
)r"  Nr   )r   rs  r   )ru  rs  r   )r   rs  r   )rx  rs  r   )rz  r   r  )rz  r   r   )rz  r   r  )rz  r   r   )rz  r   r  z'%s'.split('%s', %d)?z'%s'.split('%s', maxsplit=%d)?)r   r   r   r  )r   r  r   Zfmt_strr   r#  r$  r   r   r   r   test_split_with_maxsplit  s    
z$TestUnicode.test_split_with_maxsplitc                 C   sd   t }t|}dttg d}ddddddd| d	 g}|D ]}| ||||d
|f  qd S )Nr   	   r     r                           i  i    i   i   i   i   i   i   i   i   i	   i
   i(   i)   i/   i_   i 0  ru     🐍 ⚡   🐍 ⚡ 🐍   🐍   ⚡ 🐍       🐍   ⚡ 🐍    🐍
   ⚡ 🐍  z'%s'.split()?)r   r   r   mapr   r  )r   r   r   all_whitespacer  r#  r   r   r   test_split_whitespace  s"   
	
z!TestUnicode.test_split_whitespacec              	   C   s   t }t|}tjttjtf}dD ]-\}}| t}|d| W d    n1 s)w   Y  d	||}| 
|t|j qd S )N))noneN)r  None
z"keepends" must be {}, not {})r   r   r   r3  r4  Booleanr/   r5  r
   r(  r6  r7  r8  )r   r   r   r9  tyr   r:  r'  r   r   r   %test_split_exception_invalid_keepends0  s   z1TestUnicode.test_split_exception_invalid_keependsc                 C   r#  )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)  r   r   r   test_splitlines;  r,  zTestUnicode.test_splitlinesc           
   	   C   sx   t tg}ddg}g d}g d}t||D ]$\}}t|}t||D ]\}}	| j|||	|||	|||	d q"qd S )Nz,Results of "{}".splitlines({}) must be equalz5Results of "{}".splitlines(keepends={}) must be equalrB  )TFr   r   r  d   r&  )r   r   r-  r   r   r  r(  )
r   r  r/  r*  Zall_keependsr   r'  r   r   r   r   r   r   test_splitlines_with_keependsF  s    
z)TestUnicode.test_splitlines_with_keependsc              	   C   r  r  )rh  r   r   r5  ri  r6  r7  r8  r  r   r   r   test_rsplit_exception_empty_sepY  r  z+TestUnicode.test_rsplit_exception_empty_sepc              	   C   sv   t }t|}tjtf}dD ]+}| t}|d|d W d    n1 s%w   Y  d|}| |t	|j
 qd S )Nr  r   r2  z "maxsplit" must be {}, not float)r   r   r   r3  r4  r5  r
   r(  r6  r7  r8  )r   r   r   r9  rG   r:  r'  r   r   r   )test_rsplit_exception_noninteger_maxsplite  s   

z5TestUnicode.test_rsplit_exception_noninteger_maxsplitc                 C   rp  )Nr!  z*Results of "{}".rsplit("{}") must be equalr&  )r   r   r  r(  r  r   r   r   test_rsplitp  s   
zTestUnicode.test_rsplitc           
   
   C   sr   t tg}g d}ddg}t||D ]%\}}t|}|D ]\}}}	| j||||	||||	||||	d qqd S )Nr&  z.Results of "{}".rsplit("{}", {}) must be equalz7Results of "{}".rsplit("{}", maxsplit={}) must be equalr&  )r   r   r-  r   r  r(  )
r   r  r  r/  r   r'  r   r#  rG   r   r   r   r   test_rsplit_with_maxsplit  s    
z%TestUnicode.test_rsplit_with_maxsplitc                 C   sh   t }t|}dttg d}ddddddd| d	 g}d
}|D ]}| |||||| q!d S )Nr   r(  ru  r3  r4  r5  r6  r7  r8  z&Results of "{}".rsplit() must be equal)r   r   r   r9  r   r  r(  )r   r   r   r:  r  r'  r   r   r   r   test_rsplit_whitespace  s   
	z"TestUnicode.test_rsplit_whitespacec                 C   s>   t }t|}ddg}|D ]}| ||||d|f  qd S )Nr      🐍🐍🐍z'%s'.join([])?)r   r   r  )r   r   r   r  rG   r   r   r   test_join_empty  s   
zTestUnicode.test_join_emptyc                 C   sj   t }t|}| t}|dg d W d    n1 sw   Y  t|j}| d| | d| d S )Nr   )r   r  rE  z,During: resolving callee type: BoundFunctionzreflected list(int)r   r   r5  r
   r7  r8  r6  )r   r   r   r:  Zexc_messager   r   r   test_join_non_string_exception  s   
z*TestUnicode.test_join_non_string_exceptionc                 C   sn   t }t|}dg dfdg dfdg dfddgd fg}|D ]\}}| ||||||d||f  qd S )	Nr   )r   r   r   r   )r   Zbbbbr   rK     ⚡⚡r  '%s'.join('%s')?r   r   r  r   r   r   r  rG   partsr   r   r   	test_join  s   



zTestUnicode.test_joinc                 C   sH   t }t|}ddg}|D ]\}}| ||||||d||f  qd S )N)r  123)rK  rN  rO  rP  rQ  r   r   r   test_join_interleave_str  s   
z$TestUnicode.test_join_interleave_strc                 C   s   t dftdftdffD ]L\}}t|}| t}|td d W d    n1 s*w   Y  | dt|j	 tD ]}t
ddD ]}| ||||||d	|||f  qAq:qd S )
Nr   r   r   r   r  The width must be an Integerr  r  z'%s'.%s(%d)?)r   r   r   r   r5  r
   r  r6  r7  r8  r   r  )r   r   	case_namer   r:  r   r  r   r   r   test_justification  s$   zTestUnicode.test_justificationc                 C   s   t dftdftdffD ]U\}}t|}dD ]J}| t}|td d| W d    n1 s/w   Y  | dt|j	 tD ]}t
dd	D ]}| ||||||||d
||||f  qFq?qqd S )Nr   r   r   )r   +   úu   处r   r  rV  r  r  z'%s'.%s(%d, '%s')?)r   r   r   r   r5  r
   r  r6  r7  r8  r   r  )r   r   rW  r   r   r:  r   r  r   r   r   test_justification_fillchar  s2   
z'TestUnicode.test_justification_fillcharc              
   C   s   |    tttfD ]\}t|}dD ](}| t}|td d| W d    n1 s+w   Y  | dt	|j
 qdD ](}| t}|td d| W d    n1 sVw   Y  | dt	|j
 q<q	d S )N)r   z+0u   quiénu   处着r   r  z&The fill character must be exactly one)r   r  z"The fillchar must be a UnicodeType)rh  r   r   r   r   r5  ri  r  r6  r7  r8  r
   )r   r   r   r   r:  r   r   r   %test_justification_fillchar_exception!  s,   z1TestUnicode.test_justification_fillchar_exceptionc              	   C   r  r  )r=   r   r  r  r  r   r   r   test_inplace_concat7  r  zTestUnicode.test_inplace_concatc                 C   ^   dd }t |}g d}g d}d}tdg | | D ]}| j||||||d qd S )Nc                 S   rv   r#   )isidentifierr   r   r   r   r   A  r*   z-TestUnicode.test_isidentifier.<locals>.pyfunc)r   Zr   Zb0bcZb_   µu   𝔘𝔫𝔦𝔠𝔬𝔡𝔢r   [   ©0   u   u   u   u   abu   abu	   abau	   abaz,Results of "{}".isidentifier() must be equalr   r&  r   r  r  r(  r   r   r   cpythonZcpython_extrasr'  r   r   r   r   test_isidentifier@      zTestUnicode.test_isidentifierc                    sL  g d}t dftdftdffD ]\ }t }|D ]\}}|  |||d||f  qqtdftdftdffD ]j\ }t }t	tj	t
tj	}t|g } fdd}||fD ]%}	| t}
|	dd	 W d    n1 stw   Y  | d
t|
j q]||fD ]}	|D ]\}}|  |||	||d|||f  qqq9d S )N))ass ciiZai)rm  N)Zassciiai )zasscii rn  )	 asscii  rn  )ro  zasci )ro  r   )z      r   )r   r   r   )r   Nr  )
  asscii  rn  )rp  r   )rp  N)r      étú? )     tú quién te crees?   rq  )u     tú qrees?   r   )rr  Nr   )    大处大处  r   )z	
abcd	z	a)rs  N)z	 abcd 	N)z
 abcd 
N)z abcd N)z abcd N)z abcd N)u
    abcd N)u	   abcd Nr   r   r   z
'%s'.%s()?c                     s(   t t jt t j}t|g  d S r#   )r   r  r  r  r   )r  badr  r   r   r    s   
z8TestUnicode.test_strip.<locals>.try_compile_bad_optionalr  r  z%The arg must be a UnicodeType or Nonez'%s'.%s('%s')?)r   r   r   r   r  r   r   r   r   r  r  r5  r
   r6  r7  r8  )r   ZSTRIP_CASESrW  r   stringr   Zsig1r  r  r0  r:  r   r  r   
test_stripQ  sP   "


zTestUnicode.test_stripc                 C   r^  )Nc                 S   rv   r#   )isspacer   r   r   r   r     r*   z(TestUnicode.test_isspace.<locals>.pyfunc)	u    u    u   —   𐐁   𐐧   𐐩   𐑎   🐍   👯rf  z'Results of "{}".isspace() must be equalr   r&  rh  ri  r   r   r   test_isspace  rl  zTestUnicode.test_isspacec           
   
   C   sh   t }t|}d}dd tD }g d}t| | }|D ]}||}||}	| ||	||||	 qd S )Nz0'{0}'.py_istitle() = {1}
'{0}'.c_istitle() = {2}c                 S      g | ]}|  qS r   r   r   r%   r   r   r   r        z,TestUnicode.test_istitle.<locals>.<listcomp>)r   z    z  AA  z  Ab  1ZA123ZA12Bcdz+abAZ12AbcZA12abcu   %^Abc 5 $% Def𐐁𐐩u   𐐧𐑎rz  r{  u   🐍 Isu   🐍 NOTu   👯Is   ῼu   Greek ῼitlecases ...)r   r   r  r  r(  )
r   r   r   r  Zunicode_titleZspecialZISTITLE_EXAMPLESr   r  r  r   r   r   test_istitle  s   zTestUnicode.test_istitlec                 C   L   dd }t |}g d}d}t| D ]}| j||||||d qd S )Nc                 S   rv   r#   )isprintabler   r   r   r   r     r*   z,TestUnicode.test_isprintable.<locals>.pyfunc)	r   r   abcdefgzabcdefg
u   ʹu   ͸rg  r}  u   󠀠z+Results of "{}".isprintable() must be equalr&  rh  r   r   r   rj  r'  r   r   r   r   test_isprintable  s    zTestUnicode.test_isprintablec                 C   .   dd }t |}dg}| || ||  d S )Nc                 S   s   | d d  S r#   r   r   r   r   r   r     r6   z0TestUnicode.test_pointless_slice.<locals>.pyfuncr   r  r   r  r   r   r  r   r   r   test_pointless_slice     z TestUnicode.test_pointless_slicec                 C   r  )Nc                 S      | d d d S )Nr  r   r  r   r   r   r     rT   z/TestUnicode.test_walk_backwards.<locals>.pyfuncr   r  r  r   r   r   test_walk_backwards  r  zTestUnicode.test_walk_backwardsc                 C   r  )Nc                 S   r  Nr  r   r  r   r   r   r     rT   z-TestUnicode.test_stride_slice.<locals>.pyfuncr   r  r  r   r   r   test_stride_slice  r  zTestUnicode.test_stride_slicec                 C   0   dd }t |}ddg}| || ||  d S )Nc                 S   r?   r#   r   r   r   r   r   r   r     r*   z)TestUnicode.test_basic_lt.<locals>.pyfuncr   r   r  r  r   r   r   test_basic_lt     zTestUnicode.test_basic_ltc                 C   r  )Nc                 S   rB   r#   r   r  r   r   r   r     r*   z)TestUnicode.test_basic_gt.<locals>.pyfuncr   r   r  r  r   r   r   test_basic_gt  r  zTestUnicode.test_basic_gtc                 C   s\   dd }t |}ttddD ]\}}dD ]}|||g}| j|| || d|d qqd S )Nc                 S   sd   | 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r0||kS d S )N==!=<><=>=r   optionr%   r(   r   r   r   r     s   z+TestUnicode.test_comparison.<locals>.pyfuncr  r  r  r  r  r  r  r  r   failed on {}r&  )r   r   r  r  r(  )r   r   r   r%   r(   cmpopr  r   r   r   test_comparison   s   
zTestUnicode.test_comparisonc                 C   sH   dd }t |}dg}| || ||  dg}| || ||  d S )Nc                 S   s,   d}t | r|d |  d S | | d |  S )Nr  Zb123IOrT  r,   )r%   r  r   r   r   r     s   z/TestUnicode.test_literal_concat.<locals>.pyfuncr%   r   r  r   r   r   r  r   r   r   test_literal_concat  s   zTestUnicode.test_literal_concatc                 C   B   dd }t |}dD ]}|g}| j|| || d|d q
d S )Nc                 S   sl   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r4||kS d S )	NZa123Zaa12r  r  r  r  r  r  r   r  r   r   r   r   (  s   z3TestUnicode.test_literal_comparison.<locals>.pyfuncr  r  r&  r   r  r(  )r   r   r   r  r  r   r   r   test_literal_comparison'  s   z#TestUnicode.test_literal_comparisonc                 C   s$   dd }t |}| | |  d S )Nc                   S   s   t dS Nr  r,   r   r   r   r   r   A  r*   z,TestUnicode.test_literal_len.<locals>.pyfuncr  r   r   r   r   test_literal_len@  s   zTestUnicode.test_literal_lenc                 C   sX   dd }t |}dddtdd td dfD ]}|g}| j|| || d|d qd S )Nc                 S   s   d|  S r  r   )whichr   r   r   r   G  r*   z0TestUnicode.test_literal_getitem.<locals>.pyfuncr  r   r   r  r&  )r   r  r  r(  r   r   r   r   r  r   r   r   test_literal_getitemF  s   z TestUnicode.test_literal_getitemc                 C   r  )Nc                 S   s   | dv S )NZ
9876zabiuhr   r$   r   r   r   r   P  r*   z+TestUnicode.test_literal_in.<locals>.pyfunc)r   9r  r   Z8uhaZ987r  r&  r  r  r   r   r   test_literal_inO     zTestUnicode.test_literal_inc                 C   sD   dd }t |}tdddD ]}| j|| || d|d qd S )Nc                 S   s   d | d|fS )Nr  Zcde)rq   rt   r'   r   r   r   r   Z     z0TestUnicode.test_literal_xyzwith.<locals>.pyfuncr  r  r  r  r&  )r   r   r  r(  r  r   r   r   test_literal_xyzwithY  s   z TestUnicode.test_literal_xyzwithc                 C   r  )Nc                 S   s   d | |  dfS )Nr  r   rI   r$   r   r   r   r   c  r  z-TestUnicode.test_literal_find.<locals>.pyfunc)r   r  r&  r  r  r   r   r   test_literal_findb  r  zTestUnicode.test_literal_findc                 C   B   dd }t |}tD ]}|g}| j|| || d|d q
d S )Nc                 S   s   |  S r#   r   r$   r   r   r   r   m  s   z$TestUnicode.test_not.<locals>.pyfuncr  r&  rh  r  r   r   r   test_notl  r  zTestUnicode.test_notc                 C   \   dd }t |}g d}dg}d}tdg | | D ]}| j||||||d qd S )Nc                 S   rv   r#   )
capitalizer$   r   r   r   r   w  r*   z+TestUnicode.test_capitalize.<locals>.pyfunc)	   𐑏   𐑏𐑏   𐐧𐑏   𐑏𐐧
   X𐐧x𐑏u   hİu   ῒİu   ﬁnnish   AͅΣ   𐀀􀀀z*Results of "{}".capitalize() must be equalr   r&  rh  ri  r   r   r   test_capitalizev  s    zTestUnicode.test_capitalizec           	      C   s~   dd }t |}dd tD }g d}g d}dd |D }t| | | | D ]}|g}| j|| || d|d	 q(d S )
Nc                 S   rv   r#   )isupperr$   r   r   r   r     r*   z(TestUnicode.test_isupper.<locals>.pyfuncc                 S   r  r   upperr  r   r   r   r    r  z,TestUnicode.test_isupper.<locals>.<listcomp>ZAA12AZaa12au   大AA12Au   大aa12au   AAAǄAu	   A 1 1 大u   Ⅷ   ⅷrx  ry  rz  r{  r|  r}  c                 S      g | ]}|d  qS r  r   r  r   r   r   r    r  r  r&  rh  )	r   r   r   Zuppersrb  rj  Zfourxcpyr   r  r   r   r   test_isupper  s   zTestUnicode.test_isupperc                 C   r  )Nc                 S   rv   r#   r  r$   r   r   r   r     r*   z&TestUnicode.test_upper.<locals>.pyfuncr  r&  rh  r  r   r   r   
test_upper  r  zTestUnicode.test_upperc                 C   r  )Nc                 S   rv   r#   )casefoldr$   r   r   r   r     r*   z)TestUnicode.test_casefold.<locals>.pyfunc)r=  ZhELlo   ß   ﬁ   Σr  rb  r  z(Results of "{}".casefold() must be equalr   r&  rh  ri  r   r   r   test_casefold  s    zTestUnicode.test_casefoldc                 C   ^   dd }t |}g d}g d}d}tdg | | D ]}| j||||||d qd S )Nc                 S   rv   r#   )isalphar$   r   r   r   r     r*   z(TestUnicode.test_isalpha.<locals>.pyfunc)r  rx  ry  rz  r{  r|  r}  rf  z'Results of "{}".isalpha() must be equalr   r&  rh  r   r   r   rj  rb  r'  r   r   r   r   test_isalpha      zTestUnicode.test_isalphac                 C   r  )Nc                 S   rv   r#   )r   r$   r   r   r   r     r*   z(TestUnicode.test_isascii.<locals>.pyfunc)r    z       ér   z'Results of "{}".isascii() must be equalr&  rh  r  r   r   r   test_isascii  s    zTestUnicode.test_isasciic                 C   sN   t }t|}g d}d}tdg | D ]}| j||||||d q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(  r  r   r   r   
test_title  s    zTestUnicode.test_titlec                 C   r  )Nc                 S   rv   r#   )swapcaser$   r   r   r   r     r*   z)TestUnicode.test_swapcase.<locals>.pyfunc)r  ry  r  r  r  r  r     İr     ͅΣr     AͅΣar  u   AΣͅ   Σͅ r  r  u   ῒr  z(Results of "{}".swapcase() must be equalr   r&  rh  ri  r   r   r   test_swapcase  s    zTestUnicode.test_swapcasec                 C   s~   t }t|}dd tD }g d}g d}|dd |D 7 }d}t| dg | | D ]}| j||||||d q+d S )	Nc                 S   r  r   r   r  r   r   r   r    r  z,TestUnicode.test_islower.<locals>.<listcomp>r  r  c                 S   r  r  r   r  r   r   r   r    r  z'Results of "{}".islower() must be equalr   r&  )r   r   r  r  r(  )r   r   r   Zlowersrb  rj  r'  r   r   r   r   test_islower  s    zTestUnicode.test_islowerc                 C   r  )Nc                 S   rv   r#   )isalnumr$   r   r   r   r   	  r*   z(TestUnicode.test_isalnum.<locals>.pyfunc)rx  ry  rz  r{     𝟶   𑁦   𐒠   🄇rf  z'Results of "{}".isalnum() must be equalr   r&  rh  r  r   r   r   test_isalnum	  r  zTestUnicode.test_isalnumc           	      C   st   t }t|}g d}g d}g d}d}|| d}tdg | | | D ]}| j||||||d q&d S )Nr  )rx  ry  r{  r}  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(  )	r   r   r   rb  rj  sigmaZextra_sigmar'  r   r   r   r   
test_lower	  s   
 zTestUnicode.test_lowerc                 C   r^  )Nc                 S   rv   r#   )	isnumericr$   r   r   r   r   /	  r*   z*TestUnicode.test_isnumeric.<locals>.pyfunc)r   r   re     ①   ¼   ٠
01234567890123456789arx  ry  rz  r{  r|  r}     𑁥r  r  r  r  rf  z)Results of "{}".isnumeric() must be equalr   r&  rh  ri  r   r   r   test_isnumeric.	      zTestUnicode.test_isnumericc                 C   r^  )Nc                 S   rv   r#   )isdigitr$   r   r   r   r   B	  r*   z(TestUnicode.test_isdigit.<locals>.pyfunc)r  r  r  rx  ry  rz  r{  r|  r}  r  r  r  r  r  rf  z'Results of "{}".isdigit() must be equalr   r&  rh  ri  r   r   r   test_isdigitA	  r  zTestUnicode.test_isdigitc                 C   r^  )Nc                 S   rv   r#   )	isdecimalr$   r   r   r   r   U	  r*   z*TestUnicode.test_isdecimal.<locals>.pyfunc)r   r   re  r  r  r  r  r  rx  ry  rz  r{  r|  r}  r  r  r  r  r  rf  z)Results of "{}".isdecimal() must be equalr   r&  rh  ri  r   r   r   test_isdecimalT	  r  zTestUnicode.test_isdecimalc              	   C   sP   t }t|}g d}|D ]\}}}| ||||||||d|||f  qd S )N
)r  r   A)r   rs  r  )ru  rs  r  )r   rs  r  )rx  rs  r  )rz  r   r  )rz  r   r  )rz  r   r  )rz  r   r  )rz  r   r  z'%s'.replace('%s', '%s')?)rc   r   r  )r   r   r   r  r#  old_strnew_strr   r   r   test_replaceg	  s   
zTestUnicode.test_replacec           	      C   sh   t }t|}g d}g d}|D ]!\}}}|D ]}| ||||||||||d||||f  qqd S )Nr  )r  r   r   r  z'%s'.replace('%s', '%s', '%s')?)re   r   r  )	r   r   r   r  Z
count_testr#  r  r  rX   r   r   r   test_replace_with_count~	  s   
z#TestUnicode.test_replace_with_countc                 C   s   dd }t |}| t}|dddd W d    n1 sw   Y  d}| |t|j | t}|dddd	 W d    n1 sFw   Y  d
}| |t|j | t}|dddd	 W d    n1 smw   Y  d
}| |t|j d S )Nc                 S   rP   r#   ra   rd   r   r   r   r   	  rT   z4TestUnicode.test_replace_unsupported.<locals>.pyfuncZ
abababababbaZqqqg      @z7Unsupported parameters. The parameters must be Integer.r   rE  z!The object must be a UnicodeType.)r   r5  r
   r6  r7  r8  )r   r   r   r:  r'  r   r   r   test_replace_unsupported	  s"   z$TestUnicode.test_replace_unsupportedN)~r   r   r   r  r   r  r  r  r  r  r  r  r   r!  r"  r+  r1  r;  rL  rP  rR  rT  rV  rW  rY  rZ  r]  r_  r`  rd  rn  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;  rA  rC  rE  rF  rG  rH  rI  rJ  rL  rM  rS  rU  rX  r[  r\  r]  rk  rv  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     s    



	
	J$	
	


r   c                   @   <   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd ZdS )TestUnicodeInTuplec                 C   @   t dd }| | |  t dd }| | |  d S )Nc                   S      ddk S )N)r   bbr   r   r   r   r   r
  	     z9TestUnicodeInTuple.test_const_unicode_in_tuple.<locals>.fc                   S   r  )N)ccr  r   r   r   r   r   r
  	  r  r   r  r  r   r
  r   r   r   test_const_unicode_in_tuple	  s   

z.TestUnicodeInTuple.test_const_unicode_in_tuplec                 C   r  )Nc                   S   r  )Nr   r   )r  r   r   r   r   r   r   r
  	  r  z@TestUnicodeInTuple.test_const_unicode_in_hetero_tuple.<locals>.fc                   S   r  )Nr
  )r   r  r   r   r   r   r   r
  	  r  r  r  r   r   r   "test_const_unicode_in_hetero_tuple	  s   

z5TestUnicodeInTuple.test_const_unicode_in_hetero_tuplec                 C   s.   t dd }tD ]}| ||t| qd S )Nc                 S   s   | j S r#   r  r   r   r   r   r
  	  s   z3TestUnicodeInTuple.test_ascii_flag_unbox.<locals>.f)r   r  r  r   r  r   r   r   test_ascii_flag_unbox	  s
   
z(TestUnicodeInTuple.test_ascii_flag_unboxc                 C      t dd }| | d d S )Nc                  S   sL   d} d}d}d}d | |gjd | |gjd | |gjd ||gjfS )Nr  rT  r   r    ,)r   r	  s1s2Zs3Zs4r   r   r   r
  	  s   z2TestUnicodeInTuple.test_ascii_flag_join.<locals>.f)r   r   r   r   r  r  r   r   r   test_ascii_flag_join	  s   

z'TestUnicodeInTuple.test_ascii_flag_joinc                 C   r  )Nc                  S   s4   d} d}| d j | dd  j |d j |dd  j fS )NZabc123u   🐍⚡🐍⚡🐍⚡r   r  r  )r  r  r   r   r   r
  	  s
   z5TestUnicodeInTuple.test_ascii_flag_getitem.<locals>.f)r   r   r   r   r  r  r   r   r   test_ascii_flag_getitem	  s   
z*TestUnicodeInTuple.test_ascii_flag_getitemc                 C   r  )Nc                  S   s<   d} d}d}d}| | j | | j || j | d j |d j fS )Nr  rT  r   r    r  r  r  r   r   r   r
  	  s   z5TestUnicodeInTuple.test_ascii_flag_add_mul.<locals>.f)r   r   r   r   r   r  r  r   r   r   test_ascii_flag_add_mul	  s   
z*TestUnicodeInTuple.test_ascii_flag_add_mulN)	r   r   r   r	  r  r  r  r  r  r   r   r   r   r   	  s    
r   c                   @   s4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )TestUnicodeIterationc                 C   .   t }t|}tD ]}| |||| qd S r#   )r   r   r  r   r   r   r   r   r   r   r   test_unicode_iter	  r	  z&TestUnicodeIteration.test_unicode_iterc                 C   s    t }t|}| | |  d S r#   )r   r   r   r   r   r   r   test_unicode_literal_iter
  r  z.TestUnicodeIteration.test_unicode_literal_iterc                 C   r  r#   )r   r   r  r   r  r   r   r   test_unicode_enumerate_iter
  r	  z0TestUnicodeIteration.test_unicode_enumerate_iterc              
   C   sb   |    t}t|}||fD ] }tD ]}| t || W d    n1 s(w   Y  qqd S r#   )rh  r   r   r  r5  StopIteration)r   r   r   r
  r   r   r   r   test_unicode_stopiteration_iter
  s   
z4TestUnicodeIteration.test_unicode_stopiteration_iterc              	   C   sN   t }t|}||fD ]}| t |  W d    n1 sw   Y  q
d S r#   )r   r   r5  r  )r   r   r   r
  r   r   r   'test_unicode_literal_stopiteration_iter
  s   z<TestUnicodeIteration.test_unicode_literal_stopiteration_iterN)r   r   r   r  r  r  r  r  r   r   r   r   r  	  s    	r  c                   @   r  )TestUnicodeAuxillaryc                 C   s8   t }t|}tD ]}|D ]}| |||| qqd S r#   )r   r   r  r   )r   r   r   exr   r   r   r   test_ord!
  s   zTestUnicodeAuxillary.test_ordc              
   C   s   |    t}t|}||fD ])}dD ]$}| t}|| W d    n1 s(w   Y  | dt|j qq| t}|d W d    n1 sLw   Y  | t	t|j d S )N)r   r  zord() expected a charactergGz?)
rh  r   r   r5  	TypeErrorr6  r7  r8  r
   r   )r   r   r   rm  chr:  r   r   r   test_ord_invalid(
  s    

z%TestUnicodeAuxillary.test_ord_invalidc                 C   sb   t }t|}tD ]}|D ]}t|}| |||| qqdtfD ]}| |||| q"d S )Nr   )r   r   r  r   r   r   )r   r   r   r  r%   r   r   r   r   test_chr;
  s   zTestUnicodeAuxillary.test_chrc              
   C   s   t }t|}||fD ]-}dtd fD ]$}| t}|| W d    n1 s(w   Y  | dt|j qq
| t}|d W d    n1 sLw   Y  | t	t|j d S )NrD  r   zchr() arg not in ranger  )
r   r   r   r5  ri  r6  r7  r8  r
   r   )r   r   r   rm  vr:  r   r   r   test_chr_invalidF
  s   

z%TestUnicodeAuxillary.test_chr_invalidc                    sZ   dd  t  dd }t fdd}d}| |||| | tjtjjj	 d S )Nc                 S   r   )NTr   r$   r   r   r   barX
  r"   z7TestUnicodeAuxillary.test_unicode_type_mro.<locals>.barc                    s,   d t | tjrt | tjrd  fddS )NFTc                    s    S r#   r   r$   okr   r   <lambda>a
  s    zLTestUnicodeAuxillary.test_unicode_type_mro.<locals>.ol_bar.<locals>.<lambda>)
isinstancer   rj  Hashabler$   r   r(  r   ol_bar[
  s
   z:TestUnicodeAuxillary.test_unicode_type_mro.<locals>.ol_barc                    s    | S r#   r   )Zstrinstr'  r   r   r  c
  r  z7TestUnicodeAuxillary.test_unicode_type_mro.<locals>.foor  )
r   r   r  r  r6  r   r,  r  r   __mro__)r   r-  r  instr   r.  r   test_unicode_type_mroV
  s   
z*TestUnicodeAuxillary.test_unicode_type_mroc                 C   sB  dd }dd }dd }dd }d	d
 }|  |dt|d |  |dt|d |  |dt|d ddg}t||}dt| d}|  || ttf}	| |	}
t|ddg W d   n1 slw   Y  tdv rd}| |t|
j	 ntdv rd}| |t|
j	 nt
t|  | t|  dS )z@test f-string support, which requires bytecode handling
        c                 S   s   d| d  dS )NZAA_rE  Z_Br   r  r   r   r   impl1o
  s   z2TestUnicodeAuxillary.test_f_strings.<locals>.impl1c                 S   s
   | d  S r  r   r  r   r   r   impl2s
  r:   z2TestUnicodeAuxillary.test_f_strings.<locals>.impl2c                 S   s
   d|  S )NABC_r   r  r   r   r   impl3w
  r:   z2TestUnicodeAuxillary.test_f_strings.<locals>.impl3c                 S   s   d| dS )Nr4  re  r   r  r   r   r   impl4{
  r6   z2TestUnicodeAuxillary.test_f_strings.<locals>.impl4c                   S   s    S r#   r   r   r   r   r   impl5
  r"   z2TestUnicodeAuxillary.test_f_strings.<locals>.impl5rE  r  ZDEr  BzABC_<object type:r  N))rE  r+  z,Use of unsupported opcode (FORMAT_WITH_SPEC)))rE  r  )rE  r*  )rE  r  z*format spec in f-strings not supported yet)r  r   r   r   r   r5  r   r6  r7  r8  NotImplementedError)r   r2  r3  r5  r6  r7  Zlist_arggotexpectedZunsupported_errorsr:  r'  r   r   r   test_f_stringsk
  s0   z#TestUnicodeAuxillary.test_f_stringsN)	r   r   r   r   r#  r$  r&  r1  r<  r   r   r   r   r  
  s    r  __main__)t	itertoolsr   r   Znumbar   r   Z
numba.corer   ZunittestZnumba.tests.supportr   r   r	   Znumba.core.errorsr
   r   r   Znumba.cpython.unicoder   Znumba.core.types.functionsr   Znumba.extendingr   Znumba.core.utilsr   r   r!   r&   r)   r.   r0   r3   r5   r9   r;   r<   r=   r>   r@   rA   rC   rD   rH   rK   rO   rS   rV   rY   rZ   r[   r^   r_   r`   rc   re   rh   ri   rj   rm   rn   ro   rr   ru   ry   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   mainr   r   r   r   <module>   s   	
$                M$
}