o
    8ήcip                    @   s  d dl mZ d dl mZ d dlmZ d dlmZmZ d dlZd dl	m
Z
mZmZ d dlmZmZ d dlmZ d d	lmZ d d
lmZ ejdk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; Z/d<d= Z0d>d? Z1d@dA Z2dBdC Z3dDdE Z4dFdG Z5dHdI Z6dJdK Z7dLdM Z8dNdO Z9dPdQ Z:dRdS Z;dTdU Z<dVdW Z=dXdY Z>dZd[ Z?d\d] Z@d^d_ ZAd`da ZBdbdc ZCddde ZDdfdg ZEdhdi ZFdjdk ZGdldm ZHdndo ZIdpdq ZJdrds ZKdtdu ZLdvdw ZMdxdy ZNdzd{ ZOd|d} ZPd~d ZQdd 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 ZfG dd dee
Zgg dZhg dZig dZjG dd degZkG dd degZlG dd degZmG dd degZneodkrep  dS dS )    )product)permutations)njit)typesutilsN)TestCaseno_pyobj_flagsMemoryLeakMixin)TypingErrorUnsupportedError)_MAX_UNICODE)_header_lead)overload)      c                 C   s   t dd | D S )Nc                 s   s    | ]	}t |d k V  qdS )   Nord).0c r   ?/tmp/pip-target-vg8gfxp4/lib/python/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_usecase2      
r9   c                 C   s   | | S r#   r   r'   r   r   r   concat_usecase6   r*   r;   c                 C   s   | | S r#   r   r'   r   r   r   repeat_usecase:   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_usecaseC   r*   r>   c                 C      | |k S r#   r   r'   r   r   r   
lt_usecaseG   r*   r@   c                 C   s   | |kS r#   r   r'   r   r   r   
le_usecaseK   r*   rA   c                 C      | |kS r#   r   r'   r   r   r   
gt_usecaseO   r*   rC   c                 C   s   | |kS r#   r   r'   r   r   r   
ge_usecaseS   r*   rD   c                 C   r7   r#   )	partitionr   sepr   r   r   partition_usecaseW   r:   rH   c                 C   r7   r#   findr'   r   r   r   find_usecase[   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_usecasec      rS   c                 C   r7   r#   )
rpartitionrF   r   r   r   rpartition_usecaseg   r:   rV   c                 C   r7   r#   countr'   r   r   r   count_usecasek   r:   rY   c                 C   rL   r#   rW   rM   r   r   r   count_with_start_usecaseo   r6   rZ   c                 C   rP   r#   rW   rQ   r   r   r   count_with_start_end_usecases   rT   r[   c                 C   r7   r#   rfindr'   r   r   r   rfind_usecasew   r:   r^   c                 C   rL   r#   r\   rM   r   r   r   rfind_with_start_only_usecase{   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:   rq   c                 C   r7   r#   endswithr'   r   r   r   endswith_usecase   r:   rt   c                 C      |   S r#   
expandtabsr   r   r   r   expandtabs_usecase   r*   rx   c                 C   r7   r#   rv   r   tabsizer   r   r   expandtabs_with_tabsize_usecase   r:   r{   c                 C      | j |dS )N)rz   rv   ry   r   r   r   %expandtabs_with_tabsize_kwarg_usecase   r6   r}   c                 C   rL   r#   rr   rM   r   r   r    endswith_with_start_only_usecase   r6   r~   c                 C   rP   r#   rr   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   ru   r#   r   r$   r   r   r   split_whitespace_usecase   r*   r   c                 C   ru   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   ru   r#   r   r   r   r   r   rsplit_whitespace_usecase   r*   r   c                 C   ru   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   ru   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   ru   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   ru   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_usecase*     r   c                 C   ru   r#   titler$   r   r   r   r   1  r*   r   c                  C   s   g } dD ]}|  | q| S r   r   )r   r2   r   r   r   literal_iter_usecase5  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_usecase<  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_usecaseE  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_usecaseL  s   
r   c                 C   ru   r#   )islowerr$   r   r   r   islower_usecaseT  r*   r   c                 C   ru   r#   lowerr$   r   r   r   lower_usecaseX  r*   r   c                 C   r+   r#   r   r$   r   r   r   ord_usecase\  r*   r   c                 C   r+   r#   )chrr$   r   r   r   chr_usecase`  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   e  r   zBaseTest.setUp)__name__
__module____qualname__r   __classcell__r   r   r   r   r   d  s    r   )r   ascii12345
1234567890   ¡Y tú quién te crees?   🐍⚡r    )r   aaar   baababascascihr   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Ă)aabbaaaabbaaaac                   @   s  e Zd Zef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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efd+d,Zd-d. Zd/d0 Zefd1d2Zd3d4 Zd5d6 Zd7d8 Z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=efdudvZ>efdwdxZ?dydz Z@d{d| ZAd}d~ ZBdd ZCdd ZDdd ZEdd ZFdd ZGdd ZHdd ZIdd ZJdd ZKdd ZLdd ZMdd ZNdd ZOdd ZPdd ZQdd ZRdd ZSdd ZTefddZUdd ZVdd ZWdd ZXdd ZYdd ZZefddZ[efddZ\efddZ]efddZ^efddZ_dd Z`dd Zadd Zbdd Zcdd ZdddĄ ZeddƄ ZfddȄ Zgddʄ Zhdd̄ Zidd΄ ZjddЄ Zkdd҄ ZlddԄ Zmenoepdաddׄ Zqddل Zrddۄ Zsdd݄ Ztdd߄ Zudd Zvdd Zwdd Zxdd Zydd Zzdd Z{dd Z|dS )TestUnicodec                 C   s   t }| j||d d S )N)flags)r!   run_nullary_func)r   r   pyfuncr   r   r   test_literal  s   zTestUnicode.test_literalc                 C   .   t }t|}tD ]}| |||| qd S r#   )r&   r   UNICODE_EXAMPLESassertEqualr   r   r   cfuncr   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 )N%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   concrete
      r   )pred1pred2	resolved1	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   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)rx   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messagesr0  r   rz   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   f   t }t|}tD ](}dd|d d |dd  ||| fD ]}| ||||||d||f  qqd S Nr   r%   r   r	  )rq   r   r  r  r  r   r   r   test_startswith-     (
zTestUnicode.test_startswithc              	   C   rB  rC  )rt   r   r  r  r  r   r   r   test_endswith6  rF  zTestUnicode.test_endswithc           
   	   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 )Nhello
helloworldr   
herI  rJ  ellor   lowolorL  rO  ohellohellohellor   r   r%   rD  r   z)Results "{}".endswith("{}") must be equalr,  rt   r   r  r  r.  )
r   r   r  cpython_strcpython_subs
extra_subsr   default_subssub_strr-  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 )NrH  rK  rQ  r   r   r%   rD  r   r  z-Results "{}".endswith("{}", {}) must be equalr,  )r~   r   r  listr   r  r.  )r   r   r  rS  rT  rU  r   rV  rW  rN   r-  r   r   r   test_endswith_with_startR  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 )NrH  rK  rQ  r   r   r%   rD  r   rY  r  OResults "{}".endswith("{}", {}, {})                               must be equalr,  r   r   r  rZ  r   r  r.  )r   r   r  rS  rT  rU  r   rV  rW  rN   rR   r-  r   r   r   test_endswith_with_start_endg  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 )NrH  rK  rQ  r   r   r%   rD  r   z'Results "{}".endswith({}) must be equalrO  r,  rR  )r   r   r  rS  rT  rU  r   rV  rW  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 )NrH  rK  rQ  r   r   r%   rD  r   rY  r  r\  rO  r,  r]  )r   r   r  rS  rT  rU  r   rV  rW  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  r   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   r;  
ValueErrorr<  r=  r>  r   UnicodeTypeUnicodeCharSeqr
   r.  r   r   r  funcr@  r?  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      ⚡abcabcrt  r   rt     🐍⚡🐍rt  abababar   r{  r   r{  r   r{  r   r{  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   rb  NrD  r   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  rV  rT  r   subsrW  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   rb  rD  r   rY  r  z)Results "{}".find("{}", {}) must be equalr,  )rO   r   r  rZ  r   r  r.  r   r   r  r   rW  rN   r-  r   r   r   test_find_with_start_only     "
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 )	NrY  r  r   rb  rD  r   z0Results of "{}".find("{}", {}, {}) must be equalr,  )rS   r   rZ  r   r  r   r  r.  
r   r   r  startsendsr   rW  rN   rR   r-  r   r   r   test_find_with_start_end  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   sciz"{}" must be {}, not float)rS   r   r   r9  NoneTyper;  r
   r.  r<  r=  r>  )	r   r   r  acceptedrN   rR   namer@  r-  r   r   r   (test_find_exception_noninteger_start_end  s   z4TestUnicode.test_find_exception_noninteger_start_endc              	   C   rf  rg  )ri  rV   r   r;  rj  r<  r=  r>  r   rk  rl  r
   r.  rm  r   r   r   %test_rpartition_exception_invalid_sep  rp  z1TestUnicode.test_rpartition_exception_invalid_sepc                 C   rq  )Nrr  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_countB  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_startM  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_enda  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?r      z(The substring must be a UnicodeType, not)r   r[   r;  r
   r<  r=  r>  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   )args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[   r;  r
   r<  r=  r>  r   r  r  r  r   r  r.  )r   r  r@  r  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  rV  rT  r   r  rW  r-  r   r   r   
test_rfind  s2   





zTestUnicode.test_rfindc                 C   r  )	Nr   rb  rD  r   rY  r  z*Results "{}".rfind("{}", {}) must be equalr,  )r_   r   r  rZ  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 )	NrY  r  r   rb  rD  r   z1Results of "{}".rfind("{}", {}, {}) must be equalr,  )r`   r   rZ  r   r  r   r  r.  r  r   r   r   test_rfind_with_start_end  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  r;  r
   r.  r   rk  r<  r=  r>  )r   r  r   rW  r@  r-  r   r   r   test_rfind_wrong_substr  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   rb  rD  r   r  Fr  r   z"start" must be {}gTz"end" must be {})r   r`   r   r9  r  r  r   r;  r
   r.  r<  r=  r>  )	r   r  r?  r   rW  rN   rR   r@  r-  r   r   r   test_rfind_wrong_start_end  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  wrong_sig_optionalr   r   r    try_compile_wrong_start_optional  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_optional  r  zWTestUnicode.test_rfind_wrong_start_end_optional.<locals>.try_compile_wrong_end_optional)
r  r   r9  r  r.  r;  r
   r<  r=  r>  )r   r   rW  r?  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  r   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  8  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_index4  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   r      r,  )	rn   ri   r3  r   r-   rZ  r   r  r.  )r   pyfuncsr5  unicode_examplesr   r-  r  r   r   r0  rW  r  rN   r   r   r   !test_index_rindex_with_start_onlyL  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  r   r  r,  )
ro   rj   r3  r   r-   rZ  r   r   r  r.  )r   r  r5  r  r   r-  r  r   r   r0  rW  r  r  rN   rR   r   r   r    test_index_rindex_with_start_endh  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  r   r  zsubstring not found)ri  ro   rj   r   r-   rZ  r   r   r;  rj  r<  r=  r>  )r   r  r  r   r  r   r   r0  rW  r  r  rN   rR   rn  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   r9  r  ro   rj   r   r;  r
   r.  r<  r=  r>  )
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)
ri  r3   r   r  r;  
IndexErrorr-   r<  r=  r>  )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  rZ  r   r-   slicer  r   r   r  r   r2   r  slr   r   r   test_slice2     
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_kind  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_slice3  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_kind  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_error  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   r;  r
   r<  r=  r>  r   r  )r   r   r  ZFILL_INPUTSr@  r   widthr   r   r   
test_zfill4  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_concatS     
zTestUnicode.test_concatc                 C   sT   t }t|}tD ]}dD ]}| |||||| | |||||| qqd S )N)r  r   r   r  r   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>))	ri  r   r<   r;  r
   r<  r   r=  r>  r  r   r   r   test_repeat_exception_floatf  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   rh  )ri  r   r   r;  rj  r<  r=  r>  r   r   r  rn  r@  r   r   r   test_split_exception_empty_sepn     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   r8  r  z"non-integer maxsplit with sep = %s)r   r   r;  r
   r<  r=  r>  )r   r   r  rG   r@  r   r   r   (test_split_exception_noninteger_maxsplitz  s   z4TestUnicode.test_split_exception_noninteger_maxsplitc                 C   sH   t }t|}g d}|D ]\}}| ||||||d||f  qd S )N
) a Nrs  ru  rw  rx  rz  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   rt  r   )rv  rt  r   )r   rt  r   )ry  rt  r   )r{  r   r  )r{  r   r   )r{  r   r  )r{  r   r   )r{  r   r  z'%s'.split('%s', %d)?z'%s'.split('%s', maxsplit=%d)?)r   r   r   r  )r   r  r   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  rv     🐍 ⚡   🐍 ⚡ 🐍   🐍   ⚡ 🐍       🐍   ⚡ 🐍    🐍
   ⚡ 🐍  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   r9  r:  Booleanr/   r;  r
   r.  r<  r=  r>  )r   r   r  r?  tyr   r@  r-  r   r   r   %test_split_exception_invalid_keepends  s   z1TestUnicode.test_split_exception_invalid_keependsc                 C   r)  )Nr   rD  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  r2  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 equalrH  )TFr   r   r  d   r,  )r   r   r3  r   r   r  r.  )
r   r  r5  r0  all_keependsr   r-  r  r   r   r   r   r   test_splitlines_with_keepends  s    
z)TestUnicode.test_splitlines_with_keependsc              	   C   r  r   )ri  r   r   r;  rj  r<  r=  r>  r!  r   r   r   test_rsplit_exception_empty_sep  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   r8  z "maxsplit" must be {}, not float)r   r   r   r9  r:  r;  r
   r.  r<  r=  r>  )r   r   r  r?  rG   r@  r-  r   r   r   )test_rsplit_exception_noninteger_maxsplit  s   

z5TestUnicode.test_rsplit_exception_noninteger_maxsplitc                 C   rq  )Nr&  z*Results of "{}".rsplit("{}") must be equalr,  )r   r   r  r.  r  r   r   r   test_rsplit  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   r3  r   r  r.  )
r   r  r  r5  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.  rv  r9  r:  r;  r<  r=  r>  z&Results of "{}".rsplit() must be equal)r   r   r   r?  r   r  r.  )r   r   r  r@  r  r-  r   r   r   r   test_rsplit_whitespaceA  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  r   z,During: resolving callee type: BoundFunctionzreflected list(int)r   r   r;  r
   r=  r>  r<  )r   r   r  r@  exc_messager   r   r   test_join_non_string_exceptionk  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   bbbbr   rR     ⚡⚡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)rR  rW  rX  rY  rZ  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   r;  r
   r  r<  r=  r>  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  r_  r  r  z'%s'.%s(%d, '%s')?)r   r   r   r   r;  r
   r  r<  r=  r>  r   r  )r   r   r`  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)ri  r   r   r   r   r;  rj  r  r<  r=  r>  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_concat  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   ru   r#   )isidentifierr   r   r   r   r     r*   z-TestUnicode.test_isidentifier.<locals>.pyfunc)r   Zr   b0bc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  cpython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 ciiai)ry  N)assciiai )zasscii r|  )	 asscii  r|  )r}  zasci )r}  r   )z      r   )r   r   r   )r   Nr$  )
  asscii  r|  )r~  r   )r~  N)r      étú? )     tú quién te crees?   r  )u     tú qrees?   r   )r  Nr   )    大处大处  r   )z	
