a
    
d                    @   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 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'd/d0 Z(d1d2 Z)d3d4 Z*d5d6 Z+d7d8 Z,d9d: Z-d;d< Z.d=d> Z/d?d@ Z0dAdB Z1dCdD Z2dEdF Z3dGdH Z4dIdJ Z5dKdL Z6dMdN Z7dOdP Z8dQdR Z9dSdT Z:dUdV Z;dWdX Z<dYdZ Z=d[d\ Z>d]d^ Z?d_d` Z@dadb ZAdcdd ZBdedf ZCdgdh ZDdidj ZEdkdl ZFdmdn ZGdodp ZHdqdr ZIdsdt ZJdudv ZKdwdx ZLdydz ZMd{d| ZNd}d~ ZOdd ZPdd 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 )    )product)permutations)njittypeof)typesN)TestCaseno_pyobj_flagsMemoryLeakMixin)TypingErrorUnsupportedError)_MAX_UNICODE)_header_lead)overloadc                 C   s   t dd | D S )Nc                 s   s   | ]}t |d k V  qdS )   Nord).0c r   a/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/numba/tests/test_unicode.py	<genexpr>       zisascii.<locals>.<genexpr>)allsr   r   r   isascii   s    r   c                   C   s   dS N   大处着眼，小处着手。r   r   r   r   r   literal_usecase   s    r   c                 C   s   | S Nr   xr   r   r   passthrough_usecase   s    r"   c                 C   s   | |kS r   r   r!   yr   r   r   
eq_usecase   s    r%   c                 C   s   t | S r   lenr    r   r   r   len_usecase   s    r(   c                 C   s   t | S r   )boolr    r   r   r   bool_usecase#   s    r*   c                 C   s   | | S r   r   r!   ir   r   r   getitem_usecase'   s    r-   c                 C   s   t | | S r   )hashr+   r   r   r   getitem_check_kind_usecase+   s    r/   c                 C   s
   |  |S r   )zfillr#   r   r   r   zfill_usecase/   s    r1   c                 C   s   | | S r   r   r#   r   r   r   concat_usecase3   s    r2   c                 C   s   | | S r   r   r#   r   r   r   repeat_usecase7   s    r3   c                 C   s   | |7 } | S r   r   r#   r   r   r   inplace_concat_usecase;   s    r4   c                 C   s   | |v S r   r   r#   r   r   r   
in_usecase@   s    r5   c                 C   s   | |k S r   r   r#   r   r   r   
lt_usecaseD   s    r6   c                 C   s   | |kS r   r   r#   r   r   r   
le_usecaseH   s    r7   c                 C   s   | |kS r   r   r#   r   r   r   
gt_usecaseL   s    r8   c                 C   s   | |kS r   r   r#   r   r   r   
ge_usecaseP   s    r9   c                 C   s
   |  |S r   )	partitionr   sepr   r   r   partition_usecaseT   s    r=   c                 C   s
   |  |S r   findr#   r   r   r   find_usecaseX   s    r@   c                 C   s   |  ||S r   r>   r!   r$   startr   r   r   find_with_start_only_usecase\   s    rC   c                 C   s   |  |||S r   r>   r!   r$   rB   endr   r   r   find_with_start_end_usecase`   s    rF   c                 C   s
   |  |S r   )
rpartitionr;   r   r   r   rpartition_usecased   s    rH   c                 C   s
   |  |S r   countr#   r   r   r   count_usecaseh   s    rK   c                 C   s   |  ||S r   rI   rA   r   r   r   count_with_start_usecasel   s    rL   c                 C   s   |  |||S r   rI   rD   r   r   r   count_with_start_end_usecasep   s    rM   c                 C   s
   |  |S r   rfindr#   r   r   r   rfind_usecaset   s    rP   c                 C   s   |  ||S r   rN   rA   r   r   r   rfind_with_start_only_usecasex   s    rQ   c                 C   s   |  |||S r   rN   rD   r   r   r   rfind_with_start_end_usecase|   s    rR   c                 C   s   |  ||S r   replace)r   r!   r$   r   r   r   replace_usecase   s    rU   c                 C   s   |  |||S r   rS   r   r!   r$   rJ   r   r   r   replace_with_count_usecase   s    rW   c                 C   s
   |  |S r   rindexr#   r   r   r   rindex_usecase   s    rZ   c                 C   s   |  ||S r   rX   rA   r   r   r   rindex_with_start_only_usecase   s    r[   c                 C   s   |  |||S r   rX   rD   r   r   r   rindex_with_start_end_usecase   s    r\   c                 C   s
   |  |S r   indexr#   r   r   r   index_usecase   s    r_   c                 C   s   |  ||S r   r]   rA   r   r   r   index_with_start_only_usecase   s    r`   c                 C   s   |  |||S r   r]   rD   r   r   r   index_with_start_end_usecase   s    ra   c                 C   s
   |  |S r   
startswithr#   r   r   r   startswith_usecase   s    rd   c                 C   s
   |  |S r   endswithr#   r   r   r   endswith_usecase   s    rg   c                 C   s   |   S r   
expandtabsr   r   r   r   expandtabs_usecase   s    rj   c                 C   s
   |  |S r   rh   r   tabsizer   r   r   expandtabs_with_tabsize_usecase   s    rm   c                 C   s   | j |dS )N)rl   rh   rk   r   r   r   %expandtabs_with_tabsize_kwarg_usecase   s    rn   c                 C   s   |  ||S r   rb   rA   r   r   r   "startswith_with_start_only_usecase   s    ro   c                 C   s   |  |||S r   rb   rD   r   r   r   !startswith_with_start_end_usecase   s    rp   c                 C   s   |  ||S r   re   rA   r   r   r    endswith_with_start_only_usecase   s    rq   c                 C   s   |  |||S r   re   rD   r   r   r   endswith_with_start_end_usecase   s    rr   c                 C   s
   |  |S r   splitr#   r   r   r   split_usecase   s    ru   c                 C   s   |  ||S r   rs   r!   r$   maxsplitr   r   r   split_with_maxsplit_usecase   s    rx   c                 C   s   | j ||dS N)rw   rs   rv   r   r   r   !split_with_maxsplit_kwarg_usecase   s    rz   c                 C   s   |   S r   rs   r    r   r   r   split_whitespace_usecase   s    r{   c                 C   s   |   S r   
