o
    i                    @   s  d dl mZ d dl mZ d dlmZmZ d dlmZ d dlZd dl	m
Z
mZmZ d dlmZmZ 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 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   g/var/www/html/eduruby.in/lip-sync/lip-sync-env/lib/python3.10/site-packages/numba/tests/test_unicode.py	<genexpr>   s    zisascii.<locals>.<genexpr>)allsr   r   r   isascii      r   c                   C      dS N   大处着眼，小处着手。r   r   r   r   r   literal_usecase      r   c                 C   s   | S Nr   xr   r   r   passthrough_usecase   r    r$   c                 C   s   | |kS r!   r   r#   yr   r   r   
eq_usecase      r'   c                 C      t | S r!   lenr"   r   r   r   len_usecase   r(   r,   c                 C   r)   r!   )boolr"   r   r   r   bool_usecase#   r(   r.   c                 C   s   | | S r!   r   r#   ir   r   r   getitem_usecase'   r(   r1   c                 C   s   t | | S r!   )hashr/   r   r   r   getitem_check_kind_usecase+      r3   c                 C   
   |  |S r!   )zfillr%   r   r   r   zfill_usecase/      
r7   c                 C   s   | | S r!   r   r%   r   r   r   concat_usecase3   r(   r9   c                 C   s   | | S r!   r   r%   r   r   r   repeat_usecase7   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_usecase@   r(   r<   c                 C      | |k S r!   r   r%   r   r   r   
lt_usecaseD   r(   r>   c                 C   s   | |kS r!   r   r%   r   r   r   
le_usecaseH   r(   r?   c                 C      | |kS r!   r   r%   r   r   r   
gt_usecaseL   r(   rA   c                 C   s   | |kS r!   r   r%   r   r   r   
ge_usecaseP   r(   rB   c                 C   r5   r!   )	partitionr   sepr   r   r   partition_usecaseT   r8   rF   c                 C   r5   r!   findr%   r   r   r   find_usecaseX   r8   rI   c                 C      |  ||S r!   rG   r#   r&   startr   r   r   find_with_start_only_usecase\   r4   rM   c                 C      |  |||S r!   rG   r#   r&   rL   endr   r   r   find_with_start_end_usecase`      rQ   c                 C   r5   r!   )
rpartitionrD   r   r   r   rpartition_usecased   r8   rT   c                 C   r5   r!   countr%   r   r   r   count_usecaseh   r8   rW   c                 C   rJ   r!   rU   rK   r   r   r   count_with_start_usecasel   r4   rX   c                 C   rN   r!   rU   rO   r   r   r   count_with_start_end_usecasep   rR   rY   c                 C   r5   r!   rfindr%   r   r   r   rfind_usecaset   r8   r\   c                 C   rJ   r!   rZ   rK   r   r   r   rfind_with_start_only_usecasex   r4   r]   c                 C   rN   r!   rZ   rO   r   r   r   rfind_with_start_end_usecase|   rR   r^   c                 C   rJ   r!   replace)r   r#   r&   r   r   r   replace_usecase   r4   ra   c                 C   rN   r!   r_   r   r#   r&   rV   r   r   r   replace_with_count_usecase   rR   rc   c                 C   r5   r!   rindexr%   r   r   r   rindex_usecase   r8   rf   c                 C   rJ   r!   rd   rK   r   r   r   rindex_with_start_only_usecase   r4   rg   c                 C   rN   r!   rd   rO   r   r   r   rindex_with_start_end_usecase   rR   rh   c                 C   r5   r!   indexr%   r   r   r   index_usecase   r8   rk   c                 C   rJ   r!   ri   rK   r   r   r   index_with_start_only_usecase   r4   rl   c                 C   rN   r!   ri   rO   r   r   r   index_with_start_end_usecase   rR   rm   c                 C   r5   r!   
startswithr%   r   r   r   startswith_usecase   r8   rp   c                 C   r5   r!   endswithr%   r   r   r   endswith_usecase   r8   rs   c                 C      |   S r!   
expandtabsr   r   r   r   expandtabs_usecase   r(   rw   c                 C   r5   r!   ru   r   tabsizer   r   r   expandtabs_with_tabsize_usecase   r8   rz   c                 C      | j |dS )N)ry   ru   rx   r   r   r   %expandtabs_with_tabsize_kwarg_usecase   r4   r|   c                 C   rJ   r!   rn   rK   r   r   r   "startswith_with_start_only_usecase   r4   r}   c                 C   rN   r!   rn   rO   r   r   r   !startswith_with_start_end_usecase   rR   r~   c                 C   rJ   r!   rq   rK   r   r   r    endswith_with_start_only_usecase   r4   r   c                 C   rN   r!   rq   rO   r   r   r   endswith_with_start_end_usecase   rR   r   c                 C   r5   r!   splitr%   r   r   r   split_usecase   r8   r   c                 C   rJ   r!   r   r#   r&   maxsplitr   r   r   split_with_maxsplit_usecase   r4   r   c                 C      | j ||dS N)r   r   r   r   r   r   !split_with_maxsplit_kwarg_usecase   rR   r   c                 C   rt   r!   r   r"   r   r   r   split_whitespace_usecase   r(   r   c                 C   rt   r!   
splitlinesr   r   r   r   splitlines_usecase   r(   r   c                 C   r5   r!   r   r   keependsr   r   r    splitlines_with_keepends_usecase   r8   r   c                 C   r{   )N)r   r   r   r   r   r   &splitlines_with_keepends_kwarg_usecase   r4   r   c                 C   r5   r!   rsplitrD   r   r   r   rsplit_usecase   r8   r   c                 C   rJ   r!   r   r   rE   r   r   r   r   rsplit_with_maxsplit_usecase   r4   r   c                 C   r   r   r   r   r   r   r   "rsplit_with_maxsplit_kwarg_usecase   rR   r   c                 C   rt   r!   r   r   r   r   r   rsplit_whitespace_usecase   r(   r   c                 C   rt   r!   lstripr"   r   r   r   lstrip_usecase   r(   r   c                 C   r5   r!   r   r#   charsr   r   r   lstrip_usecase_chars   r8   r   c                 C   rt   r!   rstripr"   r   r   r   rstrip_usecase   r(   r   c                 C   r5   r!   r   r   r   r   r   rstrip_usecase_chars   r8   r   c                 C   rt   r!   stripr"   r   r   r   strip_usecase   r(   r   c                 C   r5   r!   r   r   r   r   r   strip_usecase_chars  r8   r   c                 C   r5   r!   )joinr%   r   r   r   join_usecase  r8   r   c                 C   s   dg}|   | |S )N )popr   )r#   lr   r   r   join_empty_usecase  s   
r   c                 C   r5   r!   centerr%   r   r   r   center_usecase  r8   r   c                 C   rJ   r!   r   r#   r&   fillcharr   r   r   center_usecase_fillchar  r4   r   c                 C   r5   r!   ljustr%   r   r   r   ljust_usecase  r8   r   c                 C   rJ   r!   r   r   r   r   r   ljust_usecase_fillchar  r4   r   c                 C   r5   r!   rjustr%   r   r   r   rjust_usecase#  r8   r   c                 C   rJ   r!   r   r   r   r   r   rjust_usecase_fillchar'  r4   r   c                 C   rt   r!   )istitler"   r   r   r   istitle_usecase+  r(   r   c                 C   s   g }| D ]}| | q|S r!   append)r#   r   r0   r   r   r   iter_usecase/     r   c                 C   rt   r!   titler"   r   r   r   r   6  r(   r   c                  C   s   g } dD ]}|  | q| S r   r   )r   r0   r   r   r   literal_iter_usecase:  r   r   c                 C   s2   d}d}t | D ]\}}||7 }|d7 }q||fS )Nr   r      )	enumerate)r#   bufscanr0   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#   nr0   _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   r0   r   r   r   r   r   "literal_iter_stopiteration_usecaseQ  s   
r   c                 C   rt   r!   )islowerr"   r   r   r   islower_usecaseY  r(   r   c                 C   rt   r!   lowerr"   r   r   r   lower_usecase]  r(   r   c                 C   r)   r!   r   r"   r   r   r   ord_usecasea  r(   r   c                 C   r)   r!   )chrr"   r   r   r   chr_usecasee  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   j  r   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abascZascihr   Zasciju   大处着眼，小处着手r   u%   大处着眼，小处着手。🐍⚡) r   r   )r   r   )r   r   )zasc ii )r   ci)r   r   )r      Ă)r      大处)r      étú?)r   +   大处 着眼，小处着手。大大大处)r   r   )r   r   )r   r   )r   u   大处大处)r   r   )r   r   r   r   )r   r   )r      tú quién te crees?)r   r   )r   r   )r   r   )r   r   )r   r   )r   r   )r   r   )ababababa)r   r   )r   aba)
aaaaaaaaaar   )r      aĂ)Zaabbaaaabbaaaac                   @   s(  e Zd Z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   .   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 )Nz%s, %sr   )r'   r   r   reversedr   r   r   r   r  r   r   r   r   r   test_eq  s   zTestUnicode.test_eqc                 C   s<   t dd }td D ]\}}| |||||| q
d S )Nc                 S   s4   | dkrd}nd }|dk rd}nd }||krdS dS )Nr   Zconcrete
      r   )Zpred1Zpred2Z	resolved1Z	resolved2r   r   r   foo  s   z)TestUnicode.test_eq_optional.<locals>.foo)r   r  )r   r   r   py_func)r   r
  p1p2r   r   r   test_eq_optional  s
   