abcd	z	a)r  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  r;  r
   r<  r=  r>  )r   STRIP_CASESr`  r  stringr   sig1r  r  r6  r@  r   r  r   
test_strip  sP   "


zTestUnicode.test_stripc                 C   rg  )Nc                 S   ru   r#   )isspacer   r   r   r   r   =  r*   z(TestUnicode.test_isspace.<locals>.pyfunc)	u    u    u   —   𐐁   𐐧   𐐩   𐑎   🐍   👯rq  z'Results of "{}".isspace() must be equalr   r,  rs  rt  r   r   r   test_isspace<  rx  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  R      z,TestUnicode.test_istitle.<locals>.<listcomp>)r   z    z  AA  z  Ab  1A123A12Bcdz+abA12AbcA12abcu   %^Abc 5 $% Def𐐁𐐩u   𐐧𐑎r  r  u   🐍 Isu   🐍 NOTu   👯Is   ῼu   Greek ῼitlecases ...)r   r   r  r  r.  )
r   r   r  r  unicode_titlespecialISTITLE_EXAMPLESr   r  r  r   r   r   test_istitleM  s   zTestUnicode.test_istitlec                 C   L   dd }t |}g d}d}t| D ]}| j||||||d qd S )Nc                 S   ru   r#   )isprintabler   r   r   r   r   r  r*   z,TestUnicode.test_isprintable.<locals>.pyfunc)	r   r   abcdefgzabcdefg
u   ʹu   ͸rr  r  u   󠀠z+Results of "{}".isprintable() must be equalr,  rs  r   r   r  ru  r-  r   r   r   r   test_isprintableq  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  b123IOr]  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 )	Na123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     r*   z,TestUnicode.test_literal_len.<locals>.pyfuncr  r   r   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     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_getitem  s   z TestUnicode.test_literal_getitemc                 C   r  )Nc                 S   s   | dv S )N
9876zabiuhr   r$   r   r   r   r     r*   z+TestUnicode.test_literal_in.<locals>.pyfunc)r   9r  r   8uha987r  r,  r  r  r   r   r   test_literal_in     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  cde)rp   rs   r'   r   r   r   r        z0TestUnicode.test_literal_xyzwith.<locals>.pyfuncr  r  r  r  r,  )r   r   r  r.  r  r   r   r   test_literal_xyzwith  s   z TestUnicode.test_literal_xyzwithc                 C   r  )Nc                 S   s   d | |  dfS )Nr  r   rI   r$   r   r   r   r     r  z-TestUnicode.test_literal_find.<locals>.pyfunc)r   r  r,  r  r  r   r   r   test_literal_find  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     s   z$TestUnicode.test_not.<locals>.pyfuncr  r,  rs  r  r   r   r   test_not  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   ru   r#   )
capitalizer$   r   r   r   r     r*   z+TestUnicode.test_capitalize.<locals>.pyfunc)	   𐑏   𐑏𐑏   𐐧𐑏   𐑏𐐧
   X𐐧x𐑏u   hİu   ῒİu   ﬁnnish   AͅΣ   𐀀􀀀z*Results of "{}".capitalize() must be equalr   r,  rs  rt  r   r   r   test_capitalize  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   ru   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>AA12Aaa12au   大AA12Au   大aa12au   AAAǄAu	   A 1 1 大u   Ⅷ   ⅷr  r  r  r  r  r  c                 S      g | ]}|d  qS r  r   r  r   r   r   r  4  r  r  r,  rs  )	r   r   r  uppersrc  ru  fourxcpyr   r  r   r   r   test_isupper(  s   zTestUnicode.test_isupperc                 C   r  )Nc                 S   ru   r#   r  r$   r   r   r   r   <  r*   z&TestUnicode.test_upper.<locals>.pyfuncr  r,  rs  r  r   r   r   
test_upper;  r  zTestUnicode.test_upperc                 C   r  )Nc                 S   ru   r#   )casefoldr$   r   r   r   r   F  r*   z)TestUnicode.test_casefold.<locals>.pyfunc)rI  hELlo   ß   ﬁ   Σr  rm  r  z(Results of "{}".casefold() must be equalr   r,  rs  rt  r   r   r   test_casefoldE  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   ru   r#   )isalphar$   r   r   r   r   U  r*   z(TestUnicode.test_isalpha.<locals>.pyfunc)r  r  r  r  r  r  r  rq  z'Results of "{}".isalpha() must be equalr   r,  rs  r   r   r  ru  rc  r-  r   r   r   r   test_isalphaT      zTestUnicode.test_isalphaz+isascii method requires Python 3.7 or laterc                 C   r  )Nc                 S   ru   r#   )r   r$   r   r   r   r   i  r*   z(TestUnicode.test_isascii.<locals>.pyfunc)r    z       ér   z'Results of "{}".isascii() must be equalr,  rs  r  r   r   r   test_isasciif  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_titleu  s    zTestUnicode.test_titlec                 C   r  )Nc                 S   ru   r#   )swapcaser$   r   r   r   r     r*   z)TestUnicode.test_swapcase.<locals>.pyfunc)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,  rs  rt  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  lowersrc  ru  r-  r   r   r   r   test_islower  s    zTestUnicode.test_islowerc                 C   r  )Nc                 S   ru   r#   )isalnumr$   r   r   r   r     r*   z(TestUnicode.test_isalnum.<locals>.pyfunc)r  r  r  r     𝟶   𑁦   𐒠   🄇rq  z'Results of "{}".isalnum() must be equalr   r,  rs  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  )r  r  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  rc  ru  sigmaextra_sigmar-  r   r   r   r   
test_lower  s   
 zTestUnicode.test_lowerc                 C   rg  )Nc                 S   ru   r#   )	isnumericr$   r   r   r   r     r*   z*TestUnicode.test_isnumeric.<locals>.pyfunc)r   r   rp     ①   ¼   ٠
01234567890123456789ar  r  r  r  r  r     𑁥r  r	  r
  r  rq  z)Results of "{}".isnumeric() must be equalr   r,  rs  rt  r   r   r   test_isnumeric      zTestUnicode.test_isnumericc                 C   rg  )Nc                 S   ru   r#   )isdigitr$   r   r   r   r     r*   z(TestUnicode.test_isdigit.<locals>.pyfunc)r  r  r  r  r  r  r  r  r  r  r  r	  r
  r  rq  z'Results of "{}".isdigit() must be equalr   r,  rs  rt  r   r   r   test_isdigit  r  zTestUnicode.test_isdigitc                 C   rg  )Nc                 S   ru   r#   )	isdecimalr$   r   r   r   r     r*   z*TestUnicode.test_isdecimal.<locals>.pyfunc)r   r   rp  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r	  r
  rq  z)Results of "{}".isdecimal() must be equalr   r,  rs  rt  r   r   r   test_isdecimal  r  zTestUnicode.test_isdecimalc              	   C   sP   t }t|}g d}|D ]\}}}| ||||||||d|||f  qd S )N
)r  r   A)r   rt  r  )rv  rt  r  )r   rt  r  )ry  rt  r  )r{  r   r  )r{  r   r  )r{  r   r  )r{  r   r  )r{  r   r  z'%s'.replace('%s', '%s')?)rc   r   r  )r   r   r  r  r(  old_strnew_strr   r   r   test_replace
	  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  
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>.pyfunc
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>  )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(  r1  r7  rA  rE  rG  rX  r[  r^  r`  ra  re  ro  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  rG  rI  rL  rM  rN  rO  rP  rQ  rS  rU  r\  r^  ra  rd  re  rf  rw  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  unittest
skipUnless_py37_or_laterr  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  U	     z9TestUnicodeInTuple.test_const_unicode_in_tuple.<locals>.fc                   S   r.  )N)ccr/  r   r   r   r   r   r  [	  r1  r   r  r  r   r  r   r   r   test_const_unicode_in_tupleS	  s   

z.TestUnicodeInTuple.test_const_unicode_in_tuplec                 C   r-  )Nc                   S   r.  )Nr   r   )r0  r   r   r   r   r   r   r  b	  r1  z@TestUnicodeInTuple.test_const_unicode_in_hetero_tuple.<locals>.fc                   S   r.  )Nr6  )r   r  r   r   r   r   r   r  h	  r1  r3  r4  r   r   r   "test_const_unicode_in_hetero_tuplea	  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  o	  s   z3TestUnicodeInTuple.test_ascii_flag_unbox.<locals>.f)r   r  r  r   r  r   r   r   test_ascii_flag_unboxn	  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  r]  r   r    ,)r   r  s1s2s3s4r   r   r   r  w	  s   z2TestUnicodeInTuple.test_ascii_flag_join.<locals>.f)r   r   r   r   r  r4  r   r   r   test_ascii_flag_joinv	  s   

