
    xKg                    $   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 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z d Z!d Z"d Z#d Z$d Z%d Z&d Z'd Z(d Z)d Z*d  Z+d! Z,d" Z-d# Z.d$ Z/d% Z0d& Z1d' Z2d( Z3d) Z4d* Z5d+ Z6d, Z7d- Z8d. Z9d/ Z:d0 Z;d1 Z<d2 Z=d3 Z>d4 Z?d5 Z@d6 ZAd7 ZBd8 ZCd9 ZDd: ZEd; ZFd< ZGd= ZHd> ZId? ZJd@ ZKdA ZLdB ZMdC ZNdD ZOdE ZPdF ZQdG ZRdH ZSdI ZTdJ ZUdK ZVdL ZWdM ZXdN ZYdO ZZdP Z[dQ Z\dR Z]dS Z^dT Z_dU Z`dV ZadW ZbdX ZcdY ZddZ Zed[ Zf G d\ d]ee
      Zgg d^Zhg d_Zig d`Zj G da dbeg      Zk G dc ddeg      Zl G de dfeg      Zm G dg dheg      Zneodik(  r ej                          yy)j    )product)permutations)njittypeof)typesN)TestCaseno_pyobj_flagsMemoryLeakMixin)TypingErrorUnsupportedError)_MAX_UNICODE)_header_lead)overloadc                 &    t        d | D              S )Nc              3   8   K   | ]  }t        |      d k    yw)   Nord).0cs     \/home/alanp/www/video.onchill/myenv/lib/python3.12/site-packages/numba/tests/test_unicode.py	<genexpr>zisascii.<locals>.<genexpr>   s     'Qs1v|Qs   )allss    r   isasciir      s    'Q'''    c                       yN   大处着眼，小处着手。 r!   r   r   literal_usecaser"      s    +r   c                     | S Nr!   xs    r   passthrough_usecaser'      s    Hr   c                     | |k(  S r$   r!   r&   ys     r   
eq_usecaser+          6Mr   c                     t        |       S r$   lenr%   s    r   len_usecaser0          q6Mr   c                     t        |       S r$   )boolr%   s    r   bool_usecaser4   #   s    7Nr   c                     | |   S r$   r!   r&   is     r   getitem_usecaser8   '   s    Q4Kr   c                     t        | |         S r$   )hashr6   s     r   getitem_check_kind_usecaser;   +   s    !:r   c                 $    | j                  |      S r$   )zfillr)   s     r   zfill_usecaser>   /       771:r   c                     | |z   S r$   r!   r)   s     r   concat_usecaserA   3       q5Lr   c                     | |z  S r$   r!   r)   s     r   repeat_usecaserD   7   rB   r   c                     | |z  } | S r$   r!   r)   s     r   inplace_concat_usecaserF   ;   s    FAHr   c                 
    | |v S r$   r!   r)   s     r   
in_usecaserH   @   s    6Mr   c                     | |k  S r$   r!   r)   s     r   
lt_usecaserJ   D   rB   r   c                     | |k  S r$   r!   r)   s     r   
le_usecaserL   H   r,   r   c                     | |kD  S r$   r!   r)   s     r   
gt_usecaserN   L   rB   r   c                     | |k\  S r$   r!   r)   s     r   
ge_usecaserP   P   r,   r   c                 $    | j                  |      S r$   )	partitionr   seps     r   partition_usecaserU   T   s    ;;sr   c                 $    | j                  |      S r$   findr)   s     r   find_usecaserY   X       66!9r   c                 &    | j                  ||      S r$   rW   r&   r*   starts      r   find_with_start_only_usecaser^   \   s    66!Ur   c                 (    | j                  |||      S r$   rW   r&   r*   r]   ends       r   find_with_start_end_usecaserb   `   s    66!UC  r   c                 $    | j                  |      S r$   )
rpartitionrS   s     r   rpartition_usecasere   d   s    <<r   c                 $    | j                  |      S r$   countr)   s     r   count_usecaseri   h   r?   r   c                 &    | j                  ||      S r$   rg   r\   s      r   count_with_start_usecaserk   l       771er   c                 (    | j                  |||      S r$   rg   r`   s       r   count_with_start_end_usecasern   p       771eS!!r   c                 $    | j                  |      S r$   rfindr)   s     r   rfind_usecasers   t   r?   r   c                 &    | j                  ||      S r$   rq   r\   s      r   rfind_with_start_only_usecaseru   x   rl   r   c                 (    | j                  |||      S r$   rq   r`   s       r   rfind_with_start_end_usecaserw   |   ro   r   c                 &    | j                  ||      S r$   replace)r   r&   r*   s      r   replace_usecaser{      s    99Q?r   c                 (    | j                  |||      S r$   ry   r   r&   r*   rh   s       r   replace_with_count_usecaser~      s    99Q5!!r   c                 $    | j                  |      S r$   rindexr)   s     r   rindex_usecaser          88A;r   c                 &    | j                  ||      S r$   r   r\   s      r   rindex_with_start_only_usecaser      s    88Aur   c                 (    | j                  |||      S r$   r   r`   s       r   rindex_with_start_end_usecaser      s    88Auc""r   c                 $    | j                  |      S r$   indexr)   s     r   index_usecaser      r?   r   c                 &    | j                  ||      S r$   r   r\   s      r   index_with_start_only_usecaser      rl   r   c                 (    | j                  |||      S r$   r   r`   s       r   index_with_start_end_usecaser      ro   r   c                 $    | j                  |      S r$   
startswithr)   s     r   startswith_usecaser      s    <<?r   c                 $    | j                  |      S r$   endswithr)   s     r   endswith_usecaser      s    ::a=r   c                 "    | j                         S r$   
expandtabsr   s    r   expandtabs_usecaser          <<>r   c                 $    | j                  |      S r$   r   r   tabsizes     r   expandtabs_with_tabsize_usecaser      s    <<  r   c                 &    | j                  |      S )N)r   r   r   s     r   %expandtabs_with_tabsize_kwarg_usecaser      s    <<<((r   c                 &    | j                  ||      S r$   r   r\   s      r   "startswith_with_start_only_usecaser      s    <<5!!r   c                 (    | j                  |||      S r$   r   r`   s       r   !startswith_with_start_end_usecaser      s    <<5#&&r   c                 &    | j                  ||      S r$   r   r\   s      r    endswith_with_start_only_usecaser      s    ::ar   c                 (    | j                  |||      S r$   r   r`   s       r   endswith_with_start_end_usecaser      s    ::a$$r   c                 $    | j                  |      S r$   splitr)   s     r   split_usecaser      r?   r   c                 &    | j                  ||      S r$   r   r&   r*   maxsplits      r   split_with_maxsplit_usecaser          771hr   c                 (    | j                  ||      S N)r   r   r   s      r   !split_with_maxsplit_kwarg_usecaser      s    771x7((r   c                 "    | j                         S r$   r   r%   s    r   split_whitespace_usecaser          779r   c                 "    | j                         S r$   
splitlinesr   s    r   splitlines_usecaser      r   r   c                 $    | j                  |      S r$   r   r   keependss     r    splitlines_with_keepends_usecaser      s    <<!!r   c                 &    | j                  |      S )N)r   r   r   s     r   &splitlines_with_keepends_kwarg_usecaser      s    <<<**r   c                 $    | j                  |      S r$   rsplitrS   s     r   rsplit_usecaser      s    88C=r   c                 &    | j                  ||      S r$   r   r   rT   r   s      r   rsplit_with_maxsplit_usecaser      s    88C""r   c                 (    | j                  ||      S r   r   r   s      r   "rsplit_with_maxsplit_kwarg_usecaser      s    88C(8++r   c                 "    | j                         S r$   r   r   s    r   rsplit_whitespace_usecaser          88:r   c                 "    | j                         S r$   lstripr%   s    r   lstrip_usecaser      r   r   c                 $    | j                  |      S r$   r   r&   charss     r   lstrip_usecase_charsr          88E?r   c                 "    | j                         S r$   rstripr%   s    r   rstrip_usecaser      r   r   c                 $    | j                  |      S r$   r   r   s     r   rstrip_usecase_charsr      r   r   c                 "    | j                         S r$   stripr%   s    r   strip_usecaser      r   r   c                 $    | j                  |      S r$   r   r   s     r   strip_usecase_charsr     s    775>r   c                 $    | j                  |      S r$   )joinr)   s     r   join_usecaser     rZ   r   c                 J    dg}|j                          | j                  |      S )N )popr   )r&   ls     r   join_empty_usecaser     s     	AEEG66!9r   c                 $    | j                  |      S r$   centerr)   s     r   center_usecaser     r   r   c                 &    | j                  ||      S r$   r   r&   r*   fillchars      r   center_usecase_fillcharr     s    88Ax  r   c                 $    | j                  |      S r$   ljustr)   s     r   ljust_usecaser     r?   r   c                 &    | j                  ||      S r$   r   r   s      r   ljust_usecase_fillcharr     r   r   c                 $    | j                  |      S r$   rjustr)   s     r   rjust_usecaser   #  r?   r   c                 &    | j                  ||      S r$   r   r   s      r   rjust_usecase_fillcharr   '  r   r   c                 "    | j                         S r$   )istitler%   s    r   istitle_usecaser  +      99;r   c                 :    g }| D ]  }|j                  |        |S r$   append)r&   r   r7   s      r   iter_usecaser  /  s!    
A	 Hr   c                 "    | j                         S r$   )titler%   s    r   r
  r
  6  r   r   c                  :    g } dD ]  }| j                  |        | S r   r  )r   r7   s     r   literal_iter_usecaser  :  s!    