splitlinesr   r   r   r   splitlines_usecase   s    r~   c                 C   s
   |  |S r   r|   r   keependsr   r   r    splitlines_with_keepends_usecase   s    r   c                 C   s   | j |dS )N)r   r|   r   r   r   r   &splitlines_with_keepends_kwarg_usecase   s    r   c                 C   s
   |  |S r   rsplitr;   r   r   r   rsplit_usecase   s    r   c                 C   s   |  ||S r   r   r   r<   rw   r   r   r   rsplit_with_maxsplit_usecase   s    r   c                 C   s   | j ||dS ry   r   r   r   r   r   "rsplit_with_maxsplit_kwarg_usecase   s    r   c                 C   s   |   S r   r   r   r   r   r   rsplit_whitespace_usecase   s    r   c                 C   s   |   S r   lstripr    r   r   r   lstrip_usecase   s    r   c                 C   s
   |  |S r   r   r!   charsr   r   r   lstrip_usecase_chars   s    r   c                 C   s   |   S r   rstripr    r   r   r   rstrip_usecase   s    r   c                 C   s
   |  |S r   r   r   r   r   r   rstrip_usecase_chars   s    r   c                 C   s   |   S r   stripr    r   r   r   strip_usecase   s    r   c                 C   s
   |  |S r   r   r   r   r   r   strip_usecase_chars  s    r   c                 C   s
   |  |S r   )joinr#   r   r   r   join_usecase  s    r   c                 C   s   dg}|   | |S )N )popr   )r!   lr   r   r   join_empty_usecase  s    r   c                 C   s
   |  |S r   centerr#   r   r   r   center_usecase  s    r   c                 C   s   |  ||S r   r   r!   r$   fillcharr   r   r   center_usecase_fillchar  s    r   c                 C   s
   |  |S r   ljustr#   r   r   r   ljust_usecase  s    r   c                 C   s   |  ||S r   r   r   r   r   r   ljust_usecase_fillchar  s    r   c                 C   s
   |  |S r   rjustr#   r   r   r   rjust_usecase#  s    r   c                 C   s   |  ||S r   r   r   r   r   r   rjust_usecase_fillchar'  s    r   c                 C   s   |   S r   )istitler    r   r   r   istitle_usecase+  s    r   c                 C   s   g }| D ]}| | q|S r   append)r!   r   r,   r   r   r   iter_usecase/  s    r   c                 C   s   |   S r   titler    r   r   r   r   6  s    r   c                  C   s   g } dD ]}|  | q| S r   r   )r   r,   r   r   r   literal_iter_usecase:  s    r   c                 C   s2   d}d}t | D ]\}}||7 }|d7 }q||fS )Nr   r      )	enumerate)r!   bufscanr,   r   r   r   r   enumerated_iter_usecaseA  s    
r   c                 C   s.   t | }t| }t|d D ]}t| qd S )Nr   )r'   iterrangenext)r!   nr,   _r   r   r   iter_stopiteration_usecaseJ  s    r   c                  C   s2   d} t | }t| }t|d D ]}t| q d S )Nr   r   )r   r'   r   r   )r   r,   r   r   r   r   r   "literal_iter_stopiteration_usecaseQ  s
    r   c                 C   s   |   S r   )islowerr    r   r   r   islower_usecaseY  s    r   c                 C   s   |   S r   lowerr    r   r   r   lower_usecase]  s    r   c                 C   s   t | S r   r   r    r   r   r   ord_usecasea  s    r   c                 C   s   t | S r   )chrr    r   r   r   chr_usecasee  s    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   j  s    zBaseTest.setUp)__name__
__module____qualname__r   __classcell__r   r   r   r   r   i  s   r   )r   ascii12345
1234567890   ¡Y tú quién te crees?   🐍⚡r   )r   aaar   bZaababZ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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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 }| j||d d S )N)flags)r   Zrun_nullary_func)r   r   pyfuncr   r   r   test_literal  s    zTestUnicode.test_literalc                 C   s.   t }t|}tD ]}| |||| qd S r   )r"   r   UNICODE_EXAMPLESassertEqualr   r   r   cfuncr   r   r   r   test_passthrough  s    zTestUnicode.test_passthroughc              	   C   s   t }t|}tD ]x}ttD ]j}| ||||||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   s8   | dkrd}nd }|dk r d}nd }||kr0dS 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 ]T\}}| ||||||d|j||f  | ||||||d|j||f  qHd 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   s   |  t d S r   )r  r6   r   r   r   r   r   test_lt  s    zTestUnicode.test_ltc                 C   s   |  t d S r   )r  r7   r  r   r   r   test_le  s    zTestUnicode.test_lec                 C   s   |  t d S r   )r  r8   r  r   r   r   test_gt  s    zTestUnicode.test_gtc                 C   s   |  t d S r   )r  r9   r  r   r   r   test_ge  s    zTestUnicode.test_gec                 C   s.   t }t|}tD ]}| |||| qd S r   )r(   r   r   r   r   r   r   r   test_len  s    zTestUnicode.test_lenc                 C   s.   t }t|}tD ]}| |||| qd S r   )r*   r   r   r   r   r   r   r   	test_bool  s    zTestUnicode.test_boolc                 C   sD   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)rj   r   r   formatr   r   r   casesr  r   r   r   r   test_expandtabs  s    zTestUnicode.test_expandtabsc              
   C   sx   t tt tg}ddg}g d}|D ]N}tddD ]>}t||D ].\}}| j|||||||||d q@q2q$d S )Nz,Results of "{}".expandtabs({}) must be equalz4Results of "{}".expandtabs(tabsize={}) must be equalr
  r   r   r  )r   rm   rn   r   zipr   r   r  )r   fnsmessagesr  r   rl   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@0    Y  d|}| |t	|j
 d S )Nr  333333@z"tabsize" must be {}, not float)rm   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 ]R}dd|d d |dd  ||| g}|| | D ]}| |||||| q`q,d S )	Nhello
helloworldr   
her"  r#  Zellor   Zlowolor%  r&  ohellohellohellor   r   r!      rd   r   r   r   )	r   r   r   cpython_strcpython_subs
extra_subsr   default_subsprefixr   r   r   test_startswith_default2  s    $z#TestUnicode.test_startswith_defaultc           
   
   C   s   t }t|}g d}g d}ddg}|t D ]p}dd|d d |dd  ||| g}|| | D ]:}ttd	d
d g D ] }	| ||||	||||	 qxq`q,d S Nr!  r$  r(  r   r   r!   r)  r*  r   )ro   r   r   listr   r   )
r   r   r   r,  r-  r.  r   r/  r0  rB   r   r   r   test_startswith_with_startA  s    $
z&TestUnicode.test_startswith_with_startc                 C   s   t }t|}g d}g d}ddg}|t D ]}dd|d d |dd  ||| g}|| | D ]X}ttd	d
d g D ]>}	ttd	d
d g D ]$}
| ||||	|
||||	|
 qqxq`q,d S r2  rp   r   r   r4  r   r   )r   r   r   r,  r-  r.  r   r/  r0  rB   rE   r   r   r   test_startswith_with_start_endR  s    $z*TestUnicode.test_startswith_with_start_endc                 C   s   d}|  t|" tt}|dd W d    n1 s80    Y  d}|  t|$ tt}|ddd W d    n1 s|0    Y  d}|  t|& tt}|dddd	 W d    n1 s0    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   rd   ro   rp   )r   Zmsg_invalid_prefixr   Zmsg_invalid_startZmsg_invalid_endr   r   r   &test_startswith_exception_invalid_argsd  s    (*z2TestUnicode.test_startswith_exception_invalid_argsc           
      C   s   t }t|}g d}g d}ddg}|t D ]Z}dd|d d |dd  ||| g}|| | D ]$}|d	f}	| |||	|||	 q`q,d S )