zTestUnicode.test_eq_optionalc              	   C   s   |}t |}tD ]}| ||||||d|j||f  qttddD ]*\}}| ||||||d|j||f  | ||||||d|j||f  q$d S )Nz%s: "%s", "%s"   r)r   UNICODE_ORDERING_EXAMPLESr   r   r   )r   Zusecaser   r  r   r   r   r   r   _check_ordering_op  s(   zTestUnicode._check_ordering_opc                 C      |  t d S r!   )r  r>   r   r   r   r   r   test_lt  rR   zTestUnicode.test_ltc                 C   r  r!   )r  r?   r  r   r   r   test_le  rR   zTestUnicode.test_lec                 C   r  r!   )r  rA   r  r   r   r   test_gt  rR   zTestUnicode.test_gtc                 C   r  r!   )r  rB   r  r   r   r   test_ge  rR   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!   )r.   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)rw   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   rz   r|   r   zipr   r  r#  )r   fnsmessagesr%  r   ry   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)rz   r   r   IntegerintassertRaisesr
   r#  assertInstr	exception)r   r   r  accepted_typesraisesr"  r   r   r   ,test_expandtabs_exception_noninteger_tabsize(  s   

z8TestUnicode.test_expandtabs_exception_noninteger_tabsizec           	      C   s   t }t|}g d}g d}ddg}|t D ])}dd|d d |dd  ||| g}|| | D ]}| |||||| q0qd S )	Nhello
helloworldr   
her8  r9  Zellor   Zlowolor;  r<  ohellohellohellor   r   r#      rp   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 ]8}dd|d d |dd  ||| g}|| | D ]}ttd	d
d g D ]}	| ||||	||||	 q<q0qd S Nr7  r:  r>  r   r   r#   r?  r@  r	  )r}   r   r   listr   r   )
r   r   r  rB  rC  rD  r   rE  rF  rL   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 ]G}dd|d d |dd  ||| g}|| | D ],}ttd	d
d g D ]}	ttd	d
d g D ]}
| ||||	|
||||	|
 qHq<q0qd S rH  r~   r   r   rJ  r   r   )r   r   r  rB  rC  rD  r   rE  rF  rL   rP   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 sw   Y  d}|  t| tt}|ddd W d    n1 s>w   Y  d}|  t| tt}|dddd	 W d    d S 1 sbw   Y  d S )
Nz9The arg 'prefix' should be a string or a tuple of stringsr8  )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   rp   r}   r~   )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 ]-}dd|d d |dd  ||| g}|| | D ]}|d	f}	| |||	|||	 q0qd S )
Nr7  r:  r>  r   r   r#   r?  r@  r<  rA  )
r   r   r  rB  rC  rD  r   rE  sub_strrF  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 ]K}dd|d d |dd  ||| g}|| | D ]0}ttd	d
d g D ]#}	ttd	d
d g D ]}
|df}| ||||	|
||||	|
 qHq<q0qd S )Nr7  r:  r>  r   r   r#   r?  r@  rI  r	  r<  rL  )r   r   r  rB  rC  rD  r   rE  rP  rL   rP   rF  r   r   r   test_startswith_tuple_args  s$   $z&TestUnicode.test_startswith_tuple_argsc           
   	   C   s   t }t|}g d}g d}ddg}|t D ]1}dd|d d |dd  ||| g}|| | D ]}d	}	| j|||||||	||d
 q0qd S )Nr7  r:  r>  r   r   r#   r?  r@  z)Results "{}".endswith("{}") must be equalr!  rs   r   r   r   r#  )