A-	 .Hr   c                 L    d}d}t        |       D ]  \  }}||z  }|dz  } ||fS )Nr   r      )	enumerate)r&   bufscanr7   r   s        r   enumerated_iter_usecaser  A  s<    
CD!1q	  9r   c                 l    t        |       }t        |       }t        |dz         D ]  }t        |        y )Nr  )r/   iterrangenext)r&   nr7   _s       r   iter_stopiteration_usecaser  J  s-    AAQA1q5\Q r   c                  p    d} t        |       }t        |       }t        |dz         D ]  }t        |        y )Nr    r  )r  r/   r  r  )r   r7   r  r  s       r   "literal_iter_stopiteration_usecaser  Q  s2    (AQAAA1q5\Q r   c                 "    | j                         S r$   )islowerr%   s    r   islower_usecaser  Y  r  r   c                 "    | j                         S r$   )lowerr%   s    r   lower_usecaser!  ]  r   r   c                     t        |       S r$   r   r%   s    r   ord_usecaser#  a  r1   r   c                     t        |       S r$   )chrr%   s    r   chr_usecaser&  e  r1   r   c                        e Zd Z fdZ xZS )BaseTestc                 *    t         t        |           y r$   )superr(  setUp)self	__class__s    r   r+  zBaseTest.setUpj  s    h#%r   )__name__
__module____qualname__r+  __classcell__)r-  s   @r   r(  r(  i  s    & &r   r(  )r   ascii12345
1234567890   ¡Y tú quién te crees?   🐍⚡r    )r   aaar7  baababascascihr2  asciju   大处着眼，小处着手r    u%   大处着眼，小处着手。🐍⚡) r   r   )r   r2  )r2  r   )zasc ii )r2  ci)r2  r2  )r2     Ă)r2     大处)r2     étú?)r   +   大处 着眼，小处着手。大大大处)rD  r   )rD  r?  )rD  r@  )rD  u   大处大处)rD  rD  )rD  rA  rD  rB  )rD  rC  )r      tú quién te crees?)rF  r   )rF  r?  )rF  r@  )rF  rF  )rF  rA  )rF  rB  )rF  rC  )ababababa)rG  r:  )rG  aba)
aaaaaaaaaar7  )rJ     aĂ)aabbaaaabbaaaac                   0   e Zd Zd ZefdZefdZd Zd ZefdZ	efdZ
efdZefd	Zefd
ZefdZd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd ZefdZd Zd ZefdZ d Z!d Z"d  Z#d! Z$d" Z%d# Z&d$ Z'd% Z(d& Z)d' Z*d( Z+d) Z,d* Z-d+ Z.d, Z/d- Z0d. Z1d/ Z2d0 Z3d1 Z4d2 Z5d3 Z6d4 Z7d5 Z8d6 Z9d7 Z:d8 Z;d9 Z<d: Z=d; Z>d< Z?d= Z@d> ZAefd?ZBefd@ZCdA ZDdB ZEdC ZFdD ZGdE ZHdF ZIdG ZJdH ZKdI ZLdJ ZMdK ZNdL ZOdM ZPdN ZQdO ZRdP ZSdQ ZTdR ZUdS ZVdT ZWdU ZXefdVZYdW ZZdX Z[dY Z\dZ Z]d[ Z^efd\Z_efd]Z`efd^Zaefd_Zbefd`Zcda Zddb Zedc Zfdd Zgde Zhdf Zidg Zjdh Zkdi Zldj Zmdk Zndl Zodm Zpdn Zqdo Zrdp Zsdq Ztdr Zuds Zvdt Zwdu Zxdv Zydw Zzdx Z{dy Z|dz Z}y{)|TestUnicodec                 f    t         }t        t               }| j                   |        |              y r$   )r"   r   assertPreciseEqualr,  pyfunccfuncs      r   test_literalzTestUnicode.test_literal  s%     _%%'2r   c                 x    t         }t        |      }t        D ]   }| j                   ||       ||             " y r$   )r'   r   UNICODE_EXAMPLESassertEqualr,  flagsrS  rT  r   s        r   test_passthroughzTestUnicode.test_passthrough  s2    $V!AVAYa1 "r   c           	      H   t         }t        |      }t        D ]  }t        t              D ]t  }| j	                   |||       |||      |d|       | j	                   ||d       ||d      |dd       | j	                   |d|       |d|      dd|       v  y )Nz, r  )r+   r   rW  reversedrX  r,  rZ  rS  rT  rH  r8  s         r   test_eqzTestUnicode.test_eq  s    V!A./  1!&q!!Q.?A   1!&q!!Q.?A  1!&q!!Q.?A 0 "r   c                     t         d        }t        d D ].  \  }}| j                   |||      |j                  ||             0 y )Nc                 8    | dkD  rd}nd }|dk  rd}nd }||k(  ryy)Nr   concrete
      r!   )pred1pred2	resolved1	resolved2s       r   fooz)TestUnicode.test_eq_optional.<locals>.foo  s4    qy&	 	qy&	 	 I%r   )r  rj  )r   r   rX  py_func)r,  ri  p1p2s       r   test_eq_optionalzTestUnicode.test_eq_optional  sJ    		 
	   0HRSR[#++b"*=> 1r   c                    |}t        |      }t        D ]6  }| j                   |||       |||      |j                  d|d|d       8 t	        t        d      D ]m  \  }}| j                   |||       |||      |j                  d|d|d       | j                   |||       |||      |j                  d|d|d       o y )Nz: "z", ""   r)r   UNICODE_ORDERING_EXAMPLESrX  r.  r   )r,  usecaserS  rT  rH  r8  s         r   _check_ordering_opzTestUnicode._check_ordering_op  s    V +Aq!a$+$4$4a; + !!:a@DAqq!a$+$4$4a; q!a$+$4$4a; Ar   c                 .    | j                  t               y r$   )rw  rJ   r,  rZ  s     r   test_ltzTestUnicode.test_lt      
+r   c                 .    | j                  t               y r$   )rw  rL   ry  s     r   test_lezTestUnicode.test_le  r{  r   c                 .    | j                  t               y r$   )rw  rN   ry  s     r   test_gtzTestUnicode.test_gt  r{  r   c                 .    | j                  t               y r$   )rw  rP   ry  s     r   test_gezTestUnicode.test_ge   r{  r   c                 x    t         }t        |      }t        D ]   }| j                   ||       ||             " y r$   )r0   r   rW  rX  rY  s        r   test_lenzTestUnicode.test_len  s2    V!AVAYa1 "r   c                 x    t         }t        |      }t        D ]   }| j                   ||       ||             " y r$   )r4   r   rW  rX  rY  s        r   	test_boolzTestUnicode.test_bool	  s2    V!AVAYa1 "r   c                     t         }t        |      }g d}d}|D ]1  }| j                   ||       ||      |j                  |             3 y )N	r   	zt	t	za	u   	⚡z	a	bc
ab	cu   🐍	⚡u   🐍⚡
		🐍	zabab			ab
	az*Results of "{}".expandtabs() must be equalmsg)r   r   rX  formatr,  rS  rT  casesr  r   s         r   test_expandtabszTestUnicode.test_expandtabs  sN    #VN ;AVAYacjjmD r   c                    t        t              t        t              g}ddg}g d}|D ]b  }t        dd      D ]Q  }t	        ||      D ]@  \  }}| j                  |j                  ||       |||      |j                  ||             B S d y )Nz,Results of "{}".expandtabs({}) must be equalz4Results of "{}".expandtabs(tabsize={}) must be equalr  rk  rc  r  )r   r   r   r  ziprX  rl  r  )r,  fnsmessagesr  r   r   fnr  s           r   test_expandtabs_with_tabsizez(TestUnicode.test_expandtabs_with_tabsize  s    349:<BJLN A R="31GB$$RZZ7%;R7^),Aw)? % A  2 ) r   c                 $   t         }t        |      }t        j                  t        f}| j                  t              5 } |dd       d d d        dj                  |      }| j                  |t        j                               y # 1 sw Y   @xY w)Nr  333333@z"tabsize" must be {}, not float)r   r   r   IntegerintassertRaisesr   r  assertInstr	exception)r,  rS  rT  accepted_typesraisesr  s         r   ,test_expandtabs_exception_noninteger_tabsizez8TestUnicode.test_expandtabs_exception_noninteger_tabsize)  so    0V---{+v$ ,/66~Fc3v//01 ,+s   
BBc           	          t         }t        |      }g d}g d}ddg}|t        z   D ]@  }dd|d d |dd  |||z   g}||z   |z   D ]"  }| j                   |||       |||             $ B y )	Nhello
helloworldr   
her  r  ellor   lowolor  r  ohellohellohellor?  r   r&      r   r   rW  rX  )	r,  rS  rT  cpython_strcpython_subs
extra_subsr   default_subsprefixs	            r   test_startswith_defaultz#TestUnicode.test_startswith_default3  s    #V1
 (-
//AQsVQqrUAq1u=L&5
B  6!2E!V4DE C 0r   c                    t         }t        |      }g d}g d}ddg}|t        z   D ]`  }dd|d d |dd  |||z   g}||z   |z   D ]B  }t        t	        d	d
            d gz   D ]$  }	| j                   ||||	       ||||	             & D b y Nr  r  r  r?  r   r&   r  r  rd  )r   r   rW  listr  rX  )
r,  rS  rT  r  r  r  r   r  r  r]   s
             r   test_startswith_with_startz&TestUnicode.test_startswith_with_startB  s    3V1
 (-
//AQsVQqrUAq1u=L&5
B!%R.1TF:E$$VAvu%=%*1fe%<> ; C 0r   c                 V   t         }t        |      }g d}g d}ddg}|t        z   D ]  }dd|d d |dd  |||z   g}||z   |z   D ]b  }t        t	        d	d
            d gz   D ]D  }	t        t	        d	d
            d gz   D ]&  }
| j                   ||||	|
       ||||	|
             ( F d  y r  r   r   rW  r  r  rX  )r,  rS  rT  r  r  r  r   r  r  r]   ra   s              r   test_startswith_with_start_endz*TestUnicode.test_startswith_with_start_endS  s    2V1
 (-
//AQsVQqrUAq1u=L&5
B!%R.1TF:E#E#rN3tf<((65#)F).q&%)EG  = ; C 0r   c                    d}| j                  t        |      5  t        t              } |dd       d d d        d}| j                  t        |      5  t        t              } |ddd       d d d        d}| j                  t        |      5  t        t
              } |dddd	       d d d        y # 1 sw Y   xY w# 1 sw Y   QxY w# 1 sw Y   y xY w)
Nz9The arg 'prefix' should be a string or a tuple of stringsr  )r  r  z:When specified, the arg 'start' must be an Integer or Noner  zinvalid startz8When specified, the arg 'end' must be an Integer or Noner   zinvalid end)assertRaisesRegexr   r   r   r   r   )r,  msg_invalid_prefixrT  msg_invalid_startmsg_invalid_ends        r   &test_startswith_exception_invalid_argsz2TestUnicode.test_startswith_exception_invalid_argse  s    G 	##K1CD+,E'9% E
 I 	##K1BC;<E'41 D
 G 	##KA:;E'4M2 BA ED DC BAs#   B0B<C0B9<CCc           	          t         }t        |      }g d}g d}ddg}|t        z   D ]D  }dd|d d |dd  |||z   g}||z   |z   D ]&  }|d	f}	| j                   |||	       |||	             ( F y )
Nr  r  r  r?  r   r&   r  r  r  r  )
r,  rS  rT  r  r  r  r   r  sub_strr  s
             r   test_startswith_tuplez!TestUnicode.test_startswith_tuplex  s    #V1
 (-
//AQsVQqrUAq1u=L',6C!4  6!2!&q&!13 D 0r   c                 ^   t         }t        |      }g d}g d}ddg}|t        z   D ]  }dd|d d |dd  |||z   g}||z   |z   D ]f  }t        t	        d	d
            d gz   D ]H  }	t        t	        d	d
            d gz   D ]*  }
|df}| j                   ||||	|
       ||||	|
             , J h  y )Nr  r  r  r?  r   r&   r  r  r  rd  r  r  )r,  rS  rT  r  r  r  r   r  r  r]   ra   r  s               r   test_startswith_tuple_argsz&TestUnicode.test_startswith_tuple_args  s    2V1
 (-
//AQsVQqrUAq1u=L',6C!%R.1TF:E#E#rN3tf<")4((65#)F).q&%)EG  = ; D 0r   c           
          t         }t        |      }g d}g d}ddg}|t        z   D ]T  }dd|d d |dd  |||z   g}||z   |z   D ]6  }d	}	| j                   |||       |||      |	j	                  ||      
       8 V y )Nr  r  r  r?  r   r&   r  r  z)Results "{}".endswith("{}") must be equalr  r   r   rW  rX  r  )
r,  rS  rT  r  r  r  r   r  r  r  s
             r   test_endswith_defaultz!TestUnicode.test_endswith_default  s    !V 2
 (-
//AQsVQqrUAq1u=L',6CA  7!3U1g5F%(ZZ7%; ! = D 0r   c                 @   t         }t        |      }g d}g d}ddg}|t        z   D ]u  }dd|d d |dd  |||z   g}||z   |z   D ]W  }t        t	        d	d
            d gz   D ]9  }	d}
| j                   ||||	       ||||	      |
j                  |||	             ; Y w y )Nr  r  r  r?  r   r&   r  r  r  rd  z-Results "{}".endswith("{}", {}) must be equalr  )r   r   rW  r  r  rX  r  )r,  rS  rT  r  r  r  r   r  r  r]   r  s              r   test_endswith_with_startz$TestUnicode.test_endswith_with_start  s    1V 2
 (-
//AQsVQqrUAq1u=L',6C!%R.1TF:EIC$$VAw%>%*1gu%=),Aw)F % H ; D 0r   c                    t         }t        |      }g d}g d}ddg}|t        z   D ]  }dd|d d |dd  |||z   g}||z   |z   D ]x  }t        t	        d	d
            d gz   D ]Z  }	t        t	        d	d
            d gz   D ]<  }
d}| j                   ||||	|
       ||||	|
      |j                  |||	|
             > \ z  y )Nr  r  r  r?  r   r&   r  r  r  rd  OResults "{}".endswith("{}", {}, {})                               must be equalr  r   r   rW  r  r  rX  r  )r,  rS  rT  r  r  r  r   r  r  r]   ra   r  s               r   test_endswith_with_start_endz(TestUnicode.test_endswith_with_start_end  s    0V 2
 (-
//AQsVQqrUAq1u=L',6C!%R.1TF:E#E#rN3tf<.((7E3)G).q'5#)F-0ZZ7E3-O ) Q  = ; D 0r   c           
         t         }t        |      }g d}g d}ddg}|t        z   D ]X  }dd|d d |dd  |||z   g}||z   |z   D ]:  }d	}	|d
f}
| j                   |||
       |||
      |	j	                  ||
             < Z y )Nr  r  r  r?  r   r&   r  r  z'Results "{}".endswith({}) must be equalr  r  r  )r,  rS  rT  r  r  r  r   r  r  r  
tuple_subss              r   test_endswith_tuplezTestUnicode.test_endswith_tuple  s    !V 2
 (-
//AQsVQqrUAq1u=L',6C?%t_
  :!6!&q*!5%(ZZ:%> ! @ D 0r   c                    t         }t        |      }g d}g d}ddg}|t        z   D ]  }dd|d d |dd  |||z   g}||z   |z   D ]|  }t        t	        d	d
            d gz   D ]^  }	t        t	        d	d
            d gz   D ]@  }
d}|df}| j                   ||||	|
       ||||	|
      |j                  |||	|
             B ` ~  y )Nr  r  r  r?  r   r&   r  r  r  rd  r  r  r  r  )r,  rS  rT  r  r  r  r   r  r  r]   ra   r  r  s                r   test_endswith_tuple_argsz$TestUnicode.test_endswith_tuple_args  s    0V 2
 (-
//AQsVQqrUAq1u=L',6C!%R.1TF:E#E#rN3tf<.&-t_
((:uc)J).q*eS)I-0ZZ:8=s.D ) E	  = ; D 0r   c                     t         }t        |      }t        D ]I  }dd|d d d   |d d |dd  |||z   g}|D ]*  }| j                   |||       |||      d|d|d       , K y )	Nr   xxrk  r  r  'z' in ''?)rH   r   rW  rX  )r,  rZ  rS  rT  rH  extrassubstrs          r   test_inzTestUnicode.test_in	  sz    V!A$$B$3B121q5AF   !2!&vq!14:A!>@ ! "r   c                    | j                          t        }t        |      }||fD ]N  }| j                  t              5 } |dd       d d d        | j                  dt        j                               P t        j                  t        j                  f}| j                  t              5 } |dd        d d d        dj                  |      }| j                  |t        j                               y # 1 sw Y   xY w# 1 sw Y   LxY wNrH  r   empty separatorz"sep" must be {}, not none)disable_leak_checkrU   r   r  
ValueErrorr  r  r  r   UnicodeTypeUnicodeCharSeqr   r  r,  rS  rT  funcr  r  r  s          r   $test_partition_exception_invalid_sepz0TestUnicode.test_partition_exception_invalid_sep  s    !"V UOD"":.&S" /MM+S1A1A-BC $
  ++U-A-AB{+v#t ,*11.Ac3v//01 /.
 ,+   
C5,
D5C>	D
c           	          t         }t        |      }g d}d}|D ]7  \  }}| j                   |||       |||      |j                  ||             9 y )N	r      ⚡abcabcr  r6  r     🐍⚡🐍r  abababarH  r  r8  r  r   r  r:  r  rI  z-Results of "{}".partition("{}") must be equalr  )rU   r   rX  r  r,  rS  rT  CASESr  r   rT   s          r   test_partitionzTestUnicode.test_partition%  s]    "V

 >FAsVAs^U1c]!$As!3  5 r   c                 \   t         }t        |      }t        D cg c]  }|dd|d d |dd  |gf }}dg dfdg dfd	d