Nr!  r$  r(  r   r   r!   r)  r*  r&  r+  )
r   r   r   r,  r-  r.  r   r/  sub_strr0  r   r   r   test_startswith_tuplew  s    $z!TestUnicode.test_startswith_tuplec                 C   s   t }t|}g d}g d}ddg}|t D ]}dd|d d |dd  ||| g}|| | D ]`}ttd	d
d g D ]F}	ttd	d
d g D ],}
|df}| ||||	|
||||	|
 qqxq`q,d S )Nr!  r$  r(  r   r   r!   r)  r*  r3  r   r&  r6  )r   r   r   r,  r-  r.  r   r/  r:  rB   rE   r0  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 ]b}dd|d d |dd  ||| g}|| | D ],}d	}	| j|||||||	||d
 q`q,d S )Nr!  r$  r(  r   r   r!   r)  r*  z)Results "{}".endswith("{}") must be equalr  rg   r   r   r   r  )
r   r   r   r,  r-  r.  r   r/  r:  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 ]}dd|d d |dd  ||| g}|| | D ]L}ttd	d
d g D ]2}	d}
| j||||	||||	|
|||	d qxq`q,d S )Nr!  r$  r(  r   r   r!   r)  r*  r3  r   z-Results "{}".endswith("{}", {}) must be equalr  )rq   r   r   r4  r   r   r  )r   r   r   r,  r-  r.  r   r/  r:  rB   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 ]}dd|d d |dd  ||| g}|| | D ]l}ttd	d
d g D ]R}	ttd	d
d g D ]8}
d}| j||||	|
||||	|
||||	|
d qqxq`q,d S )Nr!  r$  r(  r   r   r!   r)  r*  r3  r   OResults "{}".endswith("{}", {}, {})                               must be equalr  rr   r   r   r4  r   r   r  )r   r   r   r,  r-  r.  r   r/  r:  rB   rE   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 ]j}dd|d d |dd  ||| g}|| | D ]4}d	}	|d
f}
| j|||
|||
|	||
d q`q,d S )Nr!  r$  r(  r   r   r!   r)  r*  z'Results "{}".endswith({}) must be equalr&  r  r=  )r   r   r   r,  r-  r.  r   r/  r:  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 ]}dd|d d |dd  ||| g}|| | D ]t}ttd	d
d g D ]Z}	ttd	d
d g D ]@}
d}|df}| j||||	|
||||	|
||||	|
d qqxq`q,d S )Nr!  r$  r(  r   r   r!   r)  r*  r3  r   r@  r&  r  rA  )r   r   r   r,  r-  r.  r   r/  r:  rB   rE   r  rC  r   r   r   test_endswith_tuple_args  s$    $z$TestUnicode.test_endswith_tuple_argsc              	   C   sv   t }t|}tD ]`}dd|d d d |d d |dd  ||| g}|D ]&}| ||||||d||f  qHqd S )Nr   xxr   r)  r*  z'%s' in '%s'?)r5   r   r   r   )r   r   r   r   r   extrassubstrr   r   r   test_in  s    0
zTestUnicode.test_inc              	   C   s   |    t}t|}||fD ]J}| t}|dd W d    n1 sJ0    Y  | dt|j qtj	tj
f}| t}|dd  W d    n1 s0    Y  d|}| |t|j d S Nr   r   empty separatorz"sep" must be {}, not none)disable_leak_checkr=   r   r  
ValueErrorr  r  r  r   UnicodeTypeUnicodeCharSeqr
   r  r   r   r   funcr  r  r  r   r   r   $test_partition_exception_invalid_sep  s    ((
z0TestUnicode.test_partition_exception_invalid_sepc                 C   sN   t }t|}g d}d}|D ],\}}| j|||||||||d qd S )N	r      ⚡abcabcrU  r   rU     🐍⚡🐍rU  abababar   r\  r   r\  r   r\  r   r\  r   z-Results of "{}".partition("{}") must be equalr  )r=   r   r   r  r   r   r   CASESr  r   r<   r   r   r   test_partition$  s    
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 qq~d S )Nc              	   S   s.   g | ]&}|d d|dd |dd |gfqS r   rF  Nr)  r*  r   r   r   r   r   r   
<listcomp><  s   z)TestUnicode.test_find.<locals>.<listcomp>uf   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaĂr   u   ȁu   Ġu   Ƞuh   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa􀌄   􀌄u   􀈄u   􂀄   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂar     􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄a  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄Ăr   daaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)r   ri  r   u   a􀌄   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂri  u   Ă􀌄   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂa_a_  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄a_  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄Ă_   Ă_z%Results "{}".find("{}") must be equalr  )r@   r   r   r   r  )
r   r   r   r   r/  r-  r   subsr:  r  r   r   r   	test_find8  s,    




zTestUnicode.test_findc                 C   s   t }t|}tD ]p}dd|d d |dd  |fD ]L}ttddd g D ]2}d}| j||||||||||||d qJq2qd S )	Nr   rF  r)  r*  r3  r   z)Results "{}".find("{}", {}) must be equalr  )rC   r   r   r4  r   r   r  r   r   r   r   r:  rB   r  r   r   r   test_find_with_start_onlyT  s    "
z%TestUnicode.test_find_with_start_onlyc           
      C   s   t }t|}ttddd g  }}tD ]p}dd|d d |dd  |fD ]L}t||D ]<\}}d}	| j|||||||||||	||||d qXqJq(d S )	Nr3  r   r   rF  r)  r*  z0Results of "{}".find("{}", {}, {}) must be equalr  )rF   r   r4  r   r   r   r   r  