r   r   r  rB  rC  rD  r   rE  rP  r"  r   r   r   test_endswith_default  s   $
z!TestUnicode.test_endswith_defaultc                 C   s   t }t|}g d}g d}ddg}|t D ]A}dd|d d |dd  ||| g}|| | D ]&}ttd	d
d g D ]}	d}
| j||||	||||	|
|||	d q<q0qd S )Nr7  r:  r>  r   r   r#   r?  r@  rI  r	  z-Results "{}".endswith("{}", {}) must be equalr!  )r   r   r   rJ  r   r   r#  )r   r   r  rB  rC  rD  r   rE  rP  rL   r"  r   r   r   test_endswith_with_start  s"   $
z$TestUnicode.test_endswith_with_startc                 C   s   t }t|}g d}g d}ddg}|t D ]Q}dd|d d |dd  ||| g}|| | D ]6}ttd	d
d g D ])}	ttd	d
d g D ]}
d}| j||||	|
||||	|
||||	|
d qHq<q0qd S )Nr7  r:  r>  r   r   r#   r?  r@  rI  r	  OResults "{}".endswith("{}", {}, {})                               must be equalr!  r   r   r   rJ  r   r   r#  )r   r   r  rB  rC  rD  r   rE  rP  rL   rP   r"  r   r   r   test_endswith_with_start_end  s&   $z(TestUnicode.test_endswith_with_start_endc              	   C   s   t }t|}g d}g d}ddg}|t D ]5}dd|d d |dd  ||| g}|| | D ]}d	}	|d
f}
| j|||
|||
|	||
d q0qd S )Nr7  r:  r>  r   r   r#   r?  r@  z'Results "{}".endswith({}) must be equalr<  r!  rS  )r   r   r  rB  rC  rD  r   rE  rP  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 )Nr7  r:  r>  r   r   r#   r?  r@  rI  r	  rV  r<  r!  rW  )r   r   r  rB  rC  rD  r   rE  rP  rL   rP   r"  rY  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  r?  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_checkrF   r   r0  
ValueErrorr1  r2  r3  r   UnicodeTypeUnicodeCharSeqr
   r#  r   r   r  funcr5  r4  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      ⚡abcabcrn  r   rn     🐍⚡🐍rn  abababar   ru  r   ru  r   ru  r   ru  r   z-Results of "{}".partition("{}") must be equalr!  )rF   r   r   r#  r   r   r  CASESr"  r   rE   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   r\  Nr?  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!  )rI   r   r   r   r#  )
r   r   r   r  rE  rC  r   subsrP  r"  r   r   r   	test_find8  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   r\  r?  r@  rI  r	  z)Results "{}".find("{}", {}) must be equalr!  )rM   r   r   rJ  r   r   r#  r   r   r  r   rP  rL   r"  r   r   r   test_find_with_start_onlyT     "
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 )	NrI  r	  r   r\  r?  r@  z0Results of "{}".find("{}", {}, {}) must be equalr!  )rQ   r   rJ  r   r   r   r   r#  
r   r   r  startsendsr   rP  rL   rP   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))皙?   rL   )r         ?rP   r   Zsciz"{}" must be {}, not float)rQ   r   r   r.  NoneTyper0  r
   r#  r1  r2  r3  )	r   r   r  acceptedrL   rP   namer5  r"  r   r   r   (test_find_exception_noninteger_start_endm  s   z4TestUnicode.test_find_exception_noninteger_start_endc              	   C   r`  ra  )rc  rT   r   r0  rd  r1  r2  r3  r   re  rf  r
   r#  rg  r   r   r   %test_rpartition_exception_invalid_sepx  rj  z1TestUnicode.test_rpartition_exception_invalid_sepc                 C   rk  )Nrl  z.Results of "{}".rpartition("{}") must be equalr!  )rT   r   r   r#  rz  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})rW   r   UNICODE_COUNT_EXAMPLESr   r#  )r   r   r  	error_msgr   sub	py_resultc_resultr   r   r   
test_count  s   

zTestUnicode.test_countc           	      C   s   t }t|}dd }tD ]@\}}tddD ]}||||}||||}| |||||||| q|||d }|||d }| |||||d || qd S )N%s
%s)z '{0}'.py_count('{1}', {2}) = {3}z'{0}'.c_count('{1}', {2}) = {4}   )rX   r   r  r   r   r#  )	r   r   r  r  r   r  r0   r  r  r   r   r   test_count_with_start  s(   z!TestUnicode.test_count_with_startc           
      C   s   t }t|}dd }tD ]p\}}ttdddD ]!\}}|||||}|||||}	| ||	|||||||	 qtddD ]}|||d |}|||d |}	| ||	|||d |||	 q?|||d d }|||d d }	| ||	|||d d ||	 qd S )Nr  )%'{0}'.py_count('{1}', {2}, {3}) = {4}z$'{0}'.c_count('{1}', {2}, {3}) = {5}r  r  )r  r  )rY   r   r  r   r   r   r#  )
r   r   r  r  r   r  r0   jr  r  r   r   r   test_count_with_start_end  s8   z%TestUnicode.test_count_with_start_endc                 C   s   t t}| t}|dddd W d    n1 sw   Y  | dt|j | t}|dddd W d    n1 s@w   Y  | dt|j | t}|dddd W d    n1 sew   Y  | d	t|j d S )
Nr   r   r   r  ,The slice indices must be an Integer or Noneg333333?      z(The substring must be a UnicodeType, not)r   rY   r0  r
   r1  r2  r3  r   r  r5  r   r   r   test_count_arg_type_check  s&   z%TestUnicode.test_count_arg_type_checkc                    s   t   fdd}| t}|dddd W d    n1 sw   Y  | dt|j dd }ttjtjt	tjt	tj}t