z'TestUnicodeInTuple.test_ascii_flag_joinc                 C   r9  )Nc                  S   s4   d} d}| d j | dd  j |d j |dd  j fS )Nabc123u   🐍⚡🐍⚡🐍⚡r   r  r  )r<  r=  r   r   r   r  	  s
   z5TestUnicodeInTuple.test_ascii_flag_getitem.<locals>.f)r   r   r   r   r  r4  r   r   r   test_ascii_flag_getitem	  s   
z*TestUnicodeInTuple.test_ascii_flag_getitemc                 C   r9  )Nc                  S   s<   d} d}d}d}| | j | | j || j | d j |d j fS )Nr  r]  r   r    r  r  r;  r   r   r   r  	  s   z5TestUnicodeInTuple.test_ascii_flag_add_mul.<locals>.f)r   r   r   r   r   r  r4  r   r   r   test_ascii_flag_add_mul	  s   
z*TestUnicodeInTuple.test_ascii_flag_add_mulN)	r   r   r   r5  r7  r8  r@  rB  rC  r   r   r   r   r,  Q	  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  assertPreciseEqual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   rF  r  r   r   r   test_unicode_literal_iter	  s   z.TestUnicodeIteration.test_unicode_literal_iterc                 C   rE  r#   )r   r   r  rF  rG  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#   )ri  r   r   r  r;  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   r;  rK  )r   r   r  r  r   r   r   'test_unicode_literal_stopiteration_iter	  s   z<TestUnicodeIteration.test_unicode_literal_stopiteration_iterN)r   r   r   rH  rI  rJ  rL  rM  r   r   r   r   rD  	  s    	rD  c                   @   r+  )TestUnicodeAuxillaryc                 C   s8   t }t|}tD ]}|D ]}| |||| qqd S r#   )r   r   r  rF  )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?)
ri  r   r   r;  	TypeErrorr<  r=  r>  r
   r   )r   r   r  rn  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   rF  r   )r   r   r  rO  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   r;  rj  r<  r=  r>  r
   r   )r   r   r  rn  vr@  r   r   r   test_chr_invalid	  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   bar	  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>
  s    zLTestUnicodeAuxillary.test_unicode_type_mro.<locals>.ol_bar.<locals>.<lambda>)