r   r   r   startsendsr   r:  rB   rE   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 ]`\}}}| t}|dd|| W d    n1 sT0    Y  d||}| |t	|j
 qd S N))皙?   rB   )r         ?rE   r   Zsciz"{}" must be {}, not float)rF   r   r   r  NoneTyper  r
   r  r  r  r  )	r   r   r   acceptedrB   rE   namer  r  r   r   r   (test_find_exception_noninteger_start_endm  s    ,z4TestUnicode.test_find_exception_noninteger_start_endc              	   C   s   |    t}t|}||fD ]J}| t}|dd W d    n1 sJ0    Y  | dt|j qtj	tj
f}| t}|dd  W d    n1 s0    Y  d|}| |t|j d S rJ  )rL  rH   r   r  rM  r  r  r  r   rN  rO  r
   r  rP  r   r   r   %test_rpartition_exception_invalid_sepx  s    ((
z1TestUnicode.test_rpartition_exception_invalid_sepc                 C   sN   t }t|}g d}d}|D ],\}}| j|||||||||d qd S )NrS  z.Results of "{}".rpartition("{}") must be equalr  )rH   r   r   r  ra  r   r   r   test_rpartition  s    
zTestUnicode.test_rpartitionc                 C   sP   t }t|}d}tD ]6\}}|||}|||}| ||||||| qd S )Nz6'{0}'.py_count('{1}') = {2}
'{0}'.c_count('{1}') = {3})rK   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 ]8}||||}||||}| |||||||| q*|||d }|||d }| |||||d || qd S )N%s
%s)z '{0}'.py_count('{1}', {2}) = {3}z'{0}'.c_count('{1}', {2}) = {4}   )rL   r   r  r   r   r  )	r   r   r   r  r   r  r,   r  r  r   r   r   test_count_with_start  s&    z!TestUnicode.test_count_with_startc           
      C   s   t }t|}dd }tD ]\}}ttdddD ]B\}}|||||}|||||}	| ||	|||||||	 q0t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  )rM   r   r  r   r   r   r  )
r   r   r   r  r   r  r,   jr  r  r   r   r   test_count_with_start_end  s6    z%TestUnicode.test_count_with_start_endc                 C   s   t t}| t}|dddd W d    n1 s60    Y  | dt|j | t}|dddd W d    n1 s0    Y  | dt|j | t}|dddd W d    n1 s0    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   rM   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>0    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  s    

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      )rM   r  r
   r  r  r  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 qqd S )Nc              	   S   s.   g | ]&}|d d|dd |dd |gfqS rd  r   re  r   r   r   rf    s   z*TestUnicode.test_rfind.<locals>.<listcomp>uf   Ăaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaarg  uh   􀌄aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaarh  abcdefghiabcabcr      aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂr     a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄  Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄r   rm  )r   ri  u   Ăau   􀌄arn  ri  u   􀌄Ă   _aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂ_a  _a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄  _Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄   _Ăz&Results "{}".rfind("{}") must be equalr  )rP   r   r   r   r  	r   r   r   r/  r-  r   rt  r:  r  r   r   r   
test_rfind  s.    





zTestUnicode.test_rfindc                 C   s   t }t|}tD ]p}dd|d d |dd  |fD ]L}ttddd g D ]2}d}| j||||||||||||d qJq2qd S )	Nr   rF  r)  r*  r3  r   z*Results "{}".rfind("{}", {}) must be equalr  )rQ   r   r   r4  r   r   r  rv  r   r   r   test_rfind_with_start_only$  s    "
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 ]p}dd|d d |dd  |fD ]L}t||D ]<\}}d}	| j|||||||||||	||||d qhqZq8d S )	Nr3  r   r   rF  r)  r*  z1Results of "{}".rfind("{}", {}, {}) must be equalr  )rR   r   r4  r   r   r   r   r  rx  r   r   r   test_rfind_with_start_end0  s    "z%TestUnicode.test_rfind_with_start_endc              
   C   sr   t t}tD ]`}dD ]V}| t}||| W d    n1 sB0    Y  dtj}| |t	|j
 qqd S )N)Nr   F
must be {})r   rP   r   r  r
   r  r   rN  r  r  r  )r   r   r   r:  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 ]}tddgddgD ]\\}}| t}||||| W d    n1 s0    Y  d		|}| 
|t|j qRtddgd
dgD ]\\}}| t}||||| W d    n1 s0    Y  d	|}| 
|t|j qq<qd S )Nr   rF  r)  r*  r}  Fr   r   z"start" must be {}gTz"end" must be {})r   rR   r   r  r  r   r   r  r
   r  r  r  r  )	r   r   r  r   r:  rB   rE   r  r  r   r   r   test_rfind_wrong_start_endH  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 s`0    Y  | |t|j	 dd	 }| t}|||dd W d    n1 s0    Y  | |t|j	 d S )
Nr   r   r   r  c                  W   s6   t t jt jt t jt t j}t|gt d S r   )r   r  r  r  r  intpr   rR   r  Zwrong_sig_optionalr   r   r    try_compile_wrong_start_optionalb  s    

zYTestUnicode.test_rfind_wrong_start_end_optional.<locals>.try_compile_wrong_start_optionalr}  c                  W   s6   t t jt jt t jt t j}t|gt d S r   )r   r  r  r  r  r  r   rR   r  r   r   r   try_compile_wrong_end_optionalm  s    

zWTestUnicode.test_rfind_wrong_start_end_optional.<locals>.try_compile_wrong_end_optional)
r   r   r  r  r  r  r
   r  r  r  )r   r   r:  r  r  r  r  r  r   r   r   #test_rfind_wrong_start_end_optional\  s    
,,z/TestUnicode.test_rfind_wrong_start_end_optionalc           	   	   C   s   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 qlq`d S )Nc                 S   s,   g | ]$}|d |dd |dd |gfqS r   Nr)  r*  r   re  r   r   r   rf  |  s   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  )rZ   r   r   r   r  r  r   r   r   test_rindexx  s&    
	
zTestUnicode.test_rindexc           	   	   C   s   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 qlq`d S )Nc                 S   s,   g | ]$}|d |dd |dd |gfqS r  r   re  r   r   r   rf    s   z*TestUnicode.test_index.<locals>.<listcomp>r  r  rj  r   rk  rl  r   ro  rp  rq  rr  rs  z&Results "{}".index("{}") must be equalr  )r_   r   r   r   r  r  r   r   r   
test_index  s&    
	
zTestUnicode.test_indexc                 C   s  t tg}ddg}g d}t||D ]\}}t|}|D ]}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 ]B\}
}|d g D ].}| j|||
||||
||||
|d qqq6q"d S )Nz*Results "{}".index("{}", {}) must be equalz+Results "{}".rindex("{}", {}) must be equalr   r   r   r   r   r   r   r)  r   r*     r  )	r`   r[   r  r   r'   r4  r   r   r  )r   pyfuncsr  unicode_examplesr   r  r   r   r   r  r:  ry  rB   r   r   r   !test_index_rindex_with_start_only  s,    "(
z-TestUnicode.test_index_rindex_with_start_onlyc                 C   s^  t tg}ddg}g d}t||D ]4\}}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 ]V\}
}}t|d g |D ]:\}}| j|||
|||||
|||	||
||d qqq8q"d S )Nz1Results of "{}".index("{}", {}, {}) must be equalz2Results of "{}".rindex("{}", {}, {}) must be equalr  r   r  r   r   r)  r   r   r   r*  r  r  )
ra   r\   r  r   r'   r4  r   r   r   r  )r   r  r  r  r   r  r   r   r   r  r:  ry  rz  rB   rE   r   r   r    test_index_rindex_with_start_end  s0    
  "&z,TestUnicode.test_index_rindex_with_start_endc                 C   s*  |    g d}ttg}|D ]}t|}|D ]}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 ]z\}}	}
t|	|
D ]d\}}||fD ]R}| t	}||||| W d    n1 s0    Y  d
}| 
|t|j qqqq.qd S )Nr  r   r   r   r)  r   r   r*  r  zsubstring not found)rL  ra   r\   r   r'   r4  r   r   r  rM  r  r  r  )r   r  r  r   r   r   r   r  r:  ry  rz  rB   rE   rQ  r  r  r   r   r   /test_index_rindex_exception_substring_not_found  s&    
,z;TestUnicode.test_index_rindex_exception_substring_not_foundc           
   
   C   s   t jt jf}ttg}|D ]r}t|}dD ]`\}}}| t}|dd|| W d    n1 s`0    Y  d||}	| 	|	t
|j q(qd S r|  )r   r  r  ra   r\   r   r  r
   r  r  r  r  )