|g } ddd	d
}|ddd	d
}| |||ddd	d
|| d S )Nc                     s6   t t jt jt t jt t j}t|g  d S r!   )r   int64unicode_typeOptionalfloat64r   )argsZbad_sigr   r   r   try_compile_bad_optional     

zPTestUnicode.test_count_optional_arg_type_check.<locals>.try_compile_bad_optional	   tú quis?u   tú皙?r  r  )r  z''{0}'.c_count_op('{1}', {2}, {3}) = {5}r      )rY   r0  r
   r1  r2  r3  r   r  r  r  r   r   r#  )r   r  r5  r  Zsig_optionalcfunc_optionalr  r  r   r  r   "test_count_optional_arg_type_check  s,   

z.TestUnicode.test_count_optional_arg_type_checkc           	      C   s   t }t|}dd tD }dg dfdg dfddd	gfd
dgfddgfddgfdg dfdddgfddgfddgfddgfg}|| D ]\}}|D ]}d}| j|||||||||d qJqDd S )Nc              	   S   r~  r  r   r  r   r   r   r    r  z*TestUnicode.test_rfind.<locals>.<listcomp>uf   Ăaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar  uh   􀌄aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar  abcdefghiabcabcr      aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂr     a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄  Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄r   r  )r   r  u   Ăau   􀌄ar  r  u   􀌄Ă   _aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂ_a  _a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄  _Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄   _Ăz&Results "{}".rfind("{}") must be equalr!  )r\   r   r   r   r#  	r   r   r  rE  rC  r   r  rP  r"  r   r   r   
test_rfind  s2   





zTestUnicode.test_rfindc                 C   r  )	Nr   r\  r?  r@  rI  r	  z*Results "{}".rfind("{}", {}) must be equalr!  )r]   r   r   rJ  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 )	NrI  r	  r   r\  r?  r@  z1Results of "{}".rfind("{}", {}, {}) must be equalr!  )r^   r   rJ  r   r   r   r   r#  r  r   r   r   test_rfind_with_start_end0  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   r0  r
   r#  r   re  r1  r2  r3  )r   r  r   rP  r5  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   r\  r?  r@  r  Fr  r   z"start" must be {}gTz"end" must be {})r   r^   r   r.  r  r   r   r0  r
   r#  r1  r2  r3  )	r   r  r4  r   rP  rL   rP   r5  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 s0w   Y  | |t|j	 dd	 }| t}|||dd W d    n1 sYw   Y  | |t|j	 d S )
Nr   r   r  r  c                  W   6   t t jt jt t jt t j}t|gt d S r!   )r   r  r  r  r  intpr   r^   r  Zwrong_sig_optionalr   r   r    try_compile_wrong_start_optionalb  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_optionalm  r  zWTestUnicode.test_rfind_wrong_start_end_optional.<locals>.try_compile_wrong_end_optional)
r   r   r.  r  r#  r0  r
   r1  r2  r3  )r   r   rP  r4  r"  r  r5  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   Nr?  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!  )rf   r   r   r   r#  r  r   r   r   test_rindexx  *   
	
zTestUnicode.test_rindexc           	   	   C   r  )Nc                 S   r  r  r   r  r   r   r   r    r  z*TestUnicode.test_index.<locals>.<listcomp>r  r  r  r   r  r  r   r  r  r  r  r  z&Results "{}".index("{}") must be equalr!  )rk   r   r   r   r#  r  r   r   r   
test_index  r  zTestUnicode.test_indexc                 C   s  t tg}ddg}g d}t||D ]s\}}t|}|D ]h}t|}dttd|d f|d d dgttdd|  f|d	d  ttd
ttdd
|  f|dgttdd|  fg}	|	D ]!\}
}|d g D ]}| j|||
||||
||||
|d qjqaqqd S )Nz*Results "{}".index("{}", {}) must be equalz+Results "{}".rindex("{}", {}) must be equalr   r   r   r   r   r   r   r?  r   r@     r!  )	rl   rg   r(  r   r+   rJ  r   r   r#  )r   pyfuncsr*  unicode_examplesr   r"  r  r   r   r%  rP  r  rL   r   r   r   !test_index_rindex_with_start_only  s4   "(
z-TestUnicode.test_index_rindex_with_start_onlyc                 C   sX  t tg}ddg}g d}t||D ]\}}t|}|D ]}t|}dttd|d tt|df|d d d	gttdd|  dd
gtt|d d f|dd  ttdttdd
 tt|df|d	gttdd|  tt|dfg}	|	D ]*\}
}}t|d g |D ]\}}| j|||
|||||
|||	||
||d qq}qqd S )Nz1Results of "{}".index("{}", {}, {}) must be equalz2Results of "{}".rindex("{}", {}, {}) must be equalr  r   r  r   r  r?  r   r  r  r@  r  r!  )
rm   rh   r(  r   r+   rJ  r   r   r   r#  )r   r  r*  r  r   r"  r  r   r   r%  rP  r  r  rL   rP   r   r   r    test_index_rindex_with_start_end  s8     "&z,TestUnicode.test_index_rindex_with_start_endc                 C   s(  |    g d}ttg}|D ]}t|}|D ]z}t|}dtt|d d|gf|d d dgtt|d f|dd  ttd	d|gf|d gtt|fg}|D ]=\}}	}
t|	|
D ]2\}}||fD ])}| t	}||||| W d    n1 s}w   Y  d
}| 
|t|j qdq\qRqqd S )Nr  r   r   r  r?  r   r  r@  r  zsubstring not found)rc  rm   rh   r   r+   rJ  r   r   r0  rd  r1  r2  r3  )r   r  r  r   r  r   r   r%  rP  r  r  rL   rP   rh  r5  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   r.  r  rm   rh   r   r0  r
   r#  r1  r2  r3  )