isinstancer   rk  Hashabler$   r   rX  r   ol_bar	  s
   z:TestUnicodeAuxillary.test_unicode_type_mro.<locals>.ol_barc                    s    | S r#   r   )strinstrW  r   r   r  
  r1  z7TestUnicodeAuxillary.test_unicode_type_mro.<locals>.foor  )
r   r   r  r  r<  r   r\  r  r   __mro__)r   r]  r  instr   r_  r   test_unicode_type_mro	  s   
z*TestUnicodeAuxillary.test_unicode_type_mroc                 C   s(  dd }dd }dd }dd }d	d
 }|  |dt|d |  |dt|d |  |dt|d | t}t|ddg W d   n1 sPw   Y  d}| |t|j | t}t|ddg W d   n1 sxw   Y  d}| |t|j |  | t|  dS )z@test f-string support, which requires bytecode handling
        c                 S   s   d| d  dS )NAA_r   _Br   r  r   r   r   impl1
  s   z2TestUnicodeAuxillary.test_f_strings.<locals>.impl1c                 S   s
   | d  S r  r   r  r   r   r   impl2
  r:   z2TestUnicodeAuxillary.test_f_strings.<locals>.impl2c                 S   s
   d|  S )NABC_r   r  r   r   r   impl3
  r:   z2TestUnicodeAuxillary.test_f_strings.<locals>.impl3c                 S   s   d| dS )Nrg  rp  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>.impl5r   r  DEr  BNz5No implementation of function Function(<class 'str'>)z*format spec in f-strings not supported yet)r  r   r;  r
   r<  r=  r>  r   )r   re  rf  rh  ri  rj  r@  r-  r   r   r   test_f_strings
  s&   z#TestUnicodeAuxillary.test_f_stringsN)	r   r   r   rP  rS  rT  rV  rb  rm  r   r   r   r   rN  	  s    rN  __main__)q	itertoolsr   r   numbar   
numba.corer   r   r(  numba.tests.supportr   r   r	   numba.core.errorsr
   r   numba.cpython.unicoder   numba.core.types.functionsr   numba.extendingr   	PYVERSIONr*  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   rq   rt   rx   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,  rD  rN  r   mainr   r   r   r   <module>   s   
	
$               8M$
t