gfdd
gfddgfdg dfdddgfddgfddgfddgfg
}||z   D ]@  \  }}|D ]6  }d}	| j                   |||       |||      |	j	                  ||             8 B y c c}w )Nr   r  r  r  uf   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaĂrA  u   ȁu   Ġu   Ƞuh   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa􀌄   􀌄u   􀈄u   􂀄   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂarH    􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄a  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄ĂrA  daaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa)rA  r  rK  u   a􀌄   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂr  u   Ă􀌄   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂa_a_  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄a_  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄Ă_   Ă_z%Results "{}".find("{}") must be equalr  )rY   r   rW  rX  r  )
r,  rZ  rS  rT  r   r  r  subsr  r  s
             r   	test_findzTestUnicode.test_find9  s   V 8H
7G!QT1Sb61QR5!,-7G 	 
 "#KL% (6 7!C5)%u-*XJ7JKl,>?@"TF+&/+i[9
 $l2GAt=  7!3U1g5F%(ZZ7%; ! =   3%
s   B)c                 
   t         }t        |      }t        D ]i  }dd|d d |dd  |fD ]W  }t        t	        dd            d gz   D ]9  }d}| j                   ||||       ||||      |j                  |||             ; Y k y )	Nr   r  r  r  r  rd  z)Results "{}".find("{}", {}) must be equalr  )r^   r   rW  r  r  rX  r  r,  rS  rT  r   r  r]   r  s          r   test_find_with_start_onlyz%TestUnicode.test_find_with_start_onlyU  s    -V!AafaeQ7!%R.1TF:EEC$$VAw%>%*1gu%=),Aw)F % H ; 8 "r   c                 2   t         }t        |      }t        t        dd            d gz   x}}t        D ]b  }dd|d d |dd  |fD ]P  }t        ||      D ]?  \  }}d}	| j                   |||||       |||||      |	j                  ||||             A R d y )	Nr  rd  r   r  r  r  z0Results of "{}".find("{}", {}, {}) must be equalr  )rb   r   r  r  rW  r   rX  r  
r,  rS  rT  startsendsr   r  r]   ra   r  s
             r   test_find_with_start_endz$TestUnicode.test_find_with_start_enda  s    ,VU3^,v55!AafaeQ7")&$"7JE3LC$$VAws%C%*1guc%B),Aws)K % M #8 8 "r   c                 T   t         }t        |      }t        j                  t        j                  f}dD ]f  \  }}}| j                  t              5 } |dd||       d d d        dj                  ||      }| j                  |t        j                               h y # 1 sw Y   CxY wN))皙?   r]   )r         ?ra   r2  sciz"{}" must be {}, not float)rb   r   r   r  NoneTyper  r   r  r  r  r  )	r,  rS  rT  acceptedr]   ra   namer  r  s	            r   (test_find_exception_noninteger_start_endz4TestUnicode.test_find_exception_noninteger_start_endn  s    ,VMM5>>2 DE3"";/6gueS1 0.55dHECMM#s6#3#345	 !E//s   BB'	c                    | j                          t        }t        |      }||fD ]N  }| j                  t              5 } |dd       d d d        | j                  dt        j                               P t        j                  t        j                  f}| j                  t              5 } |dd        d d d        dj                  |      }| j                  |t        j                               y # 1 sw Y   xY w# 1 sw Y   LxY wr  )r  re   r   r  r  r  r  r  r   r  r  r   r  r  s          r   %test_rpartition_exception_invalid_sepz1TestUnicode.test_rpartition_exception_invalid_sepy  s    !#V UOD"":.&S" /MM+S1A1A-BC $
  ++U-A-AB{+v#t ,*11.Ac3v//01 /.
 ,+r  c           	          t         }t        |      }g d}d}|D ]7  \  }}| j                   |||       |||      |j                  ||             9 y )Nr  z.Results of "{}".rpartition("{}") must be equalr  )re   r   rX  r  r  s          r   test_rpartitionzTestUnicode.test_rpartition  s]    #V

 ?FAsVAs^U1c]!$As!3  5 r   c                     t         }t        |      }d}t        D ]<  \  }} |||      } |||      }| j                  |||j	                  ||||             > y )Nz6'{0}'.py_count('{1}') = {2}
'{0}'.c_count('{1}') = {3})ri   r   UNICODE_COUNT_EXAMPLESrX  r  )r,  rS  rT  	error_msgr   sub	py_resultc_results           r   
test_countzTestUnicode.test_count  s`    VM	,FAsq#IQ}HY&--aiJL -r   c                 V   t         }t        |      }ddz  }t        D ]  \  }}t        dd      D ]<  } ||||      } ||||      }| j	                  |||j                  |||||             >  |||d       } |||d       }| j	                  |||j                  ||d ||              y )N%s
%s)z '{0}'.py_count('{1}', {2}) = {3}z'{0}'.c_count('{1}', {2}) = {4}   )rk   r   r   r  rX  r  )	r,  rS  rT  r!  r   r"  r7   r#  r$  s	            r   test_count_with_startz!TestUnicode.test_count_with_start  s    )V  C C	 -FAs3^"1c1-	 C+  H!*!1!1!S!Y2:"<= $ q#t,IQT*HY&--adI.689 -r   c                    t         }t        |      }ddz  }t        D ]  \  }}t        t	        dd      d      D ]B  \  }} |||||      } |||||      }	| j                  ||	|j                  ||||||	             D t	        dd      D ]?  } |||d |      } |||d |      }	| j                  ||	|j                  ||d |||	             A  |||d d       } |||d d       }	| j                  ||	|j                  ||d d ||	              y )Nr'  )%'{0}'.py_count('{1}', {2}, {3}) = {4}z$'{0}'.c_count('{1}', {2}, {3}) = {5}r(  r)  )r(  r)  )rn   r   r   r   r  rX  r  )
r,  rS  rT  r!  r   r"  r7   jr#  r$  s
             r   test_count_with_start_endz%TestUnicode.test_count_with_start_end  sG   -V  H H	 -FAsc2	:1"1c1a0	 CA.  H!*!1!1!S!Q	2:"<= ; 3^"1c43	 Cq1  H!*!1!1!S$92:"<= $ q#tT2IQT40HY&--adD).689# -r   c                 >   t        t              }| j                  t              5 } |dddd       d d d        | j	                  dt        j                               | j                  t              5 } |dddd       d d d        | j	                  dt        |j                               | j                  t              5 } |dddd       d d d        | j	                  d	t        |j                               y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   GxY w)
Nr2  r   r  r  ,The slice indices must be an Integer or Noneg333333?      z(The substring must be a UnicodeType, not)r   rn   r  r   r  r  r  r,  rT  r  s      r   test_count_arg_type_checkz%TestUnicode.test_count_arg_type_check  s    12{+v'33' ,D&**+	- {+v'3Q' ,D&**+	- {+v'2q!$ ,@&**+	- ,+
 ,+
 ,+s#   C;3DD;DDDc                 d   t         fd}| j                  t              5 } |dddd       d d d        | j                  dt	        j
                               ddz  }t        j                  t        j                  t        j                  t        j                  t        j                        t        j                  t        j                              } t        |g            } dddd	      } |dddd	      }| j                  |||j                  dddd	||             y # 1 sw Y   xY w)
Nc                     t        j                  t         j                  t         j                  t        j                  t         j                        t        j                  t         j                              } t        |g             y r$   )r   int64unicode_typeOptionalfloat64r   )argsbad_sigrS  s     r   try_compile_bad_optionalzPTestUnicode.test_count_optional_arg_type_check.<locals>.try_compile_bad_optional  sU    kk%"4"4"'"4"4"'.."?"'.."?AG D'OF#r   	   tú quis?u   tú皙?r0  r'  )r,  z''{0}'.c_count_op('{1}', {2}, {3}) = {5}r      )rn   r  r   r  r  r  r   r7  r8  r9  r   rX  r  )	r,  r=  r  r!  sig_optionalcfunc_optionalr#  r$  rS  s	           @r   "test_count_optional_arg_type_checkz.TestUnicode.test_count_optional_arg_type_check  s   -	$ {+v$[%cB ,D&**+	-   K K	{{5#5#5#(#5#5#(>>%++#>#(>>%++#>@ .|n-f5;q!4	!+ua;H"))+uaI*24	5 ,+s   D&&D/c                 f   t         }t        |      }t        D cg c]  }|dd|d d |dd  |gf }}dg dfdg dfd	d
dgfddgfddgfddgfdg dfdddgfddgfddgfddgfg}||z   D ]@  \  }}|D ]6  }d}| j                   |||       |||      |j	                  ||             8 B y c c}w )Nr   r  r  r  uf   Ăaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar  uh   􀌄aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar  abcdefghiabcabc   aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂrH    a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄  Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄rA  r   )rA  r  u   Ăau   􀌄ar  r  u   􀌄Ă   _aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂ_a  _a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄  _Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄   _Ăz&Results "{}".rfind("{}") must be equalr  )rs   r   rW  rX  r  	r,  rS  rT  r   r  r  r  r  r  s	            r   
test_rfindzTestUnicode.test_rfind  s&   V 8H
7G!QT1Sb61QR5!,-7G 	 
 "#KL% (6 7eR[)!C5)%u-*XJ7JKl,>?@"TF+&/+i[9
 $l2GAt>  7!3U1g5F%(ZZ7%; ! =   3'
s   B.c                 
   t         }t        |      }t        D ]i  }dd|d d |dd  |fD ]W  }t        t	        dd            d gz   D ]9  }d}| j                   ||||       ||||      |j                  |||             ; Y k y )	Nr   r  r  r  r  rd  z*Results "{}".rfind("{}", {}) must be equalr  )ru   r   rW  r  r  rX  r  r
  s          r   test_rfind_with_start_onlyz&TestUnicode.test_rfind_with_start_only%  s    .V!AafaeQ7!%R.1TF:EFC$$VAw%>%*1gu%=),Aw)F % H ; 8 "r   c                 `   t         }t        |      }t        t        dd            d gz   }t        t        dd            d gz   }t        D ]b  }dd|d d |dd  |fD ]P  }t        ||      D ]?  \  }}d}	| j                   |||||       |||||      |	j                  ||||             A R d y )	Nr  rd  r   r  r  r  z1Results of "{}".rfind("{}", {}, {}) must be equalr  )rw   r   r  r  rW  r   rX  r  r  s
             r   test_rfind_with_start_endz%TestUnicode.test_rfind_with_start_end1  s    -VeCn%.E#rN#tf,!AafaeQ7")&$"7JE3MC$$VAws%C%*1guc%B),Aws)K % M #8 8 "r   c                 4   t        t              }t        D ]t  }dD ]m  }| j                  t              5 } |||       d d d        dj                  t        j                        }| j                  |t        j                               o v y # 1 sw Y   RxY w)N)Nr  F