r   r  r  r   r   rB   rE   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]?)r-   r   r   r   r'   r   )r   r   r   r   r,   r   r   r   test_getitem	  s    
zTestUnicode.test_getitemc              	   C   s^   t }t|}ddg}|D ]@}tt| t|D ]&}| ||||||d||f  q0qd S )Nu   aሴu   ¡着r  )r/   r   r   r'   r   )r   r   r   samplesr   r,   r   r   r   test_getitem_scalar_kind  s    
z$TestUnicode.test_getitem_scalar_kindc              	   C   s   |    t}t|}tD ]}| t}||t| W d    n1 sJ0    Y  | dt|j	 | t}||t| W d    n1 s0    Y  | dt|j	 qd S )Nzstring index out of range)
rL  r-   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 ]n}ttt| t|D ]P}ttt| t|D ]2}t||}| ||||||d|||f  qHq,qd S )N'%s'[%d:%d]?)r-   r   r   r4  r   r'   slicer   r   r   r   r   r,   r  slr   r   r   test_slice2/  s    
zTestUnicode.test_slice2c                 C   s   t }t|}tD ]n}ddt|t|d fD ]P}ddt|t|d fD ]2}t||}| ||||||d|||f  qHq,qd S )Nr)  r   r   r  r-   r   r   r'   r  r   r  r   r   r   test_slice2_error;  s    
zTestUnicode.test_slice2_errorc                 C   s   t }t|}ddg}|D ]z}dddddt|t|d fD ]V}dddddt|t|d fD ]2}t||}| ||||||d|||f  q\q:qd S )	N	   abcሴሴu   ¡¡¡着着着r)  r   r   r   r   r  )r/   r   r'   r  r   )r   r   r   r  r   r,   r  r  r   r   r   test_getitem_slice2_kindG  s    ""
z$TestUnicode.test_getitem_slice2_kindc                 C   s   t }t|}tD ]t}tt| t|D ]Z}tt| t|D ]@}dD ]6}t|||}| ||||||d||||f  qHq@q(qd S )Nr)  r   r   r   '%s'[%d:%d:%d]?)r-   r   r   r   r'   r  r   r   r   r   r   r,   r  kr  r   r   r   test_slice3U  s    zTestUnicode.test_slice3c           	      C   s   t }t|}g d}|D ]t}tt| t|D ]Z}tt| t|D ]@}dD ]6}t|||}| ||||||d||||f  qPqHq0qd S )N)r  u   aሴbሴc¡¡¡着着着u   ¡着¡着¡着u   着a着b着cu   ¡着a¡着b¡着cu   ¡着a着¡cr  r  )r/   r   r   r'   r  r   )	r   r   r   r  r   r,   r  r  r  r   r   r   test_getitem_slice3_kindb  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 ]6}t|||}| ||||||d||||f  qPqHq,qd S )Nr)  r   r   r  r  r  r  r   r   r   test_slice3_errorw  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 sB0    Y  | dt|j |D ],}tddD ]}| |||||| qpqbd 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   )	r1   r   r  r
   r  r  r  r   r   )r   r   r   ZZFILL_INPUTSr  r   widthr   r   r   