r   r  r  r   r  rL   rP   r  r5  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]?)r1   r   r   r   r+   r   )r   r   r  r   r0   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  )r3   r   r   r+   r   )r   r   r  samplesr   r0   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)
rc  r1   r   r   r0  
IndexErrorr+   r1  r2  r3  )r   r   r  r   r5  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]?)r1   r   r   rJ  r   r+   slicer   r   r   r  r   r0   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 )Nr?  r  r   r  r1   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   ¡¡¡着着着r?  r  r   r   r  r  )r3   r   r+   r  r   )r   r   r  r  r   r0   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|D ]-}tt| t|D ] }dD ]}t|||}| ||||||d||||f  q$q qqd S )Nr?  r  r   r  '%s'[%d:%d:%d]?)r1   r   r   r   r+   r  r   r   r   r  r   r0   r  kr  r   r   r   test_slice3U  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  )r3   r   r   r+   r  r   )	r   r   r  r  r   r0   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 ]}t|||}| ||||||d||||f  q(q$q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 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	  )	r7   r   r0  r
   r1  r2  r3  r   r   )r   r   r  ZZFILL_INPUTSr5  r   widthr   r   r   
test_zfill  s   zTestUnicode.test_zfillc              	   C   P   t }t|}tD ]}td d d D ]}| ||||||d||f  qqd S Nr  z'%s' + '%s'?)r9   r   r   r   r  r   r   r   test_concat     
zTestUnicode.test_concatc                 C   sT   t }t|}tD ]}dD ]}| |||||| | |||||| qqd S )N)r  r   r   r  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>))	rc  r   r:   r0  r
   r1  r   r2  r3  r  r   r   r   test_repeat_exception_float  s   
z'TestUnicode.test_repeat_exception_floatc              	   C   l   |    t}t|}||fD ]%}| t}|dd W d    n1 s%w   Y  | dt|j qd S Nr   r   rb  )rc  r   r   r0  rd  r1  r2  r3  r   r   r  rh  r5  r   r   r   test_split_exception_empty_sep     z*TestUnicode.test_split_exception_empty_sepc              	   C   sh   t }t|}dD ])}| t}|d|d W d    n1 s w   Y  | dt|jd|  qd S )Nr   Nr   r-  r  z"non-integer maxsplit with sep = %s)r   r   r0  r
   r1  r2  r3  )r   r   r  rE   r5  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 Nrm  ro  rq  rr  rt  rv  rw  rx  ry  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   rn  r   )rp  rn  r   )r   rn  r   )rs  rn  r   )ru  r   r  )ru  r   r   )ru  r   r  )ru  r   r   )ru  r   r  z'%s'.split('%s', %d)?z'%s'.split('%s', maxsplit=%d)?)r   r   r   r   )r   r{  r   Zfmt_strr  r  r  r   r   r   r   test_split_with_maxsplit  s    
z$TestUnicode.test_split_with_maxsplitc                 C   sd   t }t|}dttg d}ddddddd| d	 g}|D ]}| ||||d
|f  qd S )Nr   	   r     r                           i  i    i   i   i   i   i   i   i   i   i	   i
   i(   i)   i/   i_   i 0  rp     🐍 ⚡   🐍 ⚡ 🐍   🐍   ⚡ 🐍       🐍   ⚡ 🐍    🐍
   ⚡ 🐍  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   r.  r/  Booleanr-   r0  r
   r#  r1  r2  r3  )r   r   r  r4  tyr   r5  r"  r   r   r   %test_split_exception_invalid_keepends-  s   z1TestUnicode.test_split_exception_invalid_keependsc                 C   r  )Nr   r9  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  r'  zTestUnicode.test_splitlinesc           
   	   C   sx   t tg}ddg}g d}g d}t||D ]$\}}t|}t||D ]\}}	| j|||	|||	|||	d q"qd S )Nz,Results of "{}".splitlines({}) must be equalz5Results of "{}".splitlines(keepends={}) must be 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   r  r  )rc  r   r   r0  rd  r1  r2  r3  r  r   r   r   test_rsplit_exception_empty_sepV  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   r-  z "maxsplit" must be {}, not float)r   r   r   r.  r/  r0  r
   r#  r1  r2  r3  )r   r   r  r4  rE   r5  r"  r   r   r   )test_rsplit_exception_noninteger_maxsplitb  s   

z5TestUnicode.test_rsplit_exception_noninteger_maxsplitc                 C   rk  )Nr  z*Results of "{}".rsplit("{}") must be equalr!  )r   r   r   r#  rz  r   r   r   test_rsplitm  s   
zTestUnicode.test_rsplitc           
   
   C   sr   t tg}g d}ddg}t||D ]%\}}t|}|D ]\}}}	| j||||	||||	||||	d qqd S )Nr!  z.Results of "{}".rsplit("{}", {}) must be equalz7Results of "{}".rsplit("{}", maxsplit={}) must be equalr!  )r   r   r(  r   r   r#  )
r   r  r{  r*  r   r"  r  r  rE   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#  rp  r.  r/  r0  r1  r2  r3  z&Results of "{}".rsplit() must be equal)r   r   r   r4  r   r   r#  )r   r   r  r5  r{  r"  r   r   r   r   test_rsplit_whitespace  s   
	z"TestUnicode.test_rsplit_whitespacec                 C   s>   t }t|}ddg}|D ]}| ||||d|f  qd S )Nr      🐍🐍🐍z'%s'.join([])?)r   r   r   )r   r   r  r{  rE   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   r0  r
   r2  r3  r1  )r   r   r  r5  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   rF     ⚡⚡r  '%s'.join('%s')?r   r   r   r   r   r  r{  rE   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)rF  rI  rJ  rK  rL  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   r0  r
   r   r1  r2  r3  r   r   )r   r   	case_namer  r5  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  rQ  r	  r	  z'%s'.%s(%d, '%s')?)r   r   r   r   r0  r
   r   r1  r2  r3  r   r   )r   r   rR  r  r   r5  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)rc  r   r   r   r   r0  rd  r   r1  r2  r3  r
   )r   r   r  r   r5  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_concat4  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   rt   r!   )isidentifierr   r   r   r   r   >  r(   z-TestUnicode.test_isidentifier.<locals>.pyfunc)r   Zr   Zb0bcZb_   µu   𝔘𝔫𝔦𝔠𝔬𝔡𝔢r   [   ©0   u   u   u   u   abu   abu	   abau	   abaz,Results of "{}".isidentifier() must be equalr   r!  r   r   r   r#  r   r   r  cpythonZcpython_extrasr"  r   r   r   r   test_isidentifier=      zTestUnicode.test_isidentifierc                    sL  g d}t dftdftdffD ]\ }t }|D ]\}}|  |||d||f  qqtdftdftdffD ]j\ }t }t	tj	t
tj	}t|g } fdd}||fD ]%}	| t}
|	dd	 W d    n1 stw   Y  | d
t|
j q]||fD ]}	|D ]\}}|  |||	||d|||f  qqq9d S )N))ass ciiZai)rh  N)Zassciiai )zasscii ri  )	 asscii  ri  )rj  zasci )rj  r   )z      r   )r   r   r   )r   Nr  )
  asscii  ri  )rk  r   )rk  N)r      étú? )     tú quién te crees?   rl  )u     tú qrees?   r   )rm  Nr   )    大处大处  r   )z	