must be {})r   rs   rW  r  r   r  r   r  r  r  r  )r,  rT  r   r  r  r  s         r   test_rfind_wrong_substrz#TestUnicode.test_rfind_wrong_substr?  su    ]#!A+&&{3v!W% 4"))%*;*;<c3v'7'7#89	 , "33s   
BBc           
         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 ]d  \  }}| j                  t              5 } |||||       d d d        d	j                  |      }| j                  |t        j                               f t        ddgd
dg      D ]d  \  }}| j                  t              5 } |||||       d d d        dj                  |      }| j                  |t        j                               f   y # 1 sw Y   xY w# 1 sw Y   SxY w)Nr   r  r  r  r  Frk  r  z"start" must be {}gTz"end" must be {})r   rw   r   r  r  rW  r   r  r   r  r  r  r  )	r,  rT  r  r   r  r]   ra   r  r  s	            r   test_rfind_wrong_start_endz&TestUnicode.test_rfind_wrong_start_endI  s5   12--8!!AafaeQ7")3,Q"@JE3**;76a%5 8.55nECMM#s6+;+;'<=	 #A #*2q'D$<"@JE3**;76a%5 8,33NCCMM#s6+;+;'<=	 #A 8 " 87 87s   5D>	,E
	>E
Ec                    t         d   }|dd }t        j                  t        j                  f}dj	                  |      }d }| j                  t              5 } |||dd       d d d        | j                  |t        j                               d }| j                  t              5 } |||dd       d d d        | j                  |t        |j                               y # 1 sw Y   xY w# 1 sw Y   ;xY w)Nr   r  rk  rV  c                     t        j                  t         j                  t         j                  t        j                  t         j                        t        j                  t         j
                              } t        |g      t               y r$   )r   r7  r8  r9  r:  intpr   rw   r;  wrong_sig_optionals     r    try_compile_wrong_start_optionalzYTestUnicode.test_rfind_wrong_start_end_optional.<locals>.try_compile_wrong_start_optionalc  sY    !&U-?-?-2-?-?-2^^EMM-J-2^^EJJ-G"I 'D$%&'CDr   r  c                     t        j                  t         j                  t         j                  t        j                  t         j                        t        j                  t         j
                              } t        |g      t               y r$   )r   r7  r8  r9  r\  r:  r   rw   r]  s     r   try_compile_wrong_end_optionalzWTestUnicode.test_rfind_wrong_start_end_optional.<locals>.try_compile_wrong_end_optionaln  sY    !&U-?-?-2-?-?-2^^EJJ-G-2^^EMM-J"L 'D$%&'CDr   )
rW  r   r  r  r  r  r   r  r  r  )r,  r   r  r  r  r_  r  ra  s           r   #test_rfind_wrong_start_end_optionalz/TestUnicode.test_rfind_wrong_start_end_optional]  s    QAb'--8!!.1	E {+v,Qa@ ,c3v//01	E {+v*1gq#> ,c3v//01 ,+ ,+s   C#)C/#C,/C8c           
      <   t         }t        |      }t        D cg c]  }|d|d d |dd  |gf }}dg dfddgfddgfd	d
gfddgfddgfddgfg}||z   D ]@  \  }}|D ]6  }d}| j                   |||       |||      |j	                  ||             8 B y c c}w )Nr   r  r  rE  r   defrF  rG  rH  rH  rI  rA  rJ  rK  rL  rM  rN  z'Results "{}".rindex("{}") must be equalr  )r   r   rW  rX  r  rO  s	            r   test_rindexzTestUnicode.test_rindexy  s    V 2B
1AAQQsVQqrUA&'1A 	 
 /0!C5)%u-*XJ7"TF+&/+i[9
 $l2GAt?  7!3U1g5F%(ZZ7%; ! =   3
   Bc           
      <   t         }t        |      }t        D cg c]  }|d|d d |dd  |gf }}dg dfddgfddgfd	d
gfddgfddgfddgfg}||z   D ]@  \  }}|D ]6  }d}| j                   |||       |||      |j	                  ||             8 B y c c}w )Nr   r  r  rE  rd  r  rH  r  r  rA  r  r  r  r  r  z&Results "{}".index("{}") must be equalr  )r   r   rW  rX  r  rO  s	            r   
test_indexzTestUnicode.test_index  s    V 2B
1AAQQsVQqrUA&'1A 	 
 /0!C5)%u-*XJ7"TF+&/+i[9
 $l2GAt>  7!3U1g5F%(ZZ7%; ! =   3
rg  c                 4   t         t        g}ddg}g d}t        ||      D ]  \  }}t        |      }|D ]  }t	        |      }dt        t        d|dz               f|d d dgt        t        dd|z
              z   f|d	d  t        t        d
            t        t        dd
|z
              z   f|dgt        t        dd|z
              z   fg}	|	D ]E  \  }
}|d gz   D ]7  }| j                   |||
|       |||
|      |j                  ||
|             9 G   y )Nz*Results "{}".index("{}", {}) must be equalz+Results "{}".rindex("{}", {}) must be equalr2  r3  r4  r5  r    r   r  r  r   r     r  )	r   r   r  r   r/   r  r  rX  r  )r,  pyfuncsr  unicode_examplesrS  r  rT  r   r   r  r  r  r]   s                r   !test_index_rindex_with_start_onlyz-TestUnicode.test_index_rindex_with_start_only  sA   013@AC
 w1KFCLE%FeCQ/01sVaS4c1q5(9#::;qrUDqNT%QU2C-DDEd5a!e#4556	 (-OGV!'4&((7E)B).q'5)A-0ZZ7E-J ) L "1 (- & 2r   c                    t         t        g}ddg}g d}t        ||      D ]^  \  }}t        |      }|D ]G  }t	        |      }dt        t        d|dz               t        t        |d            f|d d d	gt        t        dd|z
              z   dd
gt        t        |dz
  d            z   f|dd  t        t        d            t        t        dd
            z   t        t        |d            f|d	gt        t        dd|z
              z   t        t        |d            fg}	|	D ]V  \  }
}}t        |d gz   |      D ]=  \  }}| j                   |||
||       |||
||      |j                  ||
||             ? X J a y )Nz1Results of "{}".index("{}", {}, {}) must be equalz2Results of "{}".rindex("{}", {}, {}) must be equalrk  r   rl  r  rc  r  r   rk  rr  r  rm  r  )
r   r   r  r   r/   r  r  r   rX  r  )r,  rn  r  ro  rS  r  rT  r   r   r  r  r  r  r]   ra   s                  r    test_index_rindex_with_start_endz,TestUnicode.test_index_rindex_with_start_end  s   /1NOGHJ
 w1KFCLE%FeCQ/0$uQ|2DEsVaS4c1q5(9#::"XU1q5"%5 668qrUDqNT%R.-AA%2,')d5a!e#455tE!RL7IJ .3)GVT&-fvot&D
s((7E3)G).q'5#)F-0ZZ7E3-O ) Q 'E .3 & 2r   c                 p   | j                          g d}t        t        g}|D ]  }t        |      }|D ]  }t	        |      }dt        t        |dz   d            |gf|d d dgt        t        |dz
              f|dd  t        t        d	d            |gf|d gt        t        |            fg}|D ]s  \  }}	}
t        |	|
      D ]^  \  }}||fD ]R  }| j                  t              5 } |||||       d d d        d
}| j                  |t        j                               T ` u   y # 1 sw Y   <xY w)Nrk  r   r  rc  r  r   rr  r  rm  zsubstring not found)r  r   r   r   r/   r  r  r   r  r  r  r  r  )r,  ro  rn  rS  rT  r   r   r  r  r  r  r]   ra   r  r  r  s                   r   /test_index_rindex_exception_substring_not_foundz;TestUnicode.test_index_rindex_exception_substring_not_found  s<   !
 01NOFLE%FeAE2./!5sVaS$uQU|"45qrUDq".4U1X/	 .3)GVT&-fd&;
s%+UOD!%!2!2:!>& $Q < "?"7C MM#s63C3C/DE	 %4 '< .3 &  "?!>s   %D,,D5c           	      n   t         j                  t         j                  f}t        t        g}|D ]x  }t        |      }dD ]f  \  }}}| j                  t              5 } |dd||       d d d        dj                  ||      }	| j                  |	t        j                               h z y # 1 sw Y   ExY wr  )r   r  r  r   r   r   r  r   r  r  r  r  )
r,  r  rn  rS  rT  r]   ra   r  r  r  s
             r   0test_index_rindex_exception_noninteger_start_endz<TestUnicode.test_index_rindex_exception_noninteger_start_end  s    MM5>>2/1NOFLE$H sD&&{3v'5%5 4299$Ic3v'7'7#89	 %I  43s   B++B4c           	          t         }t        |      }t        D ]L  }t        t	        |       t	        |            D ](  }| j                   |||       |||      d||fz         * N y )N	'%s'[%d]?)r8   r   rW  r  r/   rX  )r,  rS  rT  r   r7   s        r   test_getitemzTestUnicode.test_getitem
  s`     V!ACF7CF+  1!&q!!,1v!57 , "r   c           	          t         }t        |      }ddg}|D ]L  }t        t        |       t        |            D ](  }| j	                   |||       |||      d||fz         * N y )Nu   aሴu   ¡着rx  )r;   r   r  r/   rX  )r,  rS  rT  samplesr   r7   s         r   test_getitem_scalar_kindz$TestUnicode.test_getitem_scalar_kind  sl     ,Vg&ACF7CF+  1!&q!!,1v!57 , r   c                    | j                          t        }t        |      }t        D ]  }| j	                  t
              5 } ||t        |             d d d        | j                  dt        j                               | j	                  t
              5 } ||t        |             d d d        | j                  dt        |j                                y # 1 sw Y   xY w# 1 sw Y   =xY w)Nzstring index out of range)