test_zfill  s    ,zTestUnicode.test_zfillc              	   C   sP   t }t|}tD ]:}td d d D ]&}| ||||||d||f  q"qd S Nr   z'%s' + '%s'?)r2   r   r   r   r   r   r   r   test_concat  s    
zTestUnicode.test_concatc                 C   sT   t }t|}tD ]>}dD ]4}| |||||| | |||||| qqd S )N)r   r   r   r   r*  r  r~  r  r     F   )r3   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:0    Y  | td t|j d S )Nhig      @z" Function(<built-in function mul>))	rL  r   r3   r  r
   r  r   r  r  r  r   r   r   test_repeat_exception_float  s    (
z'TestUnicode.test_repeat_exception_floatc              	   C   sl   |    t}t|}||fD ]J}| t}|dd W d    n1 sJ0    Y  | dt|j qd S Nr   r   rK  )rL  ru   r   r  rM  r  r  r  r   r   r   rQ  r  r   r   r   test_split_exception_empty_sep  s    (z*TestUnicode.test_split_exception_empty_sepc              	   C   sh   t }t|}dD ]R}| t}|d|d W d    n1 s@0    Y  | dt|jd|  qd S )Nr   Nr   r  r  z"non-integer maxsplit with sep = %s)rx   r   r  r
   r  r  r  )r   r   r   r<   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 NrT  rV  rX  rY  r[  r]  r^  r_  r`  z'%s'.split('%s')?)ru   r   r   )r   r   r   rb  test_strsplitterr   r   r   
test_split  s    
zTestUnicode.test_splitc              
   C   sf   g d}t dftdffD ]H\}}t|}|D ]2\}}}| ||||||||||||f  q,qd S )N
)r  Nr   )r   rU  r   )rW  rU  r   )r   rU  r   )rZ  rU  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)?)rx   rz   r   r   )r   rb  r   Zfmt_strr   r  r  rw   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  rW     🐍 ⚡   🐍 ⚡ 🐍   🐍   ⚡ 🐍       🐍   ⚡ 🐍    🐍
   ⚡ 🐍  z'%s'.split()?)r{   r   r   mapr   r   )r   r   r   all_whitespacerb  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 ]Z\}}| t}|d| W d    n1 sR0    Y  d	||}| 
|t|j q d S )N))noneN)r  None
z"keepends" must be {}, not {})r   r   r   r  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   sD   t }t|}g d}d}|D ]"}| j||||||d qd S )Nr   r  z
abcabc
u   🐍⚡u   🐍⚡🐍u    aba babaz

abcz*Results of "{}".splitlines() must be equalr  )r~   r   r   r  r  r   r   r   test_splitlines8  s    zTestUnicode.test_splitlinesc           
   	   C   sx   t tg}ddg}g d}g d}t||D ]H\}}t|}t||D ],\}}	| j|||	|||	|||	d qDq*d S )Nz,Results of "{}".splitlines({}) must be equalz5Results of "{}".splitlines(keepends={}) must be equalr  )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_keependsC  s    
z)TestUnicode.test_splitlines_with_keependsc              	   C   sl   |    t}t|}||fD ]J}| t}|dd W d    n1 sJ0    Y  | dt|j qd S r  )rL  r   r   r  rM  r  r  r  r  r   r   r   test_rsplit_exception_empty_sepV  s    (z+TestUnicode.test_rsplit_exception_empty_sepc              	   C   sv   t }t|}tjtf}dD ]V}| t}|d|d W d    n1 sJ0    Y  d|}| |t	|j
 qd S )Nr  r   r  z "maxsplit" must be {}, not float)r   r   r   r  r  r  r
   r  r  r  r  )r   r   r   r  r<   r  r  r   r   r   )test_rsplit_exception_noninteger_maxsplitb  s    
*
z5TestUnicode.test_rsplit_exception_noninteger_maxsplitc                 C   sN   t }t|}g d}d}|D ],\}}| j|||||||||d qd S )Nr  z*Results of "{}".rsplit("{}") must be equalr  )r   r   r   r  ra  r   r   r   test_rsplitm  s    
zTestUnicode.test_rsplitc           
   
   C   sr   t tg}g d}ddg}t||D ]J\}}t|}|D ]4\}}}	| j||||	||||	||||	d q6q"d S )Nr  z.Results of "{}".rsplit("{}", {}) must be equalz7Results of "{}".rsplit("{}", maxsplit={}) must be equalr  )r   r   r  r   r   r  )
r   r  rb  r  r   r  r   r  r<   rw   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 ] }| |||||| qBd S )Nr   r  rW  r  r  r  r  r	  r
  z&Results of "{}".rsplit() must be equal)r   r   r   r  r   r   r  )r   r   r   r  rb  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   rb  r<   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:0    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  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   r     ⚡⚡r~  '%s'.join('%s')?r   r   r   r   r   r   rb  r<   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)r  r   r!  r"  r#  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 ]\}}t|}| t}|td d W d    n1 sT0    Y  | dt|j	 tD ]8}t
ddD ](}| ||||||d	|||f  qqtq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 ]\}}t|}dD ]}| t }|td d| W d    n1 s^0    Y  | dt|j	 tD ]>}t
dd	D ].}| ||||||||d
||||f  qq~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	  s(    .
z'TestUnicode.test_justification_fillcharc              
   C   s   |    tttfD ]}t|}dD ]P}| t }|td d| W d    n1 sV0    Y  | dt	|j
 q"dD ]P}| t }|td d| W d    n1 s0    Y  | dt	|j
 qxq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)rL  r   r   r   r   r  rM  r   r  r  r  r
   )r   r   r   r   r  r   r   r   %test_justification_fillchar_exception  s$    ..z1TestUnicode.test_justification_fillchar_exceptionc              	   C   sP   t }t|}tD ]:}td d d D ]&}| ||||||d||f  q"qd S r  )r4   r   r   r   r   r   r   r   test_inplace_concat4  s    
zTestUnicode.test_inplace_concatc                 C   s^   dd }t |}g d}g d}d}tdg | | D ]"}| j||||||d q6d S )Nc                 S   s   |   S r   )isidentifierr   r   r   r   r   >  s    z-TestUnicode.test_isidentifier.<locals>.pyfunc)r   Zr   Zb0Z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=  s    zTestUnicode.test_isidentifierc                    sP  g d}t dftdftdffD ]<\ }t }|D ]&\}}|  |||d||f  q2qtdftdftdffD ]\ }t }t	tj	t
tj	}t|g } fdd}||fD ]J}	| t}
|	dd	 W d    n1 s0    Y  | d
t|
j q||fD ]:}	|D ].\}}|  |||	||d|||f  qqqrd S )N))ass ciiZai)r<  N)Z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   )rA  Nr   )    大处大处  r   )z	
abcd	z	a)rB  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   ZSTRIP_CASESr)  r   stringr   Zsig1r  r  r  r  r   r  r   
test_stripN  sF    "


(zTestUnicode.test_stripc                 C   s^   dd }t |}g d}g d}d}tdg | | D ]"}| j||||||d q6d S )Nc                 S   s   |   S r   )isspacer   r   r   r   r     s    z(TestUnicode.test_isspace.<locals>.pyfunc)	u    u    u   —   𐐁   𐐧   𐐩   𐑎   🐍   👯r6  z'Results of "{}".isspace() must be equalr   r  r8  r9  r   r   r   test_isspace  s    zTestUnicode.test_isspacec           
   
   C   sh   t }t|}d}dd tD }g d}t| | }|D ],}||}||}	| ||	||||	 q6d S )Nz0'{0}'.py_istitle() = {1}
'{0}'.c_istitle() = {2}c                 S   s   g | ]}|  qS r   r   r   r!   r   r   r   rf    r   z,TestUnicode.test_istitle.<locals>.<listcomp>)r   z    z  AA  z  Ab  1ZA123ZA12Bcdz+abAZ12AbcZA12abcu   %^Abc 5 $% Def𐐁𐐩u   𐐧𐑎rI  rJ  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   sL   dd }t |}g d}d}t| D ]"}| j||||||d q$d S )Nc                 S   s   |   S r   )isprintabler   r   r   r   r     s    z,TestUnicode.test_isprintable.<locals>.pyfunc)	r   r   abcdefgzabcdefg
u   ʹu   ͸r7  rL  u   󠀠z+Results of "{}".isprintable() must be equalr  r8  r   r   r   r:  r  r   r   r   r   test_isprintable  s    zTestUnicode.test_isprintablec                 C   s.   dd }t |}dg}| || ||  d S )Nc                 S   s   | d d  S r   r   r   r   r   r   r     s    z0TestUnicode.test_pointless_slice.<locals>.pyfuncr   r  r   r   r   r   r  r   r   r   test_pointless_slice  s    z TestUnicode.test_pointless_slicec                 C   s.   dd }t |}dg}| || ||  d S )Nc                 S   s   | d d d S )Nr   r   rV  r   r   r   r     s    z/TestUnicode.test_walk_backwards.<locals>.pyfuncr   r  rW  r   r   r   test_walk_backwards  s    zTestUnicode.test_walk_backwardsc                 C   s.   dd }t |}dg}| || ||  d S )Nc                 S   s   | d d d S Nr   r   rV  r   r   r   r     s    z-TestUnicode.test_stride_slice.<locals>.pyfuncr   r  rW  r   r   r   test_stride_slice  s    zTestUnicode.test_stride_slicec                 C   s0   dd }t |}ddg}| || ||  d S )Nc                 S   s   | |k S r   r   r   r   r   r   r   r     s    z)TestUnicode.test_basic_lt.<locals>.pyfuncr   r   r  rW  r   r   r   test_basic_lt  s    zTestUnicode.test_basic_ltc                 C   s0   dd }t |}ddg}| || ||  d S )Nc                 S   s   | |kS r   r   r\  r   r   r   r     s    z)TestUnicode.test_basic_gt.<locals>.pyfuncr   r   r  rW  r   r   r   test_basic_gt  s    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   sh   | dkr||kS | dkr ||kS | dkr0||k S | dkr@||kS | dkrP||kS | dkr`||kS d S d S )N==!=<><=>=r   optionr!   r$   r   r   r   r     s    z+TestUnicode.test_comparison.<locals>.pyfuncr   r   r_  r`  ra  rb  rc  rd  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   s0   d}t | r|d |  d S | | d |  S d S )Nr  Z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   sB   dd }t |}dD ](}|g}| j|| || d|d qd S )Nc                 S   sp   d}d}| dkr||kS | dkr(||kS | dkr8||k S | dkrH||kS | dkrX||kS | dkrh||kS d S d S )	NZa123Zaa12r_  r`  ra  rb  rc  rd  r   re  r   r   r   r   %  s    z3TestUnicode.test_literal_comparison.<locals>.pyfuncrg  rh  r  r   r   r  )r   r   r   ri  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   >  s    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 rp  r   )whichr   r   r   r   D  s    z0TestUnicode.test_literal_getitem.<locals>.pyfuncr   r   r   rh  r  )r   r  r   r  r   r   r   r   r  r   r   r   test_literal_getitemC  s    z TestUnicode.test_literal_getitemc                 C   sB   dd }t |}dD ](}|g}| j|| || d|d qd S )Nc                 S   s   | dv S )NZ
9876zabiuhr   r    r   r   r   r   M  s    z+TestUnicode.test_literal_in.<locals>.pyfunc)r   9rO  r   Z8uhaZ987rh  r  rn  rt  r   r   r   test_literal_inL  s    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)rc   rf   r#   r   r   r   r   W  s    z0TestUnicode.test_literal_xyzwith.<locals>.pyfuncrS  r   r   rh  r  )r   r   r   r  rl  r   r   r   test_literal_xyzwithV  s    z TestUnicode.test_literal_xyzwithc                 C   sB   dd }t |}dD ](}|g}| j|| || d|d qd S )Nc                 S   s   d | |  dfS )Nr  r   r>   r    r   r   r   r   `  s    z-TestUnicode.test_literal_find.<locals>.pyfunc)r   rh  r  rn  rt  r   r   r   test_literal_find_  s    zTestUnicode.test_literal_findc                 C   sB   dd }t |}tD ](}|g}| j|| || d|d qd S )Nc                 S   s   |  S r   r   r    r   r   r   r   j  s    z$TestUnicode.test_not.<locals>.pyfuncrh  r  r8  rt  r   r   r   test_noti  s    zTestUnicode.test_notc                 C   s\   dd }t |}g d}dg}d}tdg | | D ]"}| j||||||d q4d S )Nc                 S   s   |   S r   )
capitalizer    r   r   r   r   t  s    z+TestUnicode.test_capitalize.<locals>.pyfunc)	   𐑏   𐑏𐑏   𐐧𐑏   𐑏𐐧
   X𐐧x𐑏u   hİu   ῒİu   ﬁnnish   AͅΣ   𐀀􀀀z*Results of "{}".capitalize() must be equalr   r  r8  r9  r   r   r   test_capitalizes  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	 qPd S )