abcd	z	a)rn  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  r0  r
   r1  r2  r3  )r   ZSTRIP_CASESrR  r  stringr   Zsig1r  r  r+  r5  r   r  r   
test_stripN  sP   "


zTestUnicode.test_stripc                 C   rY  )Nc                 S   rt   r!   )isspacer   r   r   r   r     r(   z(TestUnicode.test_isspace.<locals>.pyfunc)	u    u    u   —   𐐁   𐐧   𐐩   𐑎   🐍   👯ra  z'Results of "{}".isspace() must be equalr   r!  rc  rd  r   r   r   test_isspace  rg  zTestUnicode.test_isspacec           
   
   C   sh   t }t|}d}dd tD }g d}t| | }|D ]}||}||}	| ||	||||	 qd S )Nz0'{0}'.py_istitle() = {1}
'{0}'.c_istitle() = {2}c                 S      g | ]}|  qS r   r   r   r#   r   r   r   r        z,TestUnicode.test_istitle.<locals>.<listcomp>)r   z    z  AA  z  Ab  1ZA123ZA12Bcdz+abAZ12AbcZA12abcu   %^Abc 5 $% Def𐐁𐐩u   𐐧𐑎ru  rv  u   🐍 Isu   🐍 NOTu   👯Is   ῼu   Greek ῼitlecases ...)r   r   r   r   r#  )
r   r   r  r  Zunicode_titleZspecialZISTITLE_EXAMPLESr   r  r  r   r   r   test_istitle  s   zTestUnicode.test_istitlec                 C   L   dd }t |}g d}d}t| D ]}| j||||||d qd S )Nc                 S   rt   r!   )isprintabler   r   r   r   r     r(   z,TestUnicode.test_isprintable.<locals>.pyfunc)	r   r   abcdefgzabcdefg
u   ʹu   ͸rb  rx  u   󠀠z+Results of "{}".isprintable() must be equalr!  rc  r   r   r  re  r"  r   r   r   r   test_isprintable  s    zTestUnicode.test_isprintablec                 C   .   dd }t |}dg}| || ||  d S )Nc                 S   s   | d d  S r!   r   r   r   r   r   r     r4   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     rR   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     rR   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   r@   r!   r   r  r   r   r   r     r(   z)TestUnicode.test_basic_gt.<locals>.pyfuncr   r   r  r  r   r   r   test_basic_gt  r  zTestUnicode.test_basic_gtc                 C   s\   dd }t |}ttddD ]\}}dD ]}|||g}| j|| || d|d qqd S )Nc                 S   sd   | dkr||kS | dkr||kS | dkr||k S | dkr ||kS | dkr(||kS | dkr0||kS d S )N==!=<><=>=r   optionr#   r&   r   r   r   r     s   z+TestUnicode.test_comparison.<locals>.pyfuncr  r  r  r  r  r  r  r  r   failed on {}r!  )r   r   r  r   r#  )r   r   r  r#   r&   cmpopr  r   r   r   test_comparison  s   
zTestUnicode.test_comparisonc                 C   sH   dd }t |}dg}| || ||  dg}| || ||  d S )Nc                 S   s,   d}t | r|d |  d S | | d |  S )Nr  Zb123IOrO  r*   )r#   r  r   r   r   r     s   z/TestUnicode.test_literal_concat.<locals>.pyfuncr#   r   r  r   r   r  r  r   r   r   test_literal_concat  s   zTestUnicode.test_literal_concatc                 C   B   dd }t |}dD ]}|g}| j|| || d|d q
d S )Nc                 S   sl   d}d}| dkr||kS | dkr||kS | dkr||k S | dkr$||kS | dkr,||kS | dkr4||kS d S )	NZa123Zaa12r  r  r  r  r  r  r   r  r   r   r   r   %  s   z3TestUnicode.test_literal_comparison.<locals>.pyfuncr  r  r!  r   r   r#  )r   r   r  r  r  r   r   r   test_literal_comparison$  s   z#TestUnicode.test_literal_comparisonc                 C   s$   dd }t |}| | |  d S )Nc                   S   s   t dS Nr  r*   r   r   r   r   r   >  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   D  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_getitemC  s   z TestUnicode.test_literal_getitemc                 C   r  )Nc                 S   s   | dv S )NZ
9876zabiuhr   r"   r   r   r   r   M  r(   z+TestUnicode.test_literal_in.<locals>.pyfunc)r   9r}  r   Z8uhaZ987r  r!  r  r  r   r   r   test_literal_inL     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)ro   rr   r%   r   r   r   r   W     z0TestUnicode.test_literal_xyzwith.<locals>.pyfuncr  r  r  r  r!  )r   r   r   r#  r  r   r   r   test_literal_xyzwithV  s   z TestUnicode.test_literal_xyzwithc                 C   r  )Nc                 S   s   d | |  dfS )Nr  r   rG   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   j  s   z$TestUnicode.test_not.<locals>.pyfuncr  r!  rc  r  r   r   r   test_noti  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   rt   r!   )
capitalizer"   r   r   r   r   t  r(   z+TestUnicode.test_capitalize.<locals>.pyfunc)	   𐑏   𐑏𐑏   𐐧𐑏   𐑏𐐧
   X𐐧x𐑏u   hİu   ῒİu   ﬁnnish   AͅΣ   𐀀􀀀z*Results of "{}".capitalize() must be equalr   r!  rc  rd  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	 q(d S )