r  r8   r   rW  r  
IndexErrorr/   r  r  r  )r,  rS  rT  r   r  s        r   test_getitem_errorzTestUnicode.test_getitem_error!  s    ! V!A"":.&q#a&! /MM5s6;K;K7LM"":.&aQ  /MM5s6;K;K7LM ".. /.s    CC$C!	$C-	c                 V   t         }t        |      }t        D ]  }t        t	        t        |       t        |                  D ]b  }t        t	        t        |       t        |                  D ]5  }t        ||      }| j                   |||       |||      d|||fz         7 d  y )N'%s'[%d:%d]?)r8   r   rW  r  r  r/   slicerX  r,  rS  rT  r   r7   r-  sls          r   test_slice2zTestUnicode.test_slice20  s     V!A%QQ01eSVGSV45Aq!B$$VAr]%*1b\%3q!Qi%?A 6 2 "r   c                 "   t         }t        |      }t        D ]u  }ddt        |      t        |      dz   fD ]U  }ddt        |      t        |      dz   fD ]5  }t	        ||      }| j                   |||       |||      d|||fz         7 W w y )Nr  rk  r  r  r8   r   rW  r/   r  rX  r  s          r   test_slice2_errorzTestUnicode.test_slice2_error<  s     V!A"c!fc!fqj1b#a&#a&1*5Aq!B$$VAr]%*1b\%3q!Qi%?A 6 2 "r   c                 .   t         }t        |      }ddg}|D ]{  }dddddt        |      t        |      dz   fD ]X  }dddddt        |      t        |      dz   fD ]5  }t        ||      }| j	                   |||       |||      d|||fz         7 Z } y )	N	   abcሴሴu   ¡¡¡着着着r  rk  r   r  rr  r  )r;   r   r/   r  rX  )r,  rS  rT  r{  r   r7   r-  r  s           r   test_getitem_slice2_kindz$TestUnicode.test_getitem_slice2_kindH  s     ,V$&78A"aAs1vs1vz:b!Q3q63q6A:>Aq!B$$VAr]%*1b\%3q!Qi%?A ? ; r   c                 D   t         }t        |      }t        D ]  }t        t	        |       t	        |            D ]b  }t        t	        |       t	        |            D ]>  }dD ]7  }t        |||      }| j                   |||       |||      d||||fz         9 @ d  y )Nr  rk  r  rr  '%s'[%d:%d:%d]?)r8   r   rW  r  r/   r  rX  r,  rS  rT  r   r7   r-  kr  s           r   test_slice3zTestUnicode.test_slice3V  s     V!ACF7CF+AwA/A+"1a^((2).q"):aAq\)IK , 0 , "r   c                 D   t         }t        |      }g d}|D ]  }t        t        |       t        |            D ]b  }t        t        |       t        |            D ]>  }dD ]7  }t	        |||      }| j                   |||       |||      d||||fz         9 @ d  y )N)r  u   aሴbሴc¡¡¡着着着u   ¡着¡着¡着u   着a着b着cu   ¡着a¡着b¡着cu   ¡着a着¡cr  r  )r;   r   r  r/   r  rX  )	r,  rS  rT  r{  r   r7   r-  r  r  s	            r   test_getitem_slice3_kindz$TestUnicode.test_getitem_slice3_kindc  s     ,V$ ACF7CF+AwA/A+"1a^((2).q"):aAq\)IK , 0 , r   c                 4   t         }t        |      }t        D ]~  }ddt        |      t        |      dz   fD ]^  }ddt        |      t        |      dz   fD ]>  }dD ]7  }t	        |||      }| j                   |||       |||      d||||fz         9 @ `  y )Nr  rk  r  r  r  r  r  s           r   test_slice3_errorzTestUnicode.test_slice3_errorx  s     V!A"c!fc!fqj1b#a&#a&1*5A+"1a^((2).q"):aAq\)IK , 6 2 "r   c                 P    t         d        }d}| j                   ||      d       y)z
        Make sure ascii flag is False when ascii and non-ascii characters are
        mixed in output of Unicode slicing.
        c                 J    | d d d   j                   | dd d   j                   fS )Nrr  r  	_is_asciir   s    r   fz,TestUnicode.test_slice_ascii_flag.<locals>.f  s+    SqS6##Qqt!tW%6%666r   u    ¿abc¡Y tú, quién te cre		es?)r   r  Nr   rX  r,  r  r   s      r   test_slice_ascii_flagz!TestUnicode.test_slice_ascii_flag  s1    
 
	7 
	7 11v&r   c           	      T   t         }t        |      }g d}| j                  t              5 } ||d   d       d d d        | j	                  dt        j                               |D ]3  }t        dd      D ]"  }| j                   |||       |||             $ 5 y # 1 sw Y   gxY w)N)r2  z+asciiz-asciiz-asc ii-r3  z-12345z+12345r   u   ¡Y tú crs?r6  u   +🐍⚡u   -🐍⚡u   大眼，小手。u   +大眼，小手。u   -大眼，小手。r   r?  z<width> must be an Integerrd  )	r>   r   r  r   r  r  r  r  rX  )r,  rS  rT  ZFILL_INPUTSr  r   widths          r   
test_zfillzTestUnicode.test_zfill  s    V
$ {+v,q/3' ,2C8H8H4IJAr2  5!1!&q%2 ' 	 ,+s   BB'c                     t         }t        |      }t        D ];  }t        d d d   D ]*  }| j                   |||       |||      d|d|d       , = y Nrk  r  z' + 'r  )rA   r   rW  rX  r^  s         r   test_concatzTestUnicode.test_concat  sT    V!A%dd+  1!&q!34a!8: , "r   c           	          t         }t        |      }t        D ]I  }dD ]B  }| j                   |||       |||             | j                   |||       |||             D K y )N)rk  r   r  rr  r  rm  r  r1  r@     F   )rD   r   rW  rX  r^  s         r   test_repeatzTestUnicode.test_repeat  sb    V!A9  1!&q!.  1!&q!. : "r   c                     | j                          t        t              }| j                  t              5 } |dd       d d d        | j                  t        dz   t        j                               y # 1 sw Y   6xY w)Nhig      @z" Function(<built-in function mul>))	r  r   rD   r  r   r  r   r  r  r3  s      r   test_repeat_exception_floatz'TestUnicode.test_repeat_exception_float  sb    !^${+v$ ,l%II&**+	- ,+s   
A44A=c                    | j                          t        }t        |      }||fD ]N  }| j                  t              5 } |dd       d d d        | j                  dt        j                               P y # 1 sw Y   1xY wNrH  r   r  )r  r   r   r  r  r  r  r  r,  rS  rT  r  r  s        r   test_split_exception_empty_sepz*TestUnicode.test_split_exception_empty_sep  sk    !V UOD"":.&S" /MM+S1A1A-BC $..   
A88B	c                     t         }t        |      }dD ]S  }| j                  t              5 } |d|d       d d d        | j	                  dt        j                        d|z         U y # 1 sw Y   5xY w)Nr?  NrH  r  r:  z"non-integer maxsplit with sep = %s)r   r   r  r   r  r  r  )r,  rS  rT  rT   r  s        r   (test_split_exception_noninteger_maxsplitz4TestUnicode.test_split_exception_noninteger_maxsplit  sh    ,V C"";/6c3$ 0MM)S)9)9%:>DF //s   A++A4	c           
          t         }t        |      }g d}|D ]-  \  }}| j                   |||       |||      d|d|d       / y )N
) a Nr  r  r  r  r  r  r  r  r  r  z	'.split('')?)r   r   rX  )r,  rS  rT  r  test_strsplitters         r   
test_splitzTestUnicode.test_split  sR    V
 #(HhVHh7"8X64<hGI #(r   c           
          g d}t         dft        dffD ]D  \  }}t        |      }|D ]/  \  }}}| j                   ||||       ||||      ||||fz         1 F y )N
)r  Nr  )r   r  r  )r  r  r  )r6  r  r  )r  r  r  )r  rH  rr  )r  r8  r  )r  r   rr  )r  r:  r  )r  rI  r  z'%s'.split('%s', %d)?z'%s'.split('%s', maxsplit=%d)?)r   r   r   rX  )r,  r  rS  fmt_strrT  r  r  r   s           r   test_split_with_maxsplitz$TestUnicode.test_split_with_maxsplit  s    
 "=!8!:!B!A!C DOFG
 LE05,(H  (H!E!&x8!D!(Hh+I!IK 16 Dr   c                     t         }t        |      }dj                  t        t        g d            }ddddddd|z   d	z   g}|D ]%  }| j                   ||       ||      d
|d       ' y )Nr   	   rc     r2                           i  i    i   i   i   i   i   i   i   i   i	   i
   i(   i)   i/   i_   i 0  r     🐍 ⚡   🐍 ⚡ 🐍   🐍   ⚡ 🐍       🐍   ⚡ 🐍    🐍
   ⚡ 🐍  r  z
'.split()?)r   r   r   mapr%  rX  )r,  rS  rT  all_whitespacer  r  s         r   test_split_whitespacez!TestUnicode.test_split_whitespace  s     *V S +
 "  n$|3
 HVH-"8_08:< r   c                 b   t         }t        |      }t        j                  t        t        j
                  t        f}dD ]c  \  }}| j                  t              5 } |d|       d d d        dj                  ||      }| j                  |t        j                               e y # 1 sw Y   CxY w)N))noneN)r8  None
z"keepends" must be {}, not {})r   r   r   r  r  Booleanr3   r  r   r  r  r  r  )r,  rS  rT  r  tyr   r  r  s           r   %test_split_exception_invalid_keependsz1TestUnicode.test_split_exception_invalid_keepends.  s    1V--emmTBFLB"";/6dH% 0188LCMM#s6#3#345	 G//s   
B%%B.	c                     t         }t        |      }g d}d}|D ]1  }| j                   ||       ||      |j                  |             3 y )Nr   r  z
abcabc
u   🐍⚡u   🐍⚡🐍u    aba babaz

abcz*Results of "{}".splitlines() must be equalr  )r   r   rX  r  r  s         r   test_splitlineszTestUnicode.test_splitlines9  sN    #VM ;AVAYacjjmD r   c           
          t         t        g}ddg}g d}g d}t        ||      D ]V  \  }}t        |      }t	        ||      D ]7  \  }}	| j                   |||	       |||	      |j                  ||	             9 X y )Nz,Results of "{}".splitlines({}) must be equalz5Results of "{}".splitlines(keepends={}) must be equalr  )TFr   r  rk  d   r  )r   r   r  r   r   rX  r  )
r,  rn  r  r  all_keependsrS  r  rT  r   r   s
             r   test_splitlines_with_keependsz)TestUnicode.test_splitlines_with_keependsD  s    ,2

 ;C
M3w1KFCLE&ul;8  8!4eAx6H%(ZZ8%< ! >  < 2r   c                    | j                          t        }t        |      }||fD ]N  }| j                  t              5 } |dd       d d d        | j                  dt        j                               P y # 1 sw Y   1xY wr  )r  r   r   r  r  r  r  r  r  s        r   test_rsplit_exception_empty_sepz+TestUnicode.test_rsplit_exception_empty_sepW  sk    !V UOD"":.&S" /MM+S1A1A-BC $..r  c                 4   t         }t        |      }t        j                  t        f}dD ]`  }| j                  t              5 } |d|d       d d d        dj                  |      }| j                  |t        j                               b y # 1 sw Y   BxY w)Nr  rH  r  z "maxsplit" must be {}, not float)r   r   r   r  r  r  r   r  r  r  r  )r,  rS  rT  r  rT   r  r  s          r   )test_rsplit_exception_noninteger_maxsplitz5TestUnicode.test_rsplit_exception_noninteger_maxsplitc  sy    -V---C"";/6c3$ 04;;NKCMM#s6#3#345	 //s   BB	c           	          t         }t        |      }g d}d}|D ]7  \  }}| j                   |||       |||      |j                  ||             9 y )Nr  z*Results of "{}".rsplit("{}") must be equalr  )r   r   rX  r  r  s          r   test_rsplitzTestUnicode.test_rsplitn  s]    V
 ;FAsVAs^U1c]!$As!3  5 r   c                     t         t        g}g d}ddg}t        ||      D ]P  \  }}t        |      }|D ];  \  }}}	| j	                   ||||	       ||||	      |j                  |||	             = R y )Nr  z.Results of "{}".rsplit("{}", {}) must be equalz7Results of "{}".rsplit("{}", maxsplit={}) must be equalr  )r   r   r  r   rX  r  )
r,  rn  r  r  rS  r  rT  r  rT   r   s
             r   test_rsplit_with_maxsplitz%TestUnicode.test_rsplit_with_maxsplit  s    /57
 =E

 w1KFCLE+0'#x  #x!@!&xh!?%(ZZ#x%H ! J ,1 2r   c                     t         }t        |      }dj                  t        t        g d            }ddddddd|z   d	z   g}d
}|D ]0  }| j                   ||       ||      |j                  |             2 y )Nr   r  r  r  r  r  r  r  r  z&Results of "{}".rsplit() must be equal)r   r   r   r  r%  rX  r  )r,  rS  rT  r  r  r  r   s          r   test_rsplit_whitespacez"TestUnicode.test_rsplit_whitespace  s    *V S +
 "  n$|3
 7AVAYa#**Q-@ r   c                     t         }t        |      }ddg}|D ]%  }| j                   ||       ||      d|d       ' y )Nr      🐍🐍🐍r  z'.join([])?)r   r   rX  )r,  rS  rT  r  rT   s        r   test_join_emptyzTestUnicode.test_join_empty  sN     $V 

 CVC["3Z1468 r   c                    t         }t        |      }| j                  t              5 } |dg d       d d d        t	        j
                        }| j                  d|       | j                  d|       y # 1 sw Y   CxY w)Nr   )r  rr  r  z,During: resolving callee type: BoundFunctionzreflected list(int)r   r   r  r   r  r  r  )r,  rS  rT  r  exc_messages        r   test_join_non_string_exceptionz*TestUnicode.test_join_non_string_exception  so    V {+v"i  ,
 &**+:	

 	*K8 ,+s   A55A>c           
          t         }t        |      }dg dfdg dfdg dfddgdz  fg}|D ]-  \  }}| j                   |||       |||      d|d	|d
       / y )Nr   )r   r   r   rH  )rH  bbbbr   r     ⚡⚡r  r  '.join('r  r   r   rX  r,  rS  rT  r  rT   partss         r   	test_joinzTestUnicode.test_join  sz    V ,#$hZ!^,	
  JCVC/"3.36>@  r   c           
          t         }t        |      }ddg}|D ]-  \  }}| j                   |||       |||      d|d|d       / y )N)rF  123)r  r  r  r  r  r  r  s         r   test_join_interleave_strz$TestUnicode.test_join_interleave_str  sY    V &

  JCVC/"3.36>@  r   c                    t         dft        dft        dffD ]  \  }}t        |      }| j	                  t
              5 } |t        d   d       d d d        | j                  dt        j                               t        D ]:  }t        dd      D ])  }| j                   |||       |||      d	|||fz         + <  y # 1 sw Y   txY w)