Nc                 S   s   |   S r   )isupperr    r   r   r   r     s    z(TestUnicode.test_isupper.<locals>.pyfuncc                 S   s   g | ]}|  qS r   upperrN  r   r   r   rf    r   z,TestUnicode.test_isupper.<locals>.<listcomp>ZAA12AZaa12au   大AA12Au   大aa12au   AAAǄAu	   A 1 1 大u   Ⅷ   ⅷrG  rH  rI  rJ  rK  rL  c                 S   s   g | ]}|d  qS r  r   rN  r   r   r   rf    r   rh  r  r8  )	r   r   r   ZuppersrG  r:  Zfourxcpyr   r  r   r   r   test_isupper  s    zTestUnicode.test_isupperc                 C   sB   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_upper.<locals>.pyfuncrh  r  r8  rt  r   r   r   
test_upper  s    zTestUnicode.test_upperc                 C   s\   dd }t |}g d}dg}d}tdg | | D ]"}| j||||||d q4d S )Nc                 S   s   |   S r   )casefoldr    r   r   r   r     s    z)TestUnicode.test_casefold.<locals>.pyfunc)r"  ZhELlo   ß   ﬁ   Σr  r2  r  z(Results of "{}".casefold() must be equalr   r  r8  r9  r   r   r   test_casefold  s    zTestUnicode.test_casefoldc                 C   s^   dd }t |}g d}g d}d}tdg | | D ]"}| j||||||d q6d S )Nc                 S   s   |   S r   )isalphar    r   r   r   r     s    z(TestUnicode.test_isalpha.<locals>.pyfunc)rP  rG  rH  rI  rJ  rK  rL  r6  z'Results of "{}".isalpha() must be equalr   r  r8  r   r   r   r:  rG  r  r   r   r   r   test_isalpha  s    zTestUnicode.test_isalphac                 C   sL   dd }t |}g d}d}t| D ]"}| j||||||d q$d S )Nc                 S   s   |   S r   )r   r    r   r   r   r     s    z(TestUnicode.test_isascii.<locals>.pyfunc)r    z       ér   z'Results of "{}".isascii() must be equalr  r8  rT  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  rT  r   r   r   
test_title  s    zTestUnicode.test_titlec                 C   s\   dd }t |}g d}dg}d}tdg | | D ]"}| j||||||d q4d S )Nc                 S   s   |   S r   )swapcaser    r   r   r   r     s    z)TestUnicode.test_swapcase.<locals>.pyfunc)r|  rH  r}  r~  r  r  r     İr     ͅΣr     AͅΣar  u   AΣͅ   Σͅ r  r  u   ῒr  z(Results of "{}".swapcase() must be equalr   r  r8  r9  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 qVd S )	Nc                 S   s   g | ]}|  qS r   r   rN  r   r   r   rf    r   z,TestUnicode.test_islower.<locals>.<listcomp>r  r  c                 S   s   g | ]}|d  qS r  r   rN  r   r   r   rf    r   z'Results of "{}".islower() must be equalr   r  )r   r   r   r   r  )r   r   r   ZlowersrG  r:  r  r   r   r   r   test_islower  s    zTestUnicode.test_islowerc                 C   s^   dd }t |}g d}g d}d}tdg | | D ]"}| j||||||d q6d S )Nc                 S   s   |   S r   )isalnumr    r   r   r   r   	  s    z(TestUnicode.test_isalnum.<locals>.pyfunc)rG  rH  rI  rJ     𝟶   𑁦   𐒠   🄇r6  z'Results of "{}".isalnum() must be equalr   r  r8  r  r   r   r   test_isalnum	  s    zTestUnicode.test_isalnumc           	      C   st   t }t|}g d}g d}g d}d}|| d}tdg | | | D ]"}| j||||||d qLd S )Nr  )rG  rH  rJ  rL  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   rG  r:  sigmaZextra_sigmar  r   r   r   r   
test_lower	  s    
zTestUnicode.test_lowerc                 C   s^   dd }t |}g d}g d}d}tdg | | D ]"}| j||||||d q6d S )Nc                 S   s   |   S r   )	isnumericr    r   r   r   r   ,	  s    z*TestUnicode.test_isnumeric.<locals>.pyfunc)r   r   r5     ①   ¼   ٠
01234567890123456789arG  rH  rI  rJ  rK  rL     𑁥r  r  r  r  r6  z)Results of "{}".isnumeric() must be equalr   r  r8  r9  r   r   r   test_isnumeric+	  s    zTestUnicode.test_isnumericc                 C   s^   dd }t |}g d}g d}d}tdg | | D ]"}| j||||||d q6d S )Nc                 S   s   |   S r   )isdigitr    r   r   r   r   ?	  s    z(TestUnicode.test_isdigit.<locals>.pyfunc)r  r  r  rG  rH  rI  rJ  rK  rL  r  r  r  r  r  r6  z'Results of "{}".isdigit() must be equalr   r  r8  r9  r   r   r   test_isdigit>	  s    zTestUnicode.test_isdigitc                 C   s^   dd }t |}g d}g d}d}tdg | | D ]"}| j||||||d q6d S )Nc                 S   s   |   S r   )	isdecimalr    r   r   r   r   R	  s    z*TestUnicode.test_isdecimal.<locals>.pyfunc)r   r   r5  r  r  r  r  r  rG  rH  rI  rJ  rK  rL  r  r  r  r  r  r6  z)Results of "{}".isdecimal() must be equalr   r  r8  r9  r   r   r   test_isdecimalQ	  s    zTestUnicode.test_isdecimalc              	   C   sP   t }t|}g d}|D ]2\}}}| ||||||||d|||f  qd S )N
)r  r   A)r   rU  r  )rW  rU  r  )r   rU  r  )rZ  rU  r  )r\  r   r  )r\  r   r  )r\  r   r  )r\  r   r  )r\  r   r  z'%s'.replace('%s', '%s')?)rU   r   r   )r   r   r   rb  r  old_strnew_strr   r   r   test_replaced	  s    
zTestUnicode.test_replacec           	      C   sh   t }t|}g d}g d}|D ]B\}}}|D ]2}| ||||||||||d||||f  q.q d S )Nr  )r   r   r   r~  z'%s'.replace('%s', '%s', '%s')?)rW   r   r   )	r   r   r   rb  Z
count_testr  r  r  rJ   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>0    Y  d}| |t|j | t}|dddd	 W d    n1 s0    Y  d
}| |t|j | t}|dddd	 W d    n1 s0    Y  d
}| |t|j d S )Nc                 S   s   |  |||S r   rS   rV   r   r   r   r   	  s    z4TestUnicode.test_replace_unsupported.<locals>.pyfuncZ
abababababbaZ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	  r  r  r   r1  r5  r7  r9  r;  r<  r>  r?  rB  rD  rE  rI  rR  rc  ru  rw  r{  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r%  r'  r*  r-  r.  r/  r;  rE  rM  rQ  rU  rX  rY  r[  r]  r^  rj  rm  ro  rr  ru  rw  rx  ry  rz  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                   @   s<   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   s@   t dd }| | |  t dd }| | |  d S )Nc                   S   s   ddk S )N)r   bbr   r   r   r   r   r  	  s    z9TestUnicodeInTuple.test_const_unicode_in_tuple.<locals>.fc                   S   s   ddk S )N)ccr  r   r   r   r   r   r  	  s    r   r   r   r   r  r   r   r   test_const_unicode_in_tuple	  s    

z.TestUnicodeInTuple.test_const_unicode_in_tuplec                 C   s@   t dd }| | |  t dd }| | |  d S )Nc                   S   s   ddk S )Nr   r   )r  r   r   r   r   r   r   r  	  s    z@TestUnicodeInTuple.test_const_unicode_in_hetero_tuple.<locals>.fc                   S   s   ddk S )Nr  )r   r   r   r   r   r   r   r  	  s    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   s   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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   s   t dd }| | d d S )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   s   t dd }| | d d S )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  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   s.   t }t|}tD ]}| |||| qd S r   )r   r   r   assertPreciseEqualr   r   r   r   r   r   r   test_unicode_iter	  s    z&TestUnicodeIteration.test_unicode_iterc                 C   s    t }t|}| | |  d S r   )r   r   r  rq  r   r   r   test_unicode_literal_iter 
  s    z.TestUnicodeIteration.test_unicode_literal_iterc                 C   s.   t }t|}tD ]}| |||| qd S r   )r   r   r   r  r  r   r   r   test_unicode_enumerate_iter
  s    z0TestUnicodeIteration.test_unicode_enumerate_iterc              
   C   sb   |    t}t|}||fD ]@}tD ]6}| t || W d    q$1 sP0    Y  q$qd S r   )rL  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 ]4}| t |  W d    q1 s>0    Y  qd S r   )r   r   r  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                   @   s<   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd ZdS )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 ]R}dD ]H}| t}|| W d    n1 sP0    Y  | dt|j q$q| t}|d W d    n1 s0    Y  | t	t|j d S )N)r   r  zord() expected a charactergGz?)