Nc                 S   rt   r!   )isupperr"   r   r   r   r     r(   z(TestUnicode.test_isupper.<locals>.pyfuncc                 S   rz  r   upperr{  r   r   r   r    r|  z,TestUnicode.test_isupper.<locals>.<listcomp>ZAA12AZaa12au   大AA12Au   大aa12au   AAAǄAu	   A 1 1 大u   Ⅷ   ⅷrs  rt  ru  rv  rw  rx  c                 S      g | ]}|d  qS r  r   r{  r   r   r   r    r|  r  r!  rc  )	r   r   r  Zuppersr]  re  Zfourxcpyr   r  r   r   r   test_isupper  s   zTestUnicode.test_isupperc                 C   r  )Nc                 S   rt   r!   r  r"   r   r   r   r     r(   z&TestUnicode.test_upper.<locals>.pyfuncr  r!  rc  r  r   r   r   
test_upper  r  zTestUnicode.test_upperc                 C   r  )Nc                 S   rt   r!   )casefoldr"   r   r   r   r     r(   z)TestUnicode.test_casefold.<locals>.pyfunc)r8  ZhELlo   ß   ﬁ   Σr  r]  r  z(Results of "{}".casefold() must be equalr   r!  rc  rd  r   r   r   test_casefold  s    zTestUnicode.test_casefoldc                 C   ^   dd }t |}g d}g d}d}tdg | | D ]}| j||||||d qd S )Nc                 S   rt   r!   )isalphar"   r   r   r   r     r(   z(TestUnicode.test_isalpha.<locals>.pyfunc)r~  rs  rt  ru  rv  rw  rx  ra  z'Results of "{}".isalpha() must be equalr   r!  rc  r   r   r  re  r]  r"  r   r   r   r   test_isalpha      zTestUnicode.test_isalphac                 C   r  )Nc                 S   rt   r!   )r   r"   r   r   r   r     r(   z(TestUnicode.test_isascii.<locals>.pyfunc)r    z       ér   z'Results of "{}".isascii() must be equalr!  rc  r  r   r   r   test_isascii  s    zTestUnicode.test_isasciic                 C   sN   t }t|}g d}d}tdg | D ]}| j||||||d qd S )N)	r  r  u   𐑏𐑏 𐑏𐑏u   𐐧𐑏 𐐧𐑏u   𐑏𐐧 𐑏𐐧u   X𐐧x𐑏 X𐐧x𐑏u   ﬁNNISHu	   AΣ ᾡxyu   AΣAz%Results of "{}".title() must be equalr   r!  )r   r   r   r   r#  r  r   r   r   
test_title  s    zTestUnicode.test_titlec                 C   r  )Nc                 S   rt   r!   )swapcaser"   r   r   r   r     r(   z)TestUnicode.test_swapcase.<locals>.pyfunc)r  rt  r  r  r  r  r     İr     ͅΣr     AͅΣar  u   AΣͅ   Σͅ r  r  u   ῒr  z(Results of "{}".swapcase() must be equalr   r!  rc  rd  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   rz  r   r   r{  r   r   r   r    r|  z,TestUnicode.test_islower.<locals>.<listcomp>r  r  c                 S   r  r  r   r{  r   r   r   r    r|  z'Results of "{}".islower() must be equalr   r!  )r   r   r   r   r#  )r   r   r  Zlowersr]  re  r"  r   r   r   r   test_islower  s    zTestUnicode.test_islowerc                 C   r  )Nc                 S   rt   r!   )isalnumr"   r   r   r   r   	  r(   z(TestUnicode.test_isalnum.<locals>.pyfunc)rs  rt  ru  rv     𝟶   𑁦   𐒠   🄇ra  z'Results of "{}".isalnum() must be equalr   r!  rc  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  )rs  rt  rv  rx  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  r]  re  sigmaZextra_sigmar"  r   r   r   r   
test_lower	  s   
 zTestUnicode.test_lowerc                 C   rY  )Nc                 S   rt   r!   )	isnumericr"   r   r   r   r   ,	  r(   z*TestUnicode.test_isnumeric.<locals>.pyfunc)r   r   r`     ①   ¼   ٠