Nr   r   r   r   r?  The width must be an Integerr  rd  z'%s'.%s(%d)?)r   r   r   r   r  r   rW  r  r  r  r  rX  )r,  rS  	case_namerT  r  r   r  s          r   test_justificationzTestUnicode.test_justification  s    #18"<#0'":#0'":"<FI LE"";/6&q)3/ 0MM8#f>N>N:OP%"2r]E$$VAu%5%*1e_%3q)U6K%KM + &"<
 0/s   CC	c                    t         dft        dft        dffD ]  \  }}t        |      }dD ]  }| j	                  t
              5 } |t        d   d|       d d d        | j                  dt        j                               t        D ]=  }t        dd	      D ],  }| j                   ||||       ||||      d
||||fz         . ?   y # 1 sw Y   yxY w)Nr   r   r   )r?  +   úu   处r   r?  r  r  rd  z'%s'.%s(%d, '%s')?)r   r   r   r   r  r   rW  r  r  r  r  rX  )r,  rS  r   rT  r   r  r   r  s           r   test_justification_fillcharz'TestUnicode.test_justification_fillchar
  s    #:H"E#97"C#97"C"EFI LE 4&&{3v*1-sH= 4<!&"2"235 *A!&r2((5()C).q%)B)=IAFAIAK *KL "/ * 4"E 43s   CCc                    | j                          t        t        t        fD ]  }t	        |      }dD ]V  }| j                  t              5 } |t        d   d|       d d d        | j                  dt        j                               X dD ]V  }| j                  t              5 } |t        d   d|       d d d        | j                  dt        j                               X  y # 1 sw Y   xY w# 1 sw Y   ?xY w)N)r   z+0u   quiénu   处着r   rd  z&The fill character must be exactly one)r  r?  z"The fillchar must be a UnicodeType)r  r   r   r   r   r  r  rW  r  r  r  r   )r,  rS  rT  r   r  s        r   %test_justification_fillchar_exceptionz1TestUnicode.test_justification_fillchar_exception  s    !.--/F LE ;&&z2f*1-r8< 3F!&"2"235 ; %&&{3v*1-r8< 4B!&"2"235 %/ 32 43s   
C)%C5)C25C>c                     t         }t        |      }t        D ];  }t        d d d   D ]*  }| j                   |||       |||      d|d|d       , = y r  )rF   r   rW  rX  r^  s         r   test_inplace_concatzTestUnicode.test_inplace_concat5  sT    'V!A%dd+  1!&q!34a!8: , "r   c                     d }t        |      }g d}g d}d}t        dgz   |z   |z   D ]1  }| j                   ||       ||      |j                  |             3 y )Nc                 "    | j                         S r$   )isidentifierr   s    r   rS  z-TestUnicode.test_isidentifier.<locals>.pyfunc?  s    >>##r   )rH  Zr  b0bcb_   µu   𝔘𝔫𝔦𝔠𝔬𝔡𝔢r?  [   ©0   u   u   u   u   abu   abu	   abau	   abaz,Results of "{}".isidentifier() must be equalr   r  r   rW  rX  r  r,  rS  rT  cpythoncpython_extrasr  r   s          r   test_isidentifierzTestUnicode.test_isidentifier>  sj    	$ VH@ =!RD(72^CAVAYacjjmD Dr   c                    g d}t         dft        dft        dffD ]@  \  }t              }|D ]+  \  }}| j	                   |       ||      d|d|d       - B t
        dft        dft        dffD ]   \  }t              }t        j                  t        j                  t        j                  t        j                              } t        |g            }fd}||fD ]N  }	| j                  t              5 }
 |	d	d
       d d d        | j                  dt        
j                               P ||fD ]7  }	|D ]0  \  }}| j	                   ||       |	||      d|d|d|d       2 9  y # 1 sw Y   rxY w)N))ass ciiai)r  N)assciiai )zasscii r   )	 asscii  r   )r!  zasci )r!  r   )z      r?  )r   r?  r>  )r   Nr  )
  asscii  r   )r"  r   )r"  N)rF     étú? )     tú quién te crees?   r#  )u     tú qrees?   r   )r$  NrE  )    大处大处  r   )z	
abcd	z	a)r%  N)z	 abcd 	N)z
 abcd 
N)z abcd N)z abcd N)z abcd N)u
    abcd N)u	   abcd Nr   r   r   r  z'.z()?c                      t        j                  t         j                  t        j                  t         j                              } t	        |g             y r$   )r   r8  r9  r:  r   )r;  badrS  s     r   r=  z8TestUnicode.test_strip.<locals>.try_compile_bad_optional  s<    ((););).)FHcUF#r   r>  r?  z%The arg must be a UnicodeType or Nonez('r  )r   r   r   r   rX  r   r   r   r   r8  r9  r  r   r  r  r  )r,  STRIP_CASESr   rT  stringr   sig1rB  r=  r  r  rS  s              @r   
test_stripzTestUnicode.test_stripO  s   
D $1'":#18"<#18"<">FI LE!,  !&v17!CE "-"> $7"@#7"B#7"B"DFI LE%%e&8&8&+nnU5G5G&HJD)T4&\&1N$
 55&&{3v{C( 4E!&"2"235 6 ^+%0MFE$$VFE%:%'%69?9>&@A &1 ,)"D 43s   
E<<Fc                     d }t        |      }g d}g d}d}t        dgz   |z   |z   D ]1  }| j                   ||       ||      |j                  |             3 y )Nc                 "    | j                         S r$   )isspacer   s    r   rS  z(TestUnicode.test_isspace.<locals>.pyfunc      99;r   )	u    u    u   —   𐐁   𐐧   𐐩   𐑎   🐍   👯r  z'Results of "{}".isspace() must be equalr   r  r  r  s          r   test_isspacezTestUnicode.test_isspace  sj    	 VK@ 8!RD(72^CAVAYacjjmD Dr   c           
         t         }t        |      }d}t        D cg c]  }|j                          }}g d}t        |z   |z   }|D ]6  } ||      }	 ||      }
| j	                  |	|
|j                  ||	|
             8 y c c}w )Nz0'{0}'.py_istitle() = {1}
'{0}'.c_istitle() = {2})r   z    z  AA  z  Ab  1A123A12Bcdz+abA12AbcA12abcu   %^Abc 5 $% Def𐐁𐐩u   𐐧𐑎r2  r3  u   🐍 Isu   🐍 NOTu   👯Is   ῼu   Greek ῼitlecases ...)r  r   rW  r
  rX  r  )r,  rS  rT  r!  r&   unicode_titlespecialISTITLE_EXAMPLESr   r#  r$  s              r   test_istitlezTestUnicode.test_istitle  s     VG	,<=,<q,<=
, ,m;gE!Aq	IQxHY&--aHEG "3 >s   Bc                     d }t        |      }g d}d}t        |z   D ]1  }| j                   ||       ||      |j                  |             3 y )Nc                 "    | j                         S r$   )isprintabler   s    r   rS  z,TestUnicode.test_isprintable.<locals>.pyfunc  s    ==?"r   )	r   r?  abcdefgzabcdefg
u   ʹu   ͸r  r5  u   󠀠z+Results of "{}".isprintable() must be equalr  r  r,  rS  rT  r  r  r   s         r   test_isprintablezTestUnicode.test_isprintable  sT    	# V9 <!G+AVAYacjjmD ,r   c                 V    d }t        |      }dg}| j                   ||  ||        y )Nc                     | d d  S r$   r!   rH  s    r   rS  z0TestUnicode.test_pointless_slice.<locals>.pyfunc  s    Q4Kr   rH  r  r,  rZ  rS  rT  r;  s        r   test_pointless_slicez TestUnicode.test_pointless_slice  s/    	Vut5r   c                 V    d }t        |      }dg}| j                   ||  ||        y )Nc                     | d d d   S )Nrk  r!   rJ  s    r   rS  z/TestUnicode.test_walk_backwards.<locals>.pyfunc  s    TrT7Nr   rH  r  rK  s        r   test_walk_backwardszTestUnicode.test_walk_backwards  s/    	Vut5r   c                 V    d }t        |      }dg}| j                   ||  ||        y )Nc                     | d d d   S Nrr  r!   rJ  s    r   rS  z-TestUnicode.test_stride_slice.<locals>.pyfunc  s    SqS6Mr   rH  r  rK  s        r   test_stride_slicezTestUnicode.test_stride_slice  s/    	Vut5r   c                 X    d }t        |      }ddg}| j                   ||  ||        y )Nc                     | |k  S r$   r!   rH  r8  s     r   rS  z)TestUnicode.test_basic_lt.<locals>.pyfunc      q5Lr   r:  r8  r  rK  s        r   test_basic_ltzTestUnicode.test_basic_lt  1    	Vc{t5r   c                 X    d }t        |      }ddg}| j                   ||  ||        y )Nc                     | |kD  S r$   r!   rV  s     r   rS  z)TestUnicode.test_basic_gt.<locals>.pyfunc  rW  r   r:  r8  r  rK  s        r   test_basic_gtzTestUnicode.test_basic_gt  rY  r   c           	          d }t        |      }t        t        d      D ]:  \  }}dD ]0  }|||g}| j                   ||  || dj	                  |             2 < y )Nc                 |    | dk(  r||k(  S | dk(  r||k7  S | dk(  r||k  S | dk(  r||kD  S | dk(  r||k  S | dk(  r||k\  S y )N==!=<><=>=r!   optionr&   r*   s      r   rS  z+TestUnicode.test_comparison.<locals>.pyfunc  se    ~Av4Av31u31u4Av4Avr   rr  rs  r_  r`  ra  rb  rc  rd  r   failed on {}r  )r   r   ru  rX  r  )r,  rS  rT  r&   r*   cmpopr;  s          r   test_comparisonzTestUnicode.test_comparison  sm    	  V !:a@DAq?q!}  t%3%:%:4%@ ! B @ Ar   c                     d }t        |      }dg}| j                   ||  ||        dg}| j                   ||  ||        y )Nc                 H    d}t        |       r|dz   | z   dz   S | |z   dz   | z   S )NrF  b123IOr  r.   )r&   rF  s     r   rS  z/TestUnicode.test_literal_concat.<locals>.pyfunc  s5    C1vV|a'$..3w**r   r&   r   r  r,  rS  rT  r;  s       r   test_literal_concatzTestUnicode.test_literal_concat  sP    	+ Vut5tt5r   c                     d }t        |      }dD ].  }|g}| j                   ||  || dj                  |             0 y )Nc                     d}d}| dk(  r||k(  S | dk(  r||k7  S | dk(  r||k  S | dk(  r||kD  S | dk(  r||k  S | dk(  r||k\  S y )	Na123aa12r_  r`  ra  rb  rc  rd  r!   re  s      r   rS  z3TestUnicode.test_literal_comparison.<locals>.pyfunc&  so    AA~Av4Av31u31u4Av4Avr   rg  rh  r  r   rX  r  )r,  rS  rT  ri  r;  s        r   test_literal_comparisonz#TestUnicode.test_literal_comparison%  sP    	$ V;E7DVT]E4L!/!6!6t!<  > <r   c                 X    d }t        |      }| j                   |        |              y )Nc                      t        d      S NrF  r.   r!   r   r   rS  z,TestUnicode.test_literal_len.<locals>.pyfunc?  s    u:r   r  rR  s      r   test_literal_lenzTestUnicode.test_literal_len>  s$    	V57+r   c                     d }t        |      }dddt        dd       t        d d      fD ].  }|g}| j                   ||  || dj                  |             0 y )Nc                     d|    S ry  r!   )whichs    r   rS  z0TestUnicode.test_literal_getitem.<locals>.pyfuncE  s    <r   rk  r   r  rh  r  )r   r  rX  r  r,  rS  rT  rH  r;  s        r   test_literal_getitemz TestUnicode.test_literal_getitemD  se    	 VaE!TNE$O<A3DVT]E4L!/!6!6t!<  > =r   c                     d }t        |      }dD ].  }|g}| j                   ||  || dj                  |             0 y )Nc                 
    | dv S )N