rL  r   r   r  	TypeErrorr  r  r  r
   r   )r   r   r   rQ  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 ]}| |||| qDd S )Nr   )r   r   r   r   r  r   )r   r   r   r  r!   r   r   r   r   test_chr8
  s    zTestUnicodeAuxillary.test_chrc              
   C   s   t }t|}||fD ]Z}dtd fD ]H}| t}|| W d    n1 sP0    Y  | dt|j q$q| t}|d W d    n1 s0    Y  | t	t|j d S )Nr)  r   zchr() arg not in ranger  )
r   r   r   r  rM  r  r  r  r
   r   )r   r   r   rQ  vr  r   r   r   test_chr_invalidC
  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   s   dS )NTr   r    r   r   r   barU
  s    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>^
  r   zLTestUnicodeAuxillary.test_unicode_type_mro.<locals>.ol_bar.<locals>.<lambda>)
isinstancer   rN  Hashabler    r   r  r   ol_barX
  s
    z:TestUnicodeAuxillary.test_unicode_type_mro.<locals>.ol_barc                    s    | S r   r   )Zstrinstr  r   r   r   `
  s    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_mroS
  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 ddg}t||}dt| d}|  || | t }	t|ddg W d   n1 s0    Y  d}
| |
t|	j |  | t|  dS )z@test f-string support, which requires bytecode handling
        c                 S   s   d| d  dS )NZAA_r*  Z_Br   rV  r   r   r   impl1l
  s    z2TestUnicodeAuxillary.test_f_strings.<locals>.impl1c                 S   s
   | d  S rZ  r   rV  r   r   r   impl2p
  s    z2TestUnicodeAuxillary.test_f_strings.<locals>.impl2c                 S   s
   d|  S )NABC_r   rV  r   r   r   impl3t
  s    z2TestUnicodeAuxillary.test_f_strings.<locals>.impl3c                 S   s   d| dS )Nr  r5  r   rV  r   r   r   impl4x
  s    z2TestUnicodeAuxillary.test_f_strings.<locals>.impl4c                   S   s    S r   r   r   r   r   r   impl5|
  s    z2TestUnicodeAuxillary.test_f_strings.<locals>.impl5r*  r   ZDEr  BzABC_<object type:rb  Nz*format spec in f-strings not supported yet)r   r   r   r  r   r  r  r  )r   r  r  r  r  r  Zlist_arggotexpectedr  r  r   r   r   test_f_stringsh
  s"    .z#TestUnicodeAuxillary.test_f_stringsN)	r   r   r   r  r  r  r  r  r  r   r   r   r   r  
  s   r  __main__)q	itertoolsr   r   Znumbar   r   Z
numba.corer   ZunittestZnumba.tests.supportr   r   r	   Znumba.core.errorsr
   r   Znumba.cpython.unicoder   Znumba.core.types.functionsr   Znumba.extendingr   r   r   r"   r%   r(   r*   r-   r/   r1   r2   r3   r4   r5   r6   r7   r8   r9   r=   r@   rC   rF   rH   rK   rL   rM   rP   rQ   rR   rU   rW   rZ   r[   r\   r_   r`   ra   rd   rg   rj   rm   rn   ro   rp   rq   rr   ru   rx   rz   r{   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r   r  r  r  r   mainr   r   r   r   <module>   s   	
$                M$v