01234567890123456789ars  rt  ru  rv  rw  rx     𑁥r  r  r  r  ra  z)Results of "{}".isnumeric() must be equalr   r!  rc  rd  r   r   r   test_isnumeric+	      zTestUnicode.test_isnumericc                 C   rY  )Nc                 S   rt   r!   )isdigitr"   r   r   r   r   ?	  r(   z(TestUnicode.test_isdigit.<locals>.pyfunc)r  r  r  rs  rt  ru  rv  rw  rx  r  r  r  r  r  ra  z'Results of "{}".isdigit() must be equalr   r!  rc  rd  r   r   r   test_isdigit>	  r  zTestUnicode.test_isdigitc                 C   rY  )Nc                 S   rt   r!   )	isdecimalr"   r   r   r   r   R	  r(   z*TestUnicode.test_isdecimal.<locals>.pyfunc)r   r   r`  r  r  r  r  r  rs  rt  ru  rv  rw  rx  r  r  r  r  r  ra  z)Results of "{}".isdecimal() must be equalr   r!  rc  rd  r   r   r   test_isdecimalQ	  r  zTestUnicode.test_isdecimalc              	   C   sP   t }t|}g d}|D ]\}}}| ||||||||d|||f  qd S )N
)r  r   A)r   rn  r  )rp  rn  r  )r   rn  r  )rs  rn  r  )ru  r   r  )ru  r   r  )ru  r   r  )ru  r   r  )ru  r   r  z'%s'.replace('%s', '%s')?)ra   r   r   )r   r   r  r{  r  old_strnew_strr   r   r   test_replaced	  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')?)rc   r   r   )	r   r   r  r{  Z
count_testr  r  r  rV   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   rN   r!   r_   rb   r   r   r   r   	  rR   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   r0  r
   r1  r2  r3  )r   r   r  r5  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,  r6  rG  rK  rM  rO  rQ  rR  rT  rU  rX  rZ  r[  r_  ri  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"  r6  r<  r>  r@  rA  rB  rC  rD  rE  rG  rH  rN  rP  rS  rV  rW  rX  rf  rq  ry  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r   r   r   r   r     s    



	
	J$	
	


r   c                   @   <   e Zd Zdd Zdd Zdd Zdd Zd	d
 Zdd ZdS )TestUnicodeInTuplec                 C   @   t dd }| | |  t dd }| | |  d S )Nc                   S      ddk S )N)r   bbr   r   r   r   r   r  	     z9TestUnicodeInTuple.test_const_unicode_in_tuple.<locals>.fc                   S   r  )N)ccr  r   r   r   r   r   r  	  r  r   r   r  r   r  r   r   r   test_const_unicode_in_tuple	  s   

z.TestUnicodeInTuple.test_const_unicode_in_tuplec                 C   r  )Nc                   S   r  )Nr   r   )r   r   r   r   r   r   r   r  	  r  z@TestUnicodeInTuple.test_const_unicode_in_hetero_tuple.<locals>.fc                   S   r  )Nr  )r   r  r   r   r   r   r   r  	  r  r  r  r   r   r   "test_const_unicode_in_hetero_tuple	  s   

z5TestUnicodeInTuple.test_const_unicode_in_hetero_tuplec                 C   s.   t dd }tD ]}| ||t| qd S )Nc                 S   s   | j S r!   r  r   r   r   r   r  	  s   z3TestUnicodeInTuple.test_ascii_flag_unbox.<locals>.f)r   r   r   r   r  r   r   r   test_ascii_flag_unbox	  s
   
z(TestUnicodeInTuple.test_ascii_flag_unboxc                 C      t dd }| | d d S )Nc                  S   sL   d} d}d}d}d | |gjd | |gjd | |gjd ||gjfS )Nr  rO  r   r   ,)r   r  s1s2Zs3Zs4r   r   r   r  	  s   z2TestUnicodeInTuple.test_ascii_flag_join.<locals>.f)r   r   r   r   r  r  r   r   r   test_ascii_flag_join	  s   

z'TestUnicodeInTuple.test_ascii_flag_joinc                 C   r	  )Nc                  S   s4   d} d}| d j | dd  j |d j |dd  j fS )NZabc123u   🐍⚡🐍⚡🐍⚡r   r  r  )r  r  r   r   r   r  	  s
   z5TestUnicodeInTuple.test_ascii_flag_getitem.<locals>.f)r   r   r   r   r  r  r   r   r   test_ascii_flag_getitem	  s   
z*TestUnicodeInTuple.test_ascii_flag_getitemc                 C   r	  )Nc                  S   s<   d} d}d}d}| | j | | j || j | d j |d j fS )Nr  rO  r   r   r  r  r  r   r   r   r  	  s   z5TestUnicodeInTuple.test_ascii_flag_add_mul.<locals>.f)r   r   r   r   r   r  r  r   r   r   test_ascii_flag_add_mul	  s   
z*TestUnicodeInTuple.test_ascii_flag_add_mulN)	r   r   r   r  r  r  r  r  r  r   r   r   r   r  	  s    
r  c                   @   s4   e Zd Zdd Zdd Zdd Zdd Zd	d
 ZdS )TestUnicodeIterationc                 C   .   t }t|}tD ]}| |||| qd S r!   )r   r   r   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   r  r  r   r   r   test_unicode_literal_iter 
  s   z.TestUnicodeIteration.test_unicode_literal_iterc                 C   r  r!   )r   r   r   r  r  r   r   r   test_unicode_enumerate_iter
  r  z0TestUnicodeIteration.test_unicode_enumerate_iterc              
   C   sb   |    t}t|}||fD ] }tD ]}| t || W d    n1 s(w   Y  qqd S r!   )rc  r   r   r   r0  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   r0  r  )r   r   r  r  r   r   r   'test_unicode_literal_stopiteration_iter
  s   z<TestUnicodeIteration.test_unicode_literal_stopiteration_iterN)r   r   r   r  r  r  r  r  r   r   r   r   r  	  s    	r  c                   @   r  )TestUnicodeAuxillaryc                 C   s8   t }t|}tD ]}|D ]}| |||| qqd S r!   )r   r   r   r  )r   r   r  exr   r   r   r   test_ord
  s   zTestUnicodeAuxillary.test_ordc              
   C   s   |    t}t|}||fD ])}dD ]$}| t}|| W d    n1 s(w   Y  | dt|j qq| t}|d W d    n1 sLw   Y  | t	t|j d S )N)r   r  zord() expected a charactergGz?)
rc  r   r   r0  	TypeErrorr1  r2  r3  r
   r   )r   r   r  rh  chr5  r   r   r   test_ord_invalid%
  s    

z%TestUnicodeAuxillary.test_ord_invalidc                 C   sb   t }t|}tD ]}|D ]}t|}| |||| qqdtfD ]}| |||| q"d S )Nr   )r   r   r   r   r  r   )r   r   r  r  r#   r   r   r   r   test_chr8
  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 )Nr?  r   zchr() arg not in ranger  )
r   r   r   r0  rd  r1  r2  r3  r
   r   )r   r   r  rh  vr5  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   r   )NTr   r"   r   r   r   barU
  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   re  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
  `
  r  z7TestUnicodeAuxillary.test_unicode_type_mro.<locals>.foor  )
r   r   r   r  r1  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 shw   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   r  r   r   r   impl1l
  s   z2TestUnicodeAuxillary.test_f_strings.<locals>.impl1c                 S   s
   | d  S r  r   r  r   r   r   impl2p
  r8   z2TestUnicodeAuxillary.test_f_strings.<locals>.impl2c                 S   s
   d|  S )NABC_r   r  r   r   r   impl3t
  r8   z2TestUnicodeAuxillary.test_f_strings.<locals>.impl3c                 S   s   d| dS )Nr1  r`  r   r  r   r   r   impl4x
  r4   z2TestUnicodeAuxillary.test_f_strings.<locals>.impl4c                   S   s    S r!   r   r   r   r   r   impl5|
  r    z2TestUnicodeAuxillary.test_f_strings.<locals>.impl5r@  r  ZDEr  BzABC_<object type:r  Nz*format spec in f-strings not supported yet)r   r   r   r0  r   r1  r2  r3  )r   r/  r0  r2  r3  r4  Zlist_arggotexpectedr5  r"  r   r   r   test_f_stringsh
  s$   z#TestUnicodeAuxillary.test_f_stringsN)	r   r   r   r  r   r!  r#  r.  r8  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.   r1   r3   r7   r9   r:   r;   r<   r>   r?   rA   rB   rF   rI   rM   rQ   rT   rW   rX   rY   r\   r]   r^   ra   rc   rf   rg   rh   rk   rl   rm   rp   rs   rw   rz   r|   r}   r~   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r   r  r  r  r   mainr   r   r   r   <module>   s   	
$                M$
v