9876zabiuhr!   r%   s    r   rS  z+TestUnicode.test_literal_in.<locals>.pyfuncN  s    $$r   )rH  9r8  r   8uha987rh  r  ru  r~  s        r   test_literal_inzTestUnicode.test_literal_inM  sP    	% V3A3DVT]E4L!/!6!6t!<  > 4r   c                     d }t        |      }t        dd      D ]+  }| j                   ||  || dj                  |             - y )Nc                 F    dj                  |       dj                  |      fS )NrF  cde)r   r   r)   s     r   rS  z0TestUnicode.test_literal_xyzwith.<locals>.pyfuncX  s!    ##A&q(999r   rE  rr  rs  rh  r  )r   r   rX  r  ro  s       r   test_literal_xyzwithz TestUnicode.test_literal_xyzwithW  sP    	: V a0DVT]E4L!/!6!6t!<  > 1r   c                     d }t        |      }dD ].  }|g}| j                   ||  || dj                  |             0 y )Nc                 F    dj                  |       | j                  d      fS )NrF  rH  rW   r%   s    r   rS  z-TestUnicode.test_literal_find.<locals>.pyfunca  s    ::a=!&&+--r   )r:  rh  r  ru  r~  s        r   test_literal_findzTestUnicode.test_literal_find`  sP    	. VA3DVT]E4L!/!6!6t!<  > r   c                     d }t        |      }t        D ].  }|g}| j                   ||  || dj                  |             0 y )Nc                     |  S r$   r!   r%   s    r   rS  z$TestUnicode.test_not.<locals>.pyfunck  s	    5Lr   rh  r  r  r~  s        r   test_notzTestUnicode.test_notj  sP    	 V!A3DVT]E4L!/!6!6t!<  > "r   c                     d }t        |      }g d}dg}d}t        dgz   |z   |z   D ]1  }| j                   ||       ||      |j                  |             3 y )Nc                 "    | j                         S r$   )
capitalizer%   s    r   rS  z+TestUnicode.test_capitalize.<locals>.pyfuncu  s    <<>!r   )	   𐑏   𐑏𐑏   𐐧𐑏   𐑏𐐧
   X𐐧x𐑏u   hİu   ῒİu   ﬁnnish   AͅΣ   𐀀􀀀z*Results of "{}".capitalize() must be equalr   r  r  r  s          r   test_capitalizezTestUnicode.test_capitalizet  sj    	" V@ 11:!RD(72^CAVAYacjjmD Dr   c                 0   d }t        |      }t        D cg c]  }|j                          }}g d}g d}|D cg c]  }|dz  	 }}t        |z   |z   |z   |z   D ].  }|g}	| j                   ||	  ||	 dj	                  |	             0 y c c}w c c}w )Nc                 "    | j                         S r$   )isupperr%   s    r   rS  z(TestUnicode.test_isupper.<locals>.pyfunc  r/  r   AA12Aaa12au   大AA12Au   大aa12au   AAAǄAu	   A 1 1 大u   Ⅷ   ⅷr0  r1  r2  r3  r4  r5  rm  rh  r  )r   rW  upperrX  r  )
r,  rS  rT  r&   uppersr  r  fourxcpyrH  r;  s
             r   test_isupperzTestUnicode.test_isupper  s    	 V%56%5!'')%56R=#*+7aAE7+!F*V3g=HA3DVT]E4L!/!6!6t!<  > I 7 ,s
   BBc                     d }t        |      }t        D ].  }|g}| j                   ||  || dj                  |             0 y )Nc                 "    | j                         S r$   )r  r%   s    r   rS  z&TestUnicode.test_upper.<locals>.pyfunc  s    779r   rh  r  r  r~  s        r   
test_upperzTestUnicode.test_upper  sP    	 V!A3DVT]E4L!/!6!6t!<  > "r   c                     d }t        |      }g d}dg}d}t        dgz   |z   |z   D ]1  }| j                   ||       ||      |j                  |             3 y )Nc                 "    | j                         S r$   )casefoldr%   s    r   rS  z)TestUnicode.test_casefold.<locals>.pyfunc      ::<r   )r  hELlo   ß   ﬁ   Σr  r  r  z(Results of "{}".casefold() must be equalr   r  r  r  s          r   test_casefoldzTestUnicode.test_casefold  si    	  V. 118!RD(72^CAVAYacjjmD Dr   c                     d }t        |      }g d}g d}d}t        dgz   |z   |z   D ]1  }| j                   ||       ||      |j                  |             3 y )Nc                 "    | j                         S r$   )isalphar%   s    r   rS  z(TestUnicode.test_isalpha.<locals>.pyfunc  r/  r   )r=  r0  r1  r2  r3  r4  r5  r  z'Results of "{}".isalpha() must be equalr   r  r  r,  rS  rT  r  r  r  r   s          r   test_isalphazTestUnicode.test_isalpha  sg    	 V=8 8!RD(61G;AVAYacjjmD <r   c                     d }t        |      }g d}d}t        |z   D ]1  }| j                   ||       ||      |j                  |             3 y )Nc                 "    | j                         S r$   )r   r%   s    r   rS  z(TestUnicode.test_isascii.<locals>.pyfunc  r/  r   )r    z       ér?  z'Results of "{}".isascii() must be equalr  r  rF  s         r   test_isasciizTestUnicode.test_isascii  sS    	 V H7!G+AVAYacjjmD ,r   c                     t         }t        |      }g d}d}t        dgz   |z   D ]1  }| j                   ||       ||      |j	                  |             3 y )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   rW  rX  r  rF  s         r   
test_titlezTestUnicode.test_title  sY    V? 6!RD(72AVAYacjjmD 3r   c                     d }t        |      }g d}dg}d}t        dgz   |z   |z   D ]1  }| j                   ||       ||      |j                  |             3 y )Nc                 "    | j                         S r$   )swapcaser%   s    r   rS  z)TestUnicode.test_swapcase.<locals>.pyfunc  r  r   )r  r1  r  r  r  r  r     İr     ͅΣr     AͅΣar  u   AΣͅ   Σͅ r  r  u   ῒr  z(Results of "{}".swapcase() must be equalr   r  r  r  s          r   test_swapcasezTestUnicode.test_swapcase  si    	  V- 118!RD(72^CAVAYacjjmD Dr   c                 J   t         }t        |      }t        D cg c]  }|j                          }}g d}g d}||D cg c]  }|dz  	 c}z  }d}t        |z   dgz   |z   |z   D ]1  }| j	                   ||       ||      |j                  |             3 y c c}w c c}w )Nr  r  rm  z'Results of "{}".islower() must be equalr   r  )r  r   rW  r   rX  r  )	r,  rS  rT  r&   lowersr  r  r  r   s	            r   test_islowerzTestUnicode.test_islower  s     V%56%5!'')%56RK7+7aAE7++7!F*bT1F:WDAVAYacjjmD E 7 ,s   B B c                     d }t        |      }g d}g d}d}t        dgz   |z   |z   D ]1  }| j                   ||       ||      |j                  |             3 y )Nc                 "    | j                         S r$   )isalnumr%   s    r   rS  z(TestUnicode.test_isalnum.<locals>.pyfunc	  r/  r   )r0  r1  r2  r3     𝟶   𑁦   𐒠   🄇r  z'Results of "{}".isalnum() must be equalr   r  r  r  s          r   test_isalnumzTestUnicode.test_isalnum	  sh    	 VK8 8!RD(61G;AVAYacjjmD <r   c                     t         }t        |      }g d}g d}g d}d}|j                  |       d}t        dgz   |z   |z   |z   D ]1  }| j	                   ||       ||      |j                  |             3 y )Nr  )r0  r1  r3  r5  u   𐐧𐐧r  r  r  )r  r  r  r  r  u   򏿾r  u   AΣ΢z%Results of "{}".lower() must be equalr   r  )r!  r   r  rW  rX  r  )	r,  rS  rT  r  r  sigmaextra_sigmar  r   s	            r   
test_lowerzTestUnicode.test_lower	  s    VR7: &[!5!RD(61G;eCAVAYacjjmD Dr   c                     d }t        |      }g d}g d}d}t        dgz   |z   |z   D ]1  }| j                   ||       ||      |j                  |             3 y )Nc                 "    | j                         S r$   )	isnumericr%   s    r   rS  z*TestUnicode.test_isnumeric.<locals>.pyfunc-	      ;;= r   )r   rH  r     ①   ¼   ٠
01234567890123456789ar0  r1  r2  r3  r4  r5     𑁥r  r  r  r  r  z)Results of "{}".isnumeric() must be equalr   r  r  r  s          r   test_isnumericzTestUnicode.test_isnumeric,	  i    	! VK
- :!RD(72^CAVAYacjjmD Dr   c                     d }t        |      }g d}g d}d}t        dgz   |z   |z   D ]1  }| j                   ||       ||      |j                  |             3 y )Nc                 "    | j                         S r$   )isdigitr%   s    r   rS  z(TestUnicode.test_isdigit.<locals>.pyfunc@	  r/  r   )r  r  r  r0  r1  r2  r3  r4  r5  r  r  r  r  r  r  z'Results of "{}".isdigit() must be equalr   r  r  r  s          r   test_isdigitzTestUnicode.test_isdigit?	  si    	 V!
@ 8!RD(72^CAVAYacjjmD Dr   c                     d }t        |      }g d}g d}d}t        dgz   |z   |z   D ]1  }| j                   ||       ||      |j                  |             3 y )Nc                 "    | j                         S r$   )	isdecimalr%   s    r   rS  z*TestUnicode.test_isdecimal.<locals>.pyfuncS	  r  r   )r   rH  r  r  r  r  r  r  r0  r1  r2  r3  r4  r5  r  r  r  r  r  r  z)Results of "{}".isdecimal() must be equalr   r  r  r  s          r   test_isdecimalzTestUnicode.test_isdecimalR	  r  r   c                     t         }t        |      }g d}|D ]3  \  }}}| j                   ||||       ||||      d|d|d|d       5 y )N
)rF  r   A)r   r  r  )r  r  r  )r6  r  r  )r  r  r  )r  rH  r  )r  r8  r  )r  r   r  )r  r:  r  )r  rI  r  r  '.replace('', 'r  )r{   r   rX  )r,  rS  rT  r  r  old_strnew_strs          r   test_replacezTestUnicode.test_replacee	  s[     V
 +0&HgwVHgw?"8Wg>&:; +0r   c                     t         }t        |      }g d}g d}|D ]?  \  }}}|D ]4  }| j                   |||||       |||||      d|d|d|d|d	       6 A y )Nr  )rk  r  r   r  r  r  r  r  )r~   r   rX  )	r,  rS  rT  r  
count_testr  r  r  rh   s	            r   test_replace_with_countz#TestUnicode.test_replace_with_count|	  sr    +V
 #
*/&Hgw#  '7E!J!&x'5!I"*GWe"EF $ +0r   c                 H   d }t        |      }| j                  t              5 } |dddd       d d d        d}| j                  |t	        j
                               | j                  t              5 } |dddd       d d d        d	}| j                  |t	        |j
                               | j                  t              5 } |dddd       d d d        d	}| j                  |t	        |j
                               y # 1 sw Y   xY w# 1 sw Y   xY w# 1 sw Y   IxY w)
Nc                 (    | j                  |||      S r$   ry   r}   s       r   rS  z4TestUnicode.test_replace_unsupported.<locals>.pyfunc	  s    99Q5))r   
abababababbaqqqg      @z7Unsupported parameters. The parameters must be Integer.r   r  z!The object must be a UnicodeType.)r   r  r   r  r  r  )r,  rS  rT  r  r  s        r   test_replace_unsupportedz$TestUnicode.test_replace_unsupported	  s    	* V{+v,eS1 ,Gc3v//01{+v,5!, ,1c3v//01{+v,a+ ,1c3v//01 ,+
 ,+
 ,+s#   D 4DD D	DD!N)~r.  r/  r0  rU  r	   r[  r_  ro  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.  r4  rC  rP  rR  rT  rW  rY  rb  rf  ri  rp  rr  rt  rv  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+  r6  rA  rG  rL  rO  rS  rX  r\  rj  rp  rv  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   rO  rO    s   3
 &4 2 + A?,4 + , + , + , + , , 2 - 2	EA2F>"G$3&3"G&=&H*Q.@*E2 + @2$5( - =8
HM	62$5(	L9(96-$5:=:
HM:>(28=0=0L8Q:F:	:77N
A
AAKK*K
'2> !/ : !/ .-
D	FI,K2<:	6	E>&
D	65*J6A48 9&@ @M L*5, )7 :E"HATE""GHE *8 6 )7 6 '5 6 #1 6 #1 6B26>2,>>>>>E">&>EE$EE E&E E$E.E&E&E&;.F42r   rO  c                   0    e Zd Zd Zd Zd Zd Zd Zd Zy)TestUnicodeInTuplec                     t         d        }| j                  |j                          |              t         d        }| j                  |j                          |              y )Nc                      ddk  S )N)rM  bbr!   r!   r   r   r  z9TestUnicodeInTuple.test_const_unicode_in_tuple.<locals>.f	      W$$r   c                      ddk  S )N)ccr  r!   r!   r   r   r  z9TestUnicodeInTuple.test_const_unicode_in_tuple.<locals>.f	  r  r   r   rX  rl  r,  r  s     r   test_const_unicode_in_tuplez.TestUnicodeInTuple.test_const_unicode_in_tuple	  sZ    		% 
	% 	ac*		% 
	% 	ac*r   c                     t         d        }| j                  |j                          |              t         d        }| j                  |j                          |              y )Nc                      ddk  S )NrM  r  )r  r  r!   r!   r   r   r  z@TestUnicodeInTuple.test_const_unicode_in_hetero_tuple.<locals>.f	      y((r   c                      ddk  S )Nr  )rM  rr  r!   r!   r   r   r  z@TestUnicodeInTuple.test_const_unicode_in_hetero_tuple.<locals>.f	  r  r   r  r  s     r   "test_const_unicode_in_hetero_tuplez5TestUnicodeInTuple.test_const_unicode_in_hetero_tuple	  sZ    		) 
	) 	ac*		) 
	) 	ac*r   c                 t    t         d        }t        D ]#  }| j                   ||      t        |             % y )Nc                     | j                   S r$   r  r   s    r   r  z3TestUnicodeInTuple.test_ascii_flag_unbox.<locals>.f	  s    ;;r   )r   rW  rX  r   r  s      r   test_ascii_flag_unboxz(TestUnicodeInTuple.test_ascii_flag_unbox	  s8    		 
	 "AQqT71:. "r   c                 J    t         d        }| j                   |       d       y )Nc                      d} d}d}d}dj                  | |g      j                  dj                  | |g      j                  dj                  | |g      j                  dj                  ||g      j                  fS )NrF  r  r6  r    ,)r   r  s1s2s3s4s       r   r  z2TestUnicodeInTuple.test_ascii_flag_join.<locals>.f	  sx    BBB1BHHb"X&00NNB8,66HHb"X&00HHb"X&002 2r   )r  r   r   r   r  r  s     r   test_ascii_flag_joinz'TestUnicodeInTuple.test_ascii_flag_join	  s(    		2 
	2 	l+r   c                 J    t         d        }| j                   |       d       y )Nc                  ~    d} d}| d   j                   | dd  j                   |d   j                   |dd  j                   fS )Nabc123u   🐍⚡🐍⚡🐍⚡r   rr  r  )r  r  s     r   r  z5TestUnicodeInTuple.test_ascii_flag_getitem.<locals>.f	  sH    B(BqEOORV%5%5r!uqrF$$& &r   )r  r  r   r   r  r  s     r   test_ascii_flag_getitemz*TestUnicodeInTuple.test_ascii_flag_getitem	  s(    		& 
	& 	l+r   c                 J    t         d        }| j                   |       d       y )Nc                      d} d}d}d}| |z   j                   | |z   j                   ||z   j                   | dz  j                   |dz  j                   fS )NrF  r  r6  r    rr  r  r  s       r   r  z5TestUnicodeInTuple.test_ascii_flag_add_mul.<locals>.f	  sa    BBB1B"W''"W''"W''!V&&!V&&	( (r   )r  r   r   r  r   r  r  s     r   test_ascii_flag_add_mulz*TestUnicodeInTuple.test_ascii_flag_add_mul	  s(    			( 
		( 	o.r   N)	r.  r/  r0  r	  r  r  r  r  r"  r!   r   r   r  r  	  s     ++/,,/r   r  c                   *    e Zd Zd Zd Zd Zd Zd Zy)TestUnicodeIterationc                 x    t         }t        |      }t        D ]   }| j                   ||       ||             " y r$   )r  r   rW  rQ  r,  rS  rT  rH  s       r   test_unicode_iterz&TestUnicodeIteration.test_unicode_iter	  s2    V!A##F1IuQx8 "r   c                 ^    t         }t        |      }| j                   |        |              y r$   )r  r   rQ  rR  s      r   test_unicode_literal_iterz.TestUnicodeIteration.test_unicode_literal_iter
  s$    %V%'2r   c                 x    t         }t        |      }t        D ]   }| j                   ||       ||             " y r$   )r  r   rW  rQ  r&  s       r   test_unicode_enumerate_iterz0TestUnicodeIteration.test_unicode_enumerate_iter
  s2    (V!A##F1IuQx8 "r   c                     | j                          t        }t        |      }||fD ]3  }t        D ](  }| j	                  t
              5   ||       d d d        * 5 y # 1 sw Y   7xY wr$   )r  r  r   rW  r  StopIteration)r,  rS  rT  r  rH  s        r   test_unicode_stopiteration_iterz4TestUnicodeIteration.test_unicode_stopiteration_iter
  sX    !+V%A%&&}5aD 65 & !55s   	AA&c                     t         }t        |      }||fD ]'  }| j                  t              5   |        d d d        ) y # 1 sw Y   4xY wr$   )r  r   r  r-  )r,  rS  rT  r  s       r   'test_unicode_literal_stopiteration_iterz<TestUnicodeIteration.test_unicode_literal_stopiteration_iter
  s@    3V%A""=1 21 !11s   AA
	N)r.  r/  r0  r'  r)  r+  r.  r0  r!   r   r   r$  r$  	  s    93
9r   r$  c                   0    e Zd Zd Zd Zd Zd Zd Zd Zy)TestUnicodeAuxillaryc                     t         }t        |      }t        D ]'  }|D ]   }| j                   ||       ||             " ) y r$   )r#  r   rW  rQ  )r,  rS  rT  exrH  s        r   test_ordzTestUnicodeAuxillary.test_ord
  s<    V"B''q	58<  #r   c                    | j                          t        }t        |      }||fD ]T  }dD ]M  }| j                  t              5 } ||       d d d        | j                  dt        j                               O V | j                  t              5 } |d       d d d        | j                  t        t        j                               y # 1 sw Y   xY w# 1 sw Y   ?xY w)N)r   rF  zord() expected a charactergGz?)
r  r#  r   r  	TypeErrorr  r  r  r   r   )r,  rS  rT  r  chr  s         r   test_ord_invalidz%TestUnicodeAuxillary.test_ord_invalid&
  s    !V UOD!&&y1VH 2:!&"2"235 " $ {+v$K ,lC(8(8$9: 21 ,+s   	C	CCC"c                     t         }t        |      }t        D ]2  }|D ]+  }t        |      }| j	                   ||       ||             - 4 dt
        fD ]   }| j	                   ||       ||             " y )Nr   )r&  r   rW  r   rQ  r   )r,  rS  rT  r4  r&   rH  s         r   test_chrzTestUnicodeAuxillary.test_chr9
  sn    V"BF''q	58<  #
 |$A##F1IuQx8 %r   c                    t         }t        |      }||fD ]]  }dt        dz   fD ]M  }| j                  t              5 } ||       d d d        | j                  dt        j                               O _ | j                  t              5 } |d       d d d        | j                  t        t        j                               y # 1 sw Y   xY w# 1 sw Y   ?xY w)Nr  r  zchr() arg not in rangerF  )
r&  r   r   r  r  r  r  r  r   r   )r,  rS  rT  r  vr  s         r   test_chr_invalidz%TestUnicodeAuxillary.test_chr_invalidD
  s    V UOD,*+&&z2fG 36F<L<L8MN , $ {+v%L ,lC(8(8$9: 32
 ,+s   	C	CCCc                     d t              d        }t        fd       }d}| j                  |j                  |       ||             | j	                  t
        j                  t
        j                  j                  j                         y )Nc                      y)NTr!   r%   s    r   barz7TestUnicodeAuxillary.test_unicode_type_mro.<locals>.barV
  s    r   c                 ~    dt        | t        j                        rt        | t        j                        rdfdS )NFTc                     S r$   r!   r&   oks    r   <lambda>zLTestUnicodeAuxillary.test_unicode_type_mro.<locals>.ol_bar.<locals>.<lambda>_
  s    Rr   )
isinstancer   r  HashablerD  s    @r   ol_barz:TestUnicodeAuxillary.test_unicode_type_mro.<locals>.ol_barY
  s1    B!U../a0Br   c                      |       S r$   r!   )strinstrA  s    r   ri  z7TestUnicodeAuxillary.test_unicode_type_mro.<locals>.fooa
  s    w<r   rF  )
r   r   rX  rl  r  r   rH  r8  r-  __mro__)r,  rI  ri  instrA  s       @r   test_unicode_type_mroz*TestUnicodeAuxillary.test_unicode_type_mroT
  s|    	 
#	  
	  
	  
	  T*CI6enne&8&8&B&B&J&JKr   c                    d }d }d }d }d }| j                   |d       t        |      d             | j                   |d       t        |      d             | j                   |d       t        |      d             d	d
g} t        |      |      }dt        |       d}| j                  ||       | j                  t              5 }	 t        |      d	d
g       ddd       d}
| j                  |
t        	j                               | j                   |        t        |                    y# 1 sw Y   VxY w)z@test f-string support, which requires bytecode handling
        c                     d| dz    dS )NAA_r  _Br!   rJ  s    r   impl1z2TestUnicodeAuxillary.test_f_strings.<locals>.impl1m
  s    Qr?"r   c                     | dz    S rR  r!   rJ  s    r   impl2z2TestUnicodeAuxillary.test_f_strings.<locals>.impl2q
  s    !eWr   c                     d|  S )NABC_r!   rJ  s    r   impl3z2TestUnicodeAuxillary.test_f_strings.<locals>.impl3u
  s    !:r   c                     d| dS )NrW  r  r!   rJ  s    r   impl4z2TestUnicodeAuxillary.test_f_strings.<locals>.impl4y
  s    !A<r   c                       S r$   r!   r!   r   r   impl5z2TestUnicodeAuxillary.test_f_strings.<locals>.impl5}
  s    Jr   r  rr  DEr  BzABC_<object type:rb  Nz*format spec in f-strings not supported yet)rX  r   r   r  r   r  r  r  )r,  rS  rU  rX  rZ  r\  list_arggotexpectedr  r  s              r   test_f_stringsz#TestUnicodeAuxillary.test_f_stringsi
  s"   	#			 	 	q;4;q>2q;4;q>2tkd5k$&78 :d5k(#&vh'7&8:h' /0FDKc
# 1:c3v//01+$u+-0	 10s   D99EN)	r.  r/  r0  r5  r9  r;  r>  rN  rb  r!   r   r   r2  r2  
  s!    =;&	9; L*'1r   r2  __main__)q	itertoolsr   r   numbar   r   
numba.corer   unittestnumba.tests.supportr   r	   r
   numba.core.errorsr   r   numba.cpython.unicoder   numba.core.types.functionsr   numba.extendingr   r   r"   r'   r+   r0   r4   r8   r;   r>   rA   rD   rF   rH   rJ   rL   rN   rP   rU   rY   r^   rb   re   ri   rk   rn   rs   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(  rW  ru  r   rO  r  r$  r2  r.  mainr!   r   r   <module>rn     s6    "    K K ; . 3 $(,
!"""#"!)"' % )"+#,!  & &
  "! H|2( |2~?J/ J/Z!8 !Hs18 s1l zHMMO r   