
    ;eZ                       	 d dl Z d dlZd dlZd dlZd dlmZ d dlmZ d dlm	Z	 d dl
Z
 G d d          Z G d de          Z G d	 d
e          Z G d d          Z G d de          Z G d d          Z G d d          ZdS )    N)support)import_helper)UserListc                   "    e Zd ZddZd Zd ZdS )Sequencewxyzc                     || _         d S Nseq)selfr   s     (/usr/lib/python3.11/test/string_tests.py__init__zSequence.__init__   s    sDHHH    c                 *    t          | j                  S r
   )lenr   r   s    r   __len__zSequence.__len__   s    c$(mm+r   c                     | j         |         S r
   r   )r   is     r   __getitem__zSequence.__getitem__   s    TXa[0r   N)r   )__name__
__module____qualname__r   r   r    r   r   r   r      s.        2222+++00000r   r   c                       e Zd Zd Zd ZdS )BadSeq1c                     g d| _         d S )N)   hello{   r   r   s    r   r   zBadSeq1.__init__   s    #4#4#4r   c                       dj         | j         S )Nz{0} {1} {2})formatr   r   s    r   __str__zBadSeq1.__str__   s    2m2DH==r   N)r   r   r   r   r$   r   r   r   r   r      s"        444=====r   r   c                       e Zd Zd Zd ZdS )BadSeq2c                     g d| _         d S )Nabcr   r   s    r   r   zBadSeq2.__init__   s    ???r   c                     dS )N   r   r   s    r   r   zBadSeq2.__len__   s    aar   N)r   r   r   r   r   r   r   r   r&   r&      s"        222r   r&   c                   z   e Zd ZdZdZd Zd Zd Zdd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j        ej        dk    p ej        d          dk    d          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/ Z2d0 Z3dS )1BaseTestNFc                     t          |t                    r j                            |          S t          |t                    r fd|D             S t          |t
                    rt           fd|D                       S t          |t                    r-t           fd|                                D                       S |S )Nc                 :    g | ]}                     |          S r   fixtype.0xr   s     r   
<listcomp>z$BaseTest.fixtype.<locals>.<listcomp>-   s#    111DLLOO111r   c                 :    g | ]}                     |          S r   r2   r4   s     r   r7   z$BaseTest.fixtype.<locals>.<listcomp>/   s#    777a$,,q//777r   c                 j    g | ]/\  }}                     |                               |          f0S r   r2   )r5   keyvaluer   s      r   r7   z$BaseTest.fixtype.<locals>.<listcomp>1   sJ       C S!!4<<#6#67  r   )
isinstancestr	__class__	type2testlisttupledictitems)r   objs   ` r   r3   zBaseTest.fixtype)   s    c3 	>++C000T"" 
	1111S1111U## 	77773777888T"" 	    #&99;;     
 Jr   c                 |    |                      t          |                     d                    | j                   d S )N123)assertIstyper3   r?   r   s    r   test_fixtypezBaseTest.test_fixtype8   s2    d4<<..//@@@@@r   c                                           |          }                      |          }                      |          } fd|                                D             } t          ||          |i |}                     ||           ||u r`	  G d d j        j                  } ||          } t          ||          | }                     ||           d S # t          $ r Y d S w xY wd S )Nc                 B    i | ]\  }}|                     |          S r   r2   )r5   kvr   s      r   
<dictcomp>z'BaseTest.checkequal.<locals>.<dictcomp>@   s)    ???1!T\\!__???r   c                       e Zd ZdS )$BaseTest.checkequal.<locals>.subtypeNr   r   r   r   r   r   subtyperP   J   s        Dr   rR   )r3   rC   getattrassertEqualr>   r?   assertIsNot	TypeError)r   resultrD   
methodnameargskwargs
realresultrR   s   `       r   
checkequalzBaseTest.checkequal<   sA   f%%ll3||D!!???????-WS*--t>v>>
	
 	
 	
 *2    dn6   
 gcll5WS*55t<
  j11111    	 s   C   
C.-C.expected_msgc                   |                      |          }|                      |          }|                     |          5 } t          ||          |  d d d            n# 1 swxY w Y   |                     t	          |j                  d           |*|                     t	          |j                  |           d S d S )N )r3   assertRaisesrS   assertNotEqualr=   	exceptionrT   )r   excrD   rX   r^   rY   cms          r   checkraiseszBaseTest.checkraisesT   s    ll3||D!!s## 	,r$GC$$d++	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	, 	,C--r222#S..===== $#s    A  A$'A$c                     |                      |          }|                      |          } t          ||          |  d S r
   )r3   rS   )r   rD   rX   rY   s       r   	checkcallzBaseTest.checkcall^   sA    ll3||D!! Z  $''''r   c                 	                          dddd                                 dddd                                 dddd                                 dddd                                 dddd                                 dddd                                 dddd                                 ddddd                                 ddddd	                                 ddddd
                                 ddddd                                 dddddd                                 dddddd	                                 dddddd
                                 dddddd                                 ddddd                                 ddddd                                 ddddd	                                 ddddd
                                 ddddd                                 dddd                                 dddddd                                 ddddt          j        d                                 dddd                                 dddddd                                 ddddt          j        d                                t          dd            j        r                      dddd           n                     t          ddd           g d}d}t          |          }t                      }t          ||z            D ]l}g }t          |          D ]0}t          ||          \  }}|
                    ||                    1|                    d                    |                     m fd|D             }|D ]}t          |          }	|D ]}|                    |          }
|rXt          |	t          |                    |                     d                              z
  t          |                    \  }}nt          |          dz   d}}|s|
|k    r;                     |d|d|                                |
||
d|d|           Ɍd S )N   aaacountr)   r   r*         
   r`      xxr    *   )r`   r)   r*   r   c                 :    g | ]}                     |          S r   r2   r5   tsr   s     r   r7   z'BaseTest.test_count.<locals>.<listcomp>   %    >>>Bt||B''>>>r   z
 != 0 for z != z for )r\   sysmaxsizerf   rV   contains_bytesr   setrangedivmodappendaddjoinrl   replacer3   rT   )r   charsetdigitsbaseteststringsr   entryjmnr1r2rems   `            r   
test_countzBaseTest.test_countc   s   5'3///5'3///5'3///5'3///5'3///5'3///5'3///5'32225'33335'33335'34445'315555'326665'326665'337775'2q1115'2q1115'2r2225'2r2225'2s3332w+++2wAq1112wCK;;;2w---2wa3332wck1===GW555 	>OOAw4444Y"===
 !..7||eetv~&& 	, 	,AE6]] ) )a1WQZ((((OOBGGENN++++>>>>+>>> 	N 	NAAA  	N 	NWWQZZ *$QQYYq$,,r:J:J-K-K)L)L%L%(VV- -GB "!ffQhB N"(($$S!aa-HIII$$R"""bbb!!-LMMM	N	N 	Nr   c           
                                dddd                                 ddddd                                 ddddd	                                 dddd
d                                 dddd
d                                 dddd
d	                                 dddd                                 ddddd	                                 ddddd	d                                 ddddd	d                                  ddddd d                                t          dd            j        r                      dddd           n                     t          ddd                                 dd
dd
                                 dd
dd
dd                                 dd
dd
t          j        d                                 dd
dd                                 dd
dddd                                 dd
ddt          j        d                                 ddddt          j        dz   d           g d}d}t          |          }t                      }t          ||z            D ]l}g }t          |          D ]0}t          ||          \  }}|
                    ||                    1|                    d
                    |                     m fd|D             }|D ]p}|D ]k}|                    |          }	|	dk    }
||v }                     |
|           |	dk    r.                     ||	|	t          |          z            |           lqd S )Nr   abcdefghiabcfindabc	   rn   rp   defrr   r`   rj   rm   rrarrrrrrrrrar)         r    rt   rs   abxxxr`   r)   r*   r+      c                 :    g | ]}                     |          S r   r2   rv   s     r   r7   z&BaseTest.test_find.<locals>.<listcomp>   rx   r   )r\   rf   rV   r{   ry   rz   r   r|   r}   r~   r   r   r   r   rT   r   r   r   r   r   r   r   r   r   locr   r   s   `           r   	test_findzBaseTest.test_find   s   >65999>65!<<<NFE1===5&"a0005&"a000E62q111 	OVS999OVS!<<<OVS!Q???OVS!TBBBOVS$BBBGV444 	=OOB4444Y<<<2vr***BAq111BCK;;;B---Ba333Bck1=== 	D&%q!DDD
 &%%7||eetv~&& 	, 	,AE6]] ) )a1WQZ((((OOBGGENN++++>>>>+>>> 	; 	;A  ; ;ffQiiRi!V  R((("99$$Qs3s1vv:~%6:::;	; 	;r   c           
                                dddd                                 dddd                                 dddd                                 d	ddd
                                 ddddd                                 ddddd                                 d	dddd                                 dddd                                 ddddd                                 d	ddddd                                 dddddd                                  ddddd d                                t          dd            j        r                      d	ddd           n                     t          ddd           g d}d}t	          |          }t                      }t          ||z            D ]l}g }t          |          D ]0}t          ||          \  }}|                    ||                    1|	                    d
                    |                     m fd|D             }|D ]p}|D ]k}|                    |          }	|	d	k    }
||v }                     |
|           |	d	k    r.                     ||	|	t	          |          z            |           lq                      d	dddt          j        dz   d                                 dddd           d S )Nr   r   rfindr   r   r`   r   abcdrp   abczrj   rr   r   r)   r   rm   r    rt   r   r   c                 :    g | ]}                     |          S r   r2   rv   s     r   r7   z'BaseTest.test_rfind.<locals>.<listcomp>  rx   r   r   r   rn   u   <......м...<)r\   rf   rV   r{   r   r|   r}   r~   r   r   r   r   rT   ry   rz   r   s   `           r   
test_rfindzBaseTest.test_rfind   s    NGU;;;NGR888>7F;;;NGV<<<5'2q1115'2q111E7B222 	OWc:::OWc1===OWc1a@@@OWc1dCCCOWc4CCCGW555 	>OOB"5555Y"===
 &%%7||eetv~&& 	, 	,AE6]] ) )a1WQZ((((OOBGGENN++++>>>>+>>> 	; 	;A  ; ;ggajjRi!V  R((("99$$Qs3s1vv:~%6:::; 	D'5#+/1EEE 	-w<<<<<r   c                 |   |                      dddd           |                      dddd           |                      dddd           |                      ddddd	           |                     t          ddd
           |                     t          dddd	           |                     t          dddd           |                     t          dddd           |                      dddd           |                      ddddd           |                     t          ddddd           |                      dddddd            |                      ddddd d           |                     t          dd           | j        r|                     t          ddd           d S |                     t          ddd           d S )Nr   r   indexr`   rj   r   r   r   rn   hibabcdefghiab	abcdefghighir-   rp   rm   r   r)   r   rr   r   r    rt   r\   rf   
ValueErrorrV   r{   r   s    r   
test_indexzBaseTest.test_index  s   >7B777>7E:::>7E:::>7E1===^WeDDD]GUAFFF['5!DDD['5"EEE 	OWc:::OWc1===_gsAqIIIOWc1dCCCOWc4CCCGW555 	>Z'2>>>>>Y"=====r   c                    |                      dddd           |                      dddd           |                      dddd           |                      d	dddd	d
           |                     t          ddd           |                     t          dddd           |                     t          dddd	d
           |                     t          dddd	d           |                     t          dddd	d
           |                      dddd           |                      ddddd           |                     t          ddddd           |                      dddddd            |                      ddddd d           |                     t          dd           | j        r|                     t          ddd           d S |                     t          ddd           d S )Nr   r   rindexr`   rj   r   r   r   r   rp   r   	defghiabcrn   r   r   r-   r   r)   rr   r   rm   r    rt   r   r   s    r   test_rindexzBaseTest.test_rindex*  s   NHb999NHe<<<NHe<<<NHeQCCC^XuEEE[(E1EEE[(E1bIII[(E1aHHH[(E1bIII 	OXs;;;OXsA>>>_hQJJJOXsAtDDDOXsD!DDDGX666 	?Z(B?????Y2>>>>>r   c           	      n   	 d }t           j        }t           j        }t          d          D ]}d                     |d |d                               |dd          z  }|d t          |           |d          z
           }d                     |d |d	                              }d                     |d |d	                              }||z   |z   }	|                     ||	
          5  |                      |||	          |	d|           d d d            n# 1 swxY w Y   	d S )Nc                 x    t          t          |                    D ]}|                    | |          r|c S dS )Nrp   )r}   r   
startswith)psr   s      r   reference_findz;BaseTest.test_find_periodic_pattern.<locals>.reference_findF  sF    3q66]]  <<1%% HHH2r     r`   abcdero   )rL      abcdef  )r   textr   )random	randrangechoicesr}   r   r   subTestr\   )
r   r   rrr   _p0r   leftrightr   s
             r   test_find_periodic_patternz#BaseTest.test_find_periodic_patternD  s   ;	 	 	 .t 	1 	1ABBrFF33344rr"bzzAB$CGGbbff$$%A77778rr$xx88899DGGGGH4999::E!8e#D-- 1 1q$ 7 7 $fa1 1 11 1 1 1 1 1 1 1 1 1 1 1 1 1 1	1 	1s   9#D((D,	/D,	c                 z   	 d}d|z  dz   d|z  z   }d|z  |z   }|                      t          |          t          |          z
  |d|           dd|z  z   dz   }|d d	         d
|z  z   |z   d|z  z   }|                      t          |          |t          d          z  z
  t          |          z
  |d|           d S )Nid  r)   r*   babbaar   dddr   eeerp   ddeededdeedede)r\   r   )r   Npattern1text1pattern2text2s         r   test_find_shift_table_overflowz'BaseTest.test_find_shift_table_overflowX  s    7 7S=37*1x'E

3x==0vx	1 	1 	1
 519$u,"q 008;dQhFE

Qs4yy[03x==@vx	1 	1 	1 	1 	1r   c                     |                      ddd           |                      ddd           |                     t          ddd           d S )Nr    HeLLolowerrt   r\   rf   rV   r   s    r   
test_lowerzBaseTest.test_lowerj  N    '222'222GWb99999r   c                     |                      ddd           |                      ddd           |                     t          ddd           d S )NHELLOr   upperr    rt   r   r   s    r   
test_upperzBaseTest.test_uppero  r   r   c                    |                      ddd           |                      dddd           |                      dddd           |                      ddd           |                      dddd           |                      d	ddd           |                      d
d
dd           |                      dddd           |                      dddd           |                      dddd           |                     t          dddd           t          j        dk     rAt          j        d          dk    r+|                     t          ddt          j                   d S d S d S )Nzabcab      def
g       hizabcab	def
g	hi
expandtabsr-   zabcab  def
g   hirr   zabc
ab      def
g       hizabc
ab	def
g	hizabc
ab  def
g   hizabc
ab
def
g
hi)tabsizez  a
 bz 	a
	brn   r    rt           Pz	a
	b)r\   rf   rV   ry   rz   structcalcsizeOverflowErrorr   s    r   test_expandtabszBaseTest.test_expandtabst  s   68M$	& 	& 	&68M$a	) 	) 	).0E$a	) 	) 	)8:Q$	& 	& 	&8:Q$a	) 	) 	)02I$a	) 	) 	)35P$a	) 	) 	) 	68M$a 	 	1 	1 	1.0E$a 	 	1 	1 	1 		;a@@@G\2rBBB;'""vs';';q'@'@]'s{D D D D D #"'@'@r   c                 
   |                      g dddd           |                      dgdddd           |                      ddgdddd           |                      g d	dddd
           |                      g ddddd           |                      g ddddd           |                      g ddddt          j        d
z
             |                      dgdddd           |                      g ddddd
           |                      dgddd           |                      dgddd           |                      ddgddd           |                      ddgddd           |                      g dddd           |                      g ddddd
           |                      dgdz  dd d         dd           |                      dgdz  dgz   dd d         ddd           |                      g dddd            |                      dd!gddd d           |                      g d"ddd d
           |                      g dddd d           |                      g dddd d           |                      g dddd t          j        d#z
             |                      dgddd d           |                      g d$d%dd d
           |                      ddgd&dd'           |                      dd(gd)dd'           |                      g d*d+dd'           |                      dd,gd-dd.           |                      ddgd/dd/           |                      d/gd/dd/d           |                      d0d0gd1dd2           |                      d3gd3dd4           |                      dgddd/           |                      d5gd5dd/           |                      d6d7gd8dd9           |                      g d:d;dd9           |                      dgdz  d<d d=         dd>           |                      dgdz  d<d d=         dd>d?           |                      dgd@z  dAgz   d<d d=         dd>d@           |                      g ddddB           |                      ddgddddC           |                      ddgddddD           |                      ddgddddE           |                      ddFgdGddC           |                     t          dHddIdIdI           |                     t
          dHdd           |                     t
          dHddd           d S )JNr)   r*   r+   da|b|c|dsplit|r   r)   zb|c|drn   )r)   r*   zc|drm   rj   rr   )r)   r`   zb||c||d
a||b||c||dr   r`   endcase 	endcase |z
 startcasez| startcaser`   bothcaser`   
|bothcase|)r)   r`   zb c da  b c d r   (a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|rp      	a|a|a|a|a
a//b//c//d//zb//c//d)r)   r*   zc//dro   )r)   r`   zb////c////da////b////c////dendcase testtest
 begincasetest begincaser`   z
 bothcase r`   test bothcase testbcabbbcbbrk   r   abbaabbaaaaaaabaaAbobb
Abbobbbobbbbobb)r  Br`   AbbobbBbbobbdaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHBLAH      aBLAHasepmaxsplitr  r  r  r  b c da b c dr    rt   r\   ry   rz   rf   rV   r   r   s    r   
test_splitzBaseTest.test_split  sU   ,,,i#FFFYa@@@g	7CCCC)))9gsAFFF,,,i#qIII,,,i#qIII,,,i#A	' 	' 	'Ya@@@,,,lGS!LLL&'3777b'3///R(+wDDD\*M7CHHH,,,lGSIII0002H'SY[\]]]b7CRC.'3???b;-/$+SbS>7C	E 	E 	E 	,,,lGTJJJi(,qIII***L'4KKK,,,lGT1MMM,,,lGT1MMM,,,lGTB	( 	( 	(gtQGGG0002DgtUVWWWR(.'6JJJ\*,<gvNNN...0D	) 	) 	)dWgt<<<R%%888:::th>>>&'5999b'5111gu555f|WgFFFIIIb:ss"3WfEEEb:ss"3WfbIIIbH:-
CRC/@	- 	- 	- 	,,,icJJJg!7C! 	 	= 	= 	=g!7a 	 	A 	A 	Ag!7QC 	 	A 	A 	Ag!7Q 	 	8 	8 	8 	GWb"bAAA 	Wgr:::Wgr1=====r   c                 x   |                      g ddd           |                      g ddd           |                      g dd           |                      g dddd           |                      dd	gdddd
           |                      g ddddd           |                      g ddddd           |                      g ddddd           |                      g ddddt          j        dz
             |                      dgdddd           |                      g ddddd           |                      dgddd           |                      dgddd           |                      ddgddd           |                      ddgddd           |                      g dddd           |                      g ddddd           |                      dgdz  dd d          dd           |                      d!gdgd"z  z   dd d          ddd"           |                      g dd#dd$           |                      d%d	gd#dd$d
           |                      g d&d#dd$d           |                      g dd#dd$d           |                      g dd#dd$d           |                      g dd#dd$t          j        d'z
             |                      d#gd#dd$d           |                      g d(d)dd$d           |                      ddgd*dd+           |                      ddgd,dd+           |                      g d-d.dd+           |                      d/d0gd1dd2           |                      ddgd3dd3           |                      d3gd3dd3d           |                      d/d/gd4dd5           |                      d6gd6dd7           |                      dgddd3           |                      d8gd8dd3           |                      d9d:gd;dd<           |                      g d=d>dd<           |                      dgdz  d?d d@         ddA           |                      dgdz  d?d d@         ddAdB           |                      dCgdgdDz  z   d?d d@         ddAdD           |                      g ddddE           |                      g dddd E           |                      dFd	gddd d
G           |                      dd	gdddd
H           |                      dd	gdddd
G           |                      dd	gddd
dI           |                      dFd	gddd
H           |                     t          dJddKdKdK           |                     t
          dJdd           |                     t
          dJddd           d S )LNr   r  rsplitz	a  b  c dr`   r   r   za|b|cr   rn   )za|br+   r   rm   rj   rr   d   r   )za||b||cr`   r   r   r   r   z| begincaser   r   r   r   )za  br+   r   r   r   r)   r   r   rp   r   r   r   r   za//b//c)za//br+   r   r   )za////b////cr`   r   r   r   r   r   r  r  r   r+   r  r  rk   r  r  r  r	  r
  bbobr  
bbobbbobbAr  )r`   r  r  bbobbBbbobbAr  r  r  r  r  r  r  a b cr  r  r  r    rt   r  r   s    r   test_rsplitzBaseTest.test_rsplit  s   ,,,iBBB,,,k8DDDB))) 	,,,i3GGG#	8S!DDD)))9hQGGG,,,i3JJJ,,,i3JJJ,,,i3C	) 	) 	)Y#qAAA,,,lHc1MMM&(C888b(C000\*M8SIIIR(+xEEE,,,lHcJJJ0002H(TZ\]^^^b7CRC.(C@@@seBh. #2##r	; 	; 	; 	,,,lHdKKKC(,$JJJ***L(D!LLL,,,lHdANNN,,,lHdANNN,,,lHdA	' 	' 	'haHHH0002DhPTVWXXX\*,<hOOOR(.(FKKK...0D &	* 	* 	*sWh===R%5999%;;;th$???&(E:::b(E222h666|XwGGG'JJJb:ss"3XvFFFb:ss"3XvrJJJ
cU2X-
CRC/@ &"	. 	. 	. 	,,,isKKK,,,itLLL#!8 	 	C 	C 	C#!8S1 	 	> 	> 	>#!8q 	 	B 	B 	B#!8aS 	 	B 	B 	B#!8a 	 	9 	9 	9 	GXr2rBBB 	Wh;;;WhA>>>>>r   c                    | j         } |ddddd            |ddddd            |ddddd            |ddddd            |dddddd            |dddddd            |dddddt          j                    |ddddd            |ddddd            |ddddd            |d	dddd
            |ddddd            |dddddd            |dddddt          j                    |dddddd            |dddddd            |dddddd            |dddddd            |dddddd            |ddddd            |ddddd            |dddddd            |dddddt          j                    |dddddd            |dddddd            |dddddd            |dddddd            |dddddd            |ddddd            |ddddd            |dddddd            |dddddt          j                    |dddddd            |dddddd            |dddddd            |dddddd            |dddddd            |dddddd            |ddddd            |ddddd            |ddddd            |d d ddd            |d!d"dddd#            |dd$dd$d            |d%d&dd$d            |dd'dd$d            |dd(dd$d            |d)d*dd$d            |d+d+dd$d            |d,d,dd$d            |d-d.dd$d            |d/d0dd$dt          j                    |d/d0dd$dd            |d/d0dd$dd            |d/d0dd$dd            |d1d0dd$dd            |d0d0dd$dd            |d/d0dd$d            |d2d2dd$d            |d3d3dd$d            |d4d5dd4d            |d6d7dd4d            |d8d9dd4d            |d8d8dd4d            |d:d:dd;d;            |d<d:dd;d=            |d<d:dd;d=t          j                    |d<d:dd;d=d            |d<d:dd;d=d            |d<d:dd;d=d            |d>d:dd;d=d            |d:d:dd;d=d            |d:d:dd?d@            |dAd:ddBdC            |dDdEddBdC            |dFd:ddGdH            |dIdJddGdH            |d:d:ddKdH            |dLdMddNdO            |dLdMddNdOt          j                    |dLdMddNdOd            |dLdMddNdOd            |dLdMddNdOd            |dPdMddNdOd            |dQdMddNdOd            |dMdMddNdOd            |dRdSdd4dT            |dUdVdd4dT            |dSdSddWdW            |dXdYddZd[            |dXdYddZd[d            |dXdYddZd[t          j                    |dXdYddZd[d            |d\dYddZd[d            |dYdYddZd[d            |d]d^ddKd_            |d`daddbdc            |dYdYdd@d[            |dddeddfdg            |dddeddfdgt          j                    |dddeddfdgd            |dddeddfdgd            |dddeddfdgd            |dhdeddfdgd            |dideddfdgd            |dededdfdgd            |dSdjddSd4            |dkdlddSd4            |dmdmdd4dn           |                      dodpddHdqd           |                      drdpddHd           |                      dsdpddHdqd           |                      dtdpddHdqd           |                      dtdpddHdqd           |                      dpdpddHdqd           |                      dtdpddHdq           |                      dpdpddudq           |                      dpdpddudqd           |                      dvd2dddw           |                      dxd2dddwd           |                      d2d2dddwd           |                      ddddd           |                      d2d2ddydzd           |                      d2d2dd{dz           |                      dd|dd|d           |                      dd}dd|d           |                      dud~dd|d           |                     t          dd           |                     t          ddd           |                     t          dddd           |                     t          dddd           d S )Nr`   r   r  r#  z*A**z*1A*1z*1z*-#A*-#z*-#z*-A*-A*-AAz*-rp   rr   rj   z*-A*-Arm   z*-AArn   r   AAA
AAAAAAAAAABCDABACADAr   BCDABCADABACADAABCADABCADAAz*************z^A^a  ^AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA^i  theatertheaterthethethethethether  theatheatheatheathatthaetzhere and rezhere and therezhere and re and rezhere and there and therezhere and re and therer   abcdefgbobbbobobbobXbobbbobobXbbobobaaaaaaa
aaaaaaabobzWho goes there?ozWhO gOes there?OzWhO goes there?r)   qzwho goes there?Wwzwwho goes there?wwzWWho goes there?WWzWho goes there!?!zWho goes there!!zWho goes there??.zTh** ** a t**suezThis is a tissueisz**zTh** ** a tissuezTh** is a tissuecobobbobobcobcobobXcobocobbobobXbobobobbotReyKKjaviKK	ReykjavikrL   KK
ReyKKjavikzA----B----C----zA.B.C.z----u   ...м......&lt;   ...м......<r   z&lt;zham, ham, eggs and hamzspam, spam, eggs and spamspamhamzham, ham, eggs and spamzham, spam, eggs and spambobobobbobobXbobobbobobobXbobobobBOBOBOBbobbyzone@two!three!zone!two!three!@onetwothreezone@two@three!zone@two@three@r6   z-a-b-c--z-a-b-cr   z--xyrF   123123123x123r    rt   h)r\   ry   rz   rf   rV   )r   EQs     r   test_replacezBaseTest.test_replace%  s   _ 	2r9b"%%%
3Ir3'''
2r9c2&&&
2r9c3'''
2r9b"c***
3Ir3,,,
2r9b"ck222 	3YB'''
5#y"c***
7CB---
9c9b%000
:tYD111
:tYD"555
:tYD#+>>>
:tYD!444
:tYD!444
8T9b$222
64Ba000
4y"dA... 	2sIsB'''
2uib)))
2uib"---
2uib#+666
2uib!,,,
2uib!,,,
3y#r1---
4	3A...
5%CQ///
2|YR000
5)YR000
5)YR444
5)YR===
5)YR333
5)YR333
69ib!444
7Iy#r1555
8Y	3A666
9iCQ777
5'9c2...
5)YR000
5%C,,,
?OYR@@@
5"IsB<<< 	2ui+++
69i333
2xE2...
2~y%444
6%y%<<<
669eR000
7GYr222
=*IubAAA
!;eR	. 	. 	.
!;eR	% 	% 	%
!;eR	$ 	$ 	$
!;eR	$ 	$ 	$
"$>eR	$ 	$ 	$
%'AeR	$ 	$ 	$
!;YrRRR
5%E2...
9iE2666 	5(Iub111
9oy%<<<
9lIub999
9iE2666 	/CEEE
/CEEE
/CckRRR
/CbIII
/CaHHH
/CaHHH
/CaHHH
/CaHHH
/CEEE
/CEEE
!5y#sKKK
/CEEE
19c3GGG
/CEEE 	19dDIII
19dD#+VVV
19dD"MMM
19dD!LLL
19dD!LLL
19dD!LLL
19dD!LLL
19dD!LLL
7GYu555
?OYuEEE
7GYu555 	=+y#t<<<
=+y#tR@@@
=+y#tS[III
=+y#tQ???
<idA>>>
;YT1===
h	3???
 "4ifMMM
;YT::: 	#%@fe	% 	% 	%
#%@feS[	2 	2 	2
#%@feR	) 	) 	)
#%@feQ	( 	( 	(
#%@feQ	( 	( 	(
$&AfeQ	( 	( 	(
%'BfeQ	( 	( 	(
&(CfeQ	( 	( 	( 	7Iy'5999
=+YGGG
9iE7;;;(*:IsCQRSSS'7CLLL(*:IsCQRSSS(*:IsCQRSSS(*:IsCQRSSS(*:IsCQRSSS(*:IsCPPP(*:IsCPPP(*:IsCQRSSS	5)R===%BQ???uiS!<<<B	2r222uitQ???uit<<< 	E9eR888Hi;;;Y	5"===GY777GY;;;GYC@@@GYR@@@@@r   r   r   rr   z only applies to 32-bit platformsc                     ddz  }|                      t          |dd|           |                      t          |dd|           |                      t          |dd||z              d S )Nr  i   r   r`   r+  )rf   r   )r   A2_16s     r   test_replace_overflowzBaseTest.test_replace_overflow  sk     uy"eDDDy#uEEEy$eLLLLLr   c                    |                      dddd           |                      dddd           |                      dddd           |                      dddd           |                      dddd	           |                      d
d
dd
           |                      d
d
dd           |                      dddd
           |                      d
ddd           |                     t          dd           |                     t          ddd           |                     t          dddd           |                     t          dddd           |                     t          ddd           d S )NamrX  removeprefixspspamspamspamspamspampythonspiderzspam and eggsr`   r   r    rt   re  )helr   r   s    r   test_removeprefixzBaseTest.test_removeprefix  sd   fnd;;;
NNFKKKAAAAAAHHHB333B888."===G^W===G^<<<G^R@@@G^REEEG^S"EEEG^[IIIIIr   c                    |                      dddd           |                      dddd           |                      dddd           |                      dddd           |                      dddd	           |                      d
d
dd
           |                      d
d
dd           |                      dddd
           |                      d
ddd           |                     t          dd           |                     t          ddd           |                     t          dddd           |                     t          dddd           |                     t          ddd           d S )Nrn  rX  removesuffixrl  ro  rp  rq  blamzeggs and spamr`   r   r    rt   re  )lort  r   r   s    r   test_removesuffixzBaseTest.test_removesuffix  sd   fnd;;;
NNFKKKAAA???HHHB333B888."===G^W===G^<<<G^R@@@G^REEEG^S"EEEG^[IIIIIr   c                 &   |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                     t          ddd	           d S )
N hello 
capitalizeHello hello Aaaar  AaAar    rt   r   r   s    r   test_capitalizezBaseTest.test_capitalize  s    	9l;;;(<888(<888555555G\2>>>>>r   c                 l   |                      g ddd           |                      g ddd           |                      ddgddd d	           |                      g d
ddd d           |                      g dddd d           |                      g dddd d           |                      g dddd t          j        d	z
             |                      dgddd d           |                      dgddd d           |                      g dddd d           |                      g dd           |                      dgdd           |                      ddgdd           |                      ddgddd d	           |                      dgddd d           |                      ddgddd d	           |                      g dddd d           |                      g dddd d           |                      ddgdd           d}|                      dgdz  |d           |                      dg|dd          gz   |dd d	           |                      dgdz  d gz   |dd d           d!D ]P}|                      d"d#g|d           |                      d"d#g|dd            |                      d"d#g|dd d           Qd S )$N)thisrL  r5  r   functionzthis is the split functionr   r   a b c d r)   r  r  rn   )r)   r*   zc drm   rj   rr   r   z	  a b c d)r)   r*   zc  d
a  b  c  d	           a    r*     a    b   zb   za    b   c     a    b   c   zb   c   )r)   r*   zc   r(   
	a 	 b  < a  a  a  a  a  a  a  a  a  a  a  a  a  a  a  a  a  a  a  a r   r  za zarf	barfzarf
barfzarfbarfzarfbarfzarfbarfarfbarfr\   ry   rz   r   rk   r*   s      r   test_additional_splitzBaseTest.test_additional_split  s6   BBB('	3 	3 	3 	,,,j'BBBg	7D!DDD)))9gtQGGG,,,i$JJJ,,,i$JJJ,,,i$A	' 	' 	'YqAAA['4CCC***L'4KKKK111y'222c
M7;;;f}gtQGGG)+<gtQOOOj)+<gtQOOO***,=waPPP):GT1MMMc
$6@@@b#w///QRR	)3qAAAbD6)3rBBB, 	B 	BAOOUFOQ888OOUFOQ>>>OOUFOQqAAAA		B 	Br   c                 p   |                      g ddd           |                      g ddd           |                      ddgddd d	           |                      g d
ddd d           |                      g dddd d           |                      g dddd d           |                      g dddd t          j        dz
             |                      dgddd d           |                      dgddd d           |                      g dddd d           |                      g dd           |                      dgdd           |                      ddgdd           |                      ddgddd d	           |                      dgddd d           |                      ddgddd d	           |                      g dddd d           |                      g dddd d           |                      ddgddd d            d!}|                      dgdz  |d           |                      |d d"         gdgz   |dd d	           |                      d#gdgd$z  z   |dd d$           d%D ]P}|                      d&d'g|d           |                      d&d'g|dd            |                      d&d'g|dd d           Qd S )(N)r  rL  r5  r"  r  zthis is the rsplit functionr"  r   r  r'  r   r  rn   )za br+   r   rm   rj   rr   r   r   z	a b c d  )za  br+   r   r  r  r)   r  r*   r    az  a    b   cr  z  a    br+   )r  r*   r+   r(   r  X   r  r  z a  ar  r  r  r  r  r  s      r   test_additional_rsplitzBaseTest.test_additional_rsplit0  sY   CCC6	B 	B 	B 	,,,j(CCC#	8T1EEE)))9haHHH,,,i4KKK,,,i4KKK,,,i4B	( 	( 	(Y$BBB[(D!DDD***L(D!LLLK222y(333c
M8<<<mXtQGGG(*;Xa	! 	! 	!C(*;Xa	! 	! 	!)))+<ha	! 	! 	!):Ha	! 	! 	!c
$6$KKKb#x000SbS
cU*C4CCC	SE"H,c8T2FFF, 	C 	CAOOUFOQ999OOUFOQ$???OOUFOQ$BBBB		C 	Cr   c                    |                      ddd           |                      ddd           |                      ddd           |                      ddd           d}|                      d	|d           |                      d
|d           |                      d|d           |                      dddd            |                      dddd            |                      dddd            |                      dddd            d S )Nr    z   hello   stripzhello   lstripz   hellorstripz 	
abc 	
r   z	abc 	
z	 	
abcr\   )r   r*   s     r   test_strip_whitespacezBaseTest.test_strip_whitespaceX  s   888
M8<<<
M8<<<'222'q'***(!X666(!X666 	>>>
M8TBBB
M8TBBB'488888r   c                    |                      dddd           |                      dddd           |                      dddd           |                      dddd           |                      d	d
dd
           |                      dd
dd           |                     t          dddd           |                     t          dddd           |                     t          dddd           d S )Nr    xyzzyhelloxyzzyr  xyz
helloxyzzyr  
xyzzyhellor  r`   mississippi
mississippr   rt   r   r   s    r   
test_stripzBaseTest.test_stripi  s    !2GUCCC&75III&75III'5999M7MBBB 	mWcBBBGWb"===GXr2>>>GXr2>>>>>r   c                 0   |                      dddd           |                      dddd           |                      dddd           |                      dddd           |                      d	dddd
           |                     t          dd           d S )Nz
abc       r   ljustro   zabc   r   rj   rm   z
abc*******r*  r   r   s    r   
test_ljustzBaseTest.test_ljustx      eWb999%!444ugq111ugq111eWb#>>>E733333r   c                 0   |                      dddd           |                      dddd           |                      dddd           |                      dddd           |                      d	dddd
           |                     t          dd           d S )Nz
       abcr   rjustro   z   abcr   rj   rm   z
*******abcr*  r   r   s    r   
test_rjustzBaseTest.test_rjust  r  r   c                 0   |                      dddd           |                      dddd           |                      dddd           |                      dddd           |                      d	dddd
           |                     t          dd           d S )Nz
   abc    r   centerro   z abc  r   rj   rm   z
***abc****r*  r   r   s    r   test_centerzBaseTest.test_center  s    eXr:::%1555uh222uh222eXr3???E844444r   c                 n    |                      ddd           |                     t          ddd           d S )NzhEllO CoMPuTErSzHeLLo cOmpUteRsswapcaser    rt   r   r   s    r   test_swapcasezBaseTest.test_swapcase  s:    )+<jIIIGZ<<<<<r   c                 ~   |                      dddd           |                      dddd           |                      dddd           |                      dddd           |                      dddd           |                      dddd	           |                      d
d
dd           |                      d
d
dd           |                      dd
dd	           |                      dddd           |                      dddd           |                      dddd           |                     t          dd           d S )NrF   zfillrm   rj   0123rr   z+123z+0123r   z-123z-0123000r`   34rn   0034r   r   s    r   
test_zfillzBaseTest.test_zfill  s@   ugq111ugq111w222333333!444333333!444r7A...dGQ///gq111E733333r   c                    |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      dd	d           |                      dd
d           |                     t          ddd           d S )NFr`   islowerTr)   r  
r   aBcabc
rt   r   r   s    r   test_islowerzBaseTest.test_islower  s    r9---c9---sI...tY///eY///ui000gy111E9b99999r   c                    |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      dd	d           |                      dd
d           |                     t          ddd           d S )NFr`   isupperr)   Tr  r  ABCAbCzABC
r   rt   r   r   s    r   test_isupperzBaseTest.test_isupper  s    r9---sI...c9---tY///eY///ui000gy111E9b99999r   c                 :   |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      dd	d           |                      dd
d           |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                     t          ddd           d S )NFr`   istitler)   Tr  r  zA Titlecased LinezA
Titlecased LinezA Titlecased, LinezNot a capitalized StringzNot	a Titlecase StringzNot--a Titlecase StringNOTr   rt   r   r   s    r   test_istitlezBaseTest.test_istitle  s   r9---sI...c9---tY///19===2I>>>2I>>>99EEE8)DDD8)DDDui000E9b99999r   c                    |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      dd	d           |                      dd
d           |                      ddd           |                     t          ddd           d S )NFr`   isspacer)   T 	r  z 	
z 	
ar   rt   r   r   s    r   test_isspacezBaseTest.test_isspace  s    r9---sI...c9---dI...dI...dI...i333z9555E9b99999r   c                    |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      dd	d           |                      dd
d           |                     t          ddd           d S )NFr`   isalphaTr)   r  r  r   aBc123r  rt   r   r   s    r   test_isalphazBaseTest.test_isalpha  s    r9---c9---c9---tY///eY///x333w	222E9b99999r   c                    |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      dd	d           |                      dd
d           |                      ddd           |                     t          ddd           d S )NFr`   isalnumTr)   r  r  	123abc456a1b3czaBc000 r  r   rt   r   r   s    r   test_isalnumzBaseTest.test_isalnum  s    r9---c9---c9---tY///k9555gy111y)444w	222E9b99999r   c                 2   |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      dd	d           t          d
          D ]|}|                      dd|z  dz   d           |                      dd|z  dz   d           |                      dd|z  dz   dz   d           |                      dd|z  dz   dz   d           }d S )NTr`   isasciir   z F      ér-   r  z        )r\   r}   )r   r   s     r   test_isasciizBaseTest.test_isascii  s0   b),,,fi000fi000j)444vy111vy111 q 	F 	FAOOD#a%&.)<<<OOE3q56>9===OOD#a%&.5"8)DDDOOE3q56>E#99EEEE		F 	Fr   c                 &   |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                     t          d	dd
           d S )NFr`   isdigitr)   T0
01234567890123456789ar   rt   r   r   s    r   test_isdigitzBaseTest.test_isdigit  s    r9---sI...c9---lI666}i888E9b99999r   c                 T   |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      dd	d           |                      d
dd           |                     t          ddd           d S )Nz Hello r|  titler~  r  zFormat This As Title StringzfOrMaT thIs aS titLe StringzFormat,This-As*Title;StringzfOrMaT,thIs-aS*titLe;StringGetintgetIntr    rt   r   r   s    r   
test_titlezBaseTest.test_title  s    	9g666(G444(G44457TV]^^^57TV]```(G444GWb99999r   c                 B   |                      g ddd           |                      g ddd           |                      g ddd           |                      g ddd           |                      g dd	d           |                      g d
dd           |                      g d
ddd           |                      g dddd           |                      g d
ddd           |                      g dddd           |                     t          dddd           d S )N)r   r   r`   r   zabc
def
ghi
splitlineszabc
def

ghi)r   r   r   zabc
def
ghizabc
def
ghi
)r   r   r   r`   zabc
def
ghi
)r`   r   r   r   r`   z
abc
def
ghi
F)r  r  zdef
zghi
r  T)keependsr   rt   r   r   s    r   test_splitlineszBaseTest.test_splitlines  s   1113DlSSS1113FUUU---/@,OOO---/BLQQQ1113H,WWW5557NP\]]]555/u	F 	F 	FAAA/t	E 	E 	E5557N$u 	 	6 	6 	6AAA/ 	 	N 	N 	N 	E<R@@@@@r   )4r   r   r   r?   r{   r3   rI   r\   rf   rh   r   r   r   r   r   r   r   r   r   r   r   r(  rg  unittestskipIfry   rz   r   r   rj  ru  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/      s        I
 N
  A A A2 2 20 EI > > > > >( ( (
>N >N >N@7; 7; 7;r3= 3= 3=j> > >2? ? ?41 1 1(1 1 1$: : :
: : :
D D D:D> D> D>LL? L? L?\oA oA oAb X_S[G,I0D0D0I79 9M M9 9MJ J J$J J J$? ? ?"B "B "BH&C &C &CP9 9 9"? ? ?4 4 44 4 45 5 5= = =
4 4 4 : : :: : :: : :	: 	: 	:: : :	: 	: 	:F F F: : :: : :A A A A Ar   r/   c                       e Zd Zd Zd ZdS )
CommonTestc                     |                      d          }|                      d          }|D ]}||z  }t          |           |                     t          |          t          |                     d S )NDNSSECr`   )r?   hashrT   )r   r)   r*   r+   s       r   	test_hashzCommonTest.test_hash  sq    NN8$$NN2 	 	AFAGGGGa$q''*****r   c                    |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      dd	d           |                      d
d
d           d S )Nu   ῼῳῳῳu   ῳῳῼῼr}  u   Ⓟⓨⓣⓗⓞⓝu   ⓅⓎⓉⒽⓄⓃu   ⓟⓨⓣⓗⓞⓝu	   Ⅰⅱⅲu	   ⅠⅡⅢu	   ⅰⅱⅲu   ƛᴀᶆȡᾷr  r   s    r   test_capitalize_nonasciiz#CommonTest.test_capitalize_nonascii(  s     	22L	B 	B 	B 	>>	N 	N 	N>>	N 	N 	N,,l	< 	< 	<,,l	< 	< 	< 	88,	H 	H 	H 	H 	Hr   N)r   r   r   r  r  r   r   r   r  r    s7        + + +H H H H Hr   r  c                       e Zd Zd Zd Zd Zd Zd Zd Zd Z	d Z
d	 Zej        d
             Zd Zd Zd Zd Zd Zd ZdS )MixinStrUnicodeUserStringTestc                    |                      dddd           |                      dddd           |                      dddd           |                      dddd           |                      dddd           |                      ddddd	           |                      dddd
d           |                      dddd
d           |                      ddddd           |                      ddddd           |                      ddddd           |                      dddddd           |                      dddddd           |                      dddddd	           |                      dddddd           |                      ddddd	d           |                      dddddd           |                      dddddd           |                      dddddd           |                      dddddd           |                      ddddd           |                      ddddd           |                      dddd
d           |                      dddd
d           |                      dddddd           |                      ddddd           |                     t          dd           |                     t          ddd           |                      dddd           |                      dddd           |                      dddd           |                      dddd            |                      dddd!d           |                      dddd"d           |                      dddd#dd           |                      dddd$dd	           |                      dddd$dd%           |                     t          ddd&           d S )'NTr    r   rs  Fhello worldr`   ellorn   rD  rr   r   ry  r   
helloworldloworj   r   r   rp   irq   r  irt   rs  hary  llohelloxr    r   helloworldr  r  r  r	  )ry  rs  rs  helrm   rt   r   r   s    r   test_startswithz-MixinStrUnicodeUserStringTest.test_startswith?  s   g|T:::g|W===wmDDDg|R888wf===g|VQ???g|S!<<<wc1===g|R;;;wdA>>>lL&!DDDlL&!QGGG|\61aHHHb,Aq999b,Aq999r<Q::: 	g|T1bAAAg|T3CCCwgq"EEEwmRMMMwfbAAAg|VR@@@wc2>>>g|S"===g|RR@@@wdB???G\:::G\2>>> 	g|\BBBwmDDDg|5HIIIwb999lL ;JKL	N 	N 	N|\ <CDE	G 	G 	Gg|\1bIIIwmQJJJg|]AqIIIG\5AAAAAr   c                 r   |                      dddd           |                      dddd           |                      dddd           |                      dddd           |                      dd	dd
           |                      dd	dd
dd           |                      dd	dddd           |                      dd	dddd           |                      dd	dddd           |                      dd	dddd           |                      dd	dddd           |                      dd	dddd           |                      dddddd           |                      dddddd           |                      dddddd           |                      dddddd           |                      dddddd           |                      ddddd           |                      ddddd           |                      dddddd           |                      dddddd           |                      dd	dd
d           |                      dd	dd
dd           |                      dd	dd
dd           |                      dd	dddd           |                      dd	dddd           |                      dd	dddd           |                      dd	dddd           |                      dd	dddd            |                      dd	dddd           |                     t          dd           |                     t          ddd!           |                      dddd"           |                      dddd#           |                      dddd$           |                      dddd%           |                      dd	dd&d           |                      dd	dd'dd           |                      dddd(dd           |                      dddd)dd           |                      dddd*dd           |                     t          ddd+           d S ),NTr    endswithry  Frs  r`   r  r  worlrj   r   worldr   r  rn   r   rm   rr   r-   r   r   r  r   rq   ir  rp   iiir  rt   r  r  r  r   r  r
  )hellellr  )rs  r  r  r   r   s    r   test_endswithz+MixinStrUnicodeUserStringTest.test_endswitho  s   gz4888w
D999gz2666w
MBBB|Z@@@lJ1EEElJBGGGlJ1EEElJ1EEElJ1EEE|ZAFFF|ZAFFFtZq!<<<tZq!<<<b*b!Q777b*b!Q777r:r1a888 	gz4<<<w
D"===gz2r2>>>w
M3KKK|ZDDDlJBGGGlJAFFFlJRHHHlJRHHHlJBGGGlJBGGG|ZBGGG|ZRHHHGZ888GZ<<< 	w
LAAAgz=AAAgz3FGGGw
B777lJ 9JKL	N 	N 	N|Z :CDEr	K 	K 	Kgz?ArJJJw
M1aHHHgz>1aHHHGZ?????r   c                    |                      dddd           |                      dddd           |                      dddd           |                      dddd           |                      dddd           |                      dddd	           |                      dd
dd
           |                      dddd
           |                      dddd
           d S )NTr`   __contains__r   Fr   z abczabc r)   asdfasdr  r   s    r   test___contains__z/MixinStrUnicodeUserStringTest.test___contains__  s    b."555e^R888und;;;g~t<<<g~t<<<g~s;;;fnf===unf===r>6:::::r   c           	         |                      dddd           |                      dddd           |                      dddd           |                      dddt          dd                     |                      dddt          dd                     |                      dddt          dd	                     |                      d
ddt          dd                     |                     t          ddd           dt	                      fD ]H}d                    t          |          j                  }|                     t          dd||           Id S )Nr)   r   r   r   r+   rp   rj   r   rn   r`   r   z)string indices must be integers, not '{}'r]   )r\   slicerf   rV   objectr#   rH   r   )r   idx_typer^   s      r   test_subscriptz,MixinStrUnicodeUserStringTest.test_subscript  sJ   UM1555UM2666UM1555umU1a[[AAAumU1d^^DDDUM5A;;???E=%1++>>>E=%@@@) 	c 	cHFMMdS[nnNeffLY}hUabbbb	c 	cr   c           	         |                      dddt          dd                     |                      dddt          dd                     |                      dddt          dd                     |                      dddt          d	d                     |                      d
ddt          d	d                     |                      dddt          dd                     |                      dddt          dd                     |                      dddt          dd                     |                      dddt          dd	                     |                     t          ddd           d S )Nr   r   r   r   rj   r   rm   r  rn   r*   r`   r   r   )r\   r  rf   rV   r   s    r   
test_slicez(MixinStrUnicodeUserStringTest.test_slice  sF   umU1d^^DDDumU1a[[AAAe]E!QKK@@@e]E!QKK@@@UM5A;;???E=%1++>>>E=%d2C2CDDDE=%d2C2CDDDE=%1++>>>E=%@@@@@r   c                 4   t           j        t           j        z   }dd dddt          j        dddf	}|D ]f}|D ]a}|dd          D ]T}t          |          |||         }|                     d                    |          |d	t          |||                     Ubgd S )
Nr   rn   rj   )   rp   r  ir`   r   )	stringascii_lettersr   ry   rz   r@   r\   r   r  )r   r   indicesstartstopstepLs          r   test_extended_getslicez4MixinStrUnicodeUserStringTest.test_extended_getslice  s     6=0dAq"ck2r3? 	> 	>E > >#ABBK > >DQd40AOOBGGAJJ=$)%t$<$<> > > >>>	> 	>r   c                 8   |                      dddd           |                      dddd           |                      dddd           |                      dddd           |                     t          dd           |                     t          ddd           d S )	Nr`   r   __mul__rp   r   rn   	abcabcabcrj   r   r   s    r   test_mulz&MixinStrUnicodeUserStringTest.test_mul  s    E9b111E9a000ui333UIq999E9555E9b99999r   c           	      8   |                      dddg d           |                      dddd           |                      dddd           |                      d	ddd
           |                      dddt                                 |                      dddd           |                      dddt          dg                     |                      dddg d           |                     t          dj        g d           dD ]b}|                      d|z  dz   |z  d d         ddd|z  g|z             |                      d|z  dz   |z  d d         ddd|z  f|z             c|                      dddt                                 |                     t          dd           |                     t          ddd            |                     t          ddd           |                     t          ddddt                      g           	 d }| 	                    d                               |                       | 
                    d           d S # t          $ r7}dt          |          vr| 
                    d           Y d }~d S Y d }~d S d }~ww xY w)Nr  r  r   r   r   r`   bd)r`   r*   r`   r   ac)r)   r`   r+   r`   zw x y zr   r)   )r   zza.b.crK  r(   )r)   r*   rj   )r      }   ra  rp   r'  r   rn   rm   c               3      K   ddz   V  d S )Nrr   r`   r   r   r   r   fz2MixinStrUnicodeUserStringTest.test_join.<locals>.f  s      "fr   zexception not raised+zjoin() ate exception message)r\   r   r   ra   rV   r   r&   rf   bytesr3   failr=   )r   r   r7  es       r   	test_joinz'MixinStrUnicodeUserStringTest.test_join  s    		30D0D0DEEEF,@AAAb&*<===b&*<===	3

;;;sFH555S&(C5//:::fooo>>>)SX}}}=== 	! 	!AOOsQw#o2CRC8#v'Q     OOsQw#o2CRC8#v'a! ! ! ! 	fgii888C000C666C333C!QAAA	.  LL""1133'''
 II,-----	  	: 	: 	:#a&&  		8999999999 !     	:s   3I 
J"&JJc                    |                      dddd           |                      dddd           |                      dd	dd           |                      dd	dd           |                      d
d	dd           |                      dd	dd           |                      dddd           |                      dd	dd           dD ]&}|                     t          t          fd	d|           't          j        dz   }t          |          }|                      dddd           |                      dddd           |                      |dd|           |                     ddt          |                     |                      dddd           |                      dddd           |                     t          dd           |                     t          ddd           |                     t          ddd           |                     t          d	dd           |                     t          d di            |                     t          d!dd"           |                     t          ddd           |                     t          ddd#           |                      d$d%dd&d$i           |                      d'd(dd)           |                     t          d*dd+           |                     t          d,dd-           |                     t          d.dd           |                     t          d/d0z  dd1           |                     t          d2d0z  dd1           |                     t          d*dt          j        d3z   d4f           |                     t          d5dt          j        d3z   d6f            G d7 d8t                    }|                     t          dd |                       d S )9Nz+hello+z+%s+__mod__r    z+10+z+%d+ro   r)   z%c""   $$   10z%dr     )ii    z 42z%3ldrt   42      E@z0042.00z%07.2fz%07.2Fr   z%(foo)sz%s%sr  r
   z%(fooz%(foo)s %(bar)s)foort   y      E@        barz	%((foo))sz(foo)haaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaxz%sxgaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa%*s)rG  rH  z%10.*f)rG  rF  z%10z%%%dfl            g	@z%%.%dfrn   r`   %.*f$I$I?c                       e Zd ZdS )8MixinStrUnicodeUserStringTest.test_formatting.<locals>.XNrQ   r   r   r   XrO  7  s          r   rP  )r\   rf   r   r   ry   rz   r=   rh   floatrV   r  )r   ordinal	longvalue
slongvaluerP  s        r   test_formattingz-MixinStrUnicodeUserStringTest.test_formatting  s   	69g>>>	2666T9c222T9c222T9b111T9b111dIr222i666' 	T 	TGj-8$	7SSSSK"$	^^
vy"555dIt444
D)Y???tYi(8(8999	8Y;;;	8Y;;;E9555Iy"===FIu===D)W===Wi<<<$5y+NNND)T:::D)e=== 	{I7GHHH 	UIw???E9nEEEHiFFFUIu=== 	W%6	CIIIX%7SJJJy+/2.	0 	0 	0	+/62	4 	4 	4 	E9aacc:::::r   c                    t          j        d          }d|j                                        dz   z  dz
  }|                     t
          dd|j        dz   df           |                     t
          dd|j        dz   df           |                     t
          dd|dz   df           |                     t
          dd|j        dz   df           d S )N	_testcapirn   rK  r>  r`   rL  rM  )r   import_modulePY_SSIZE_T_MAX
bit_lengthrf   r   INT_MAXUINT_MAX)r   rW  SIZE_MAXs      r   test_formatting_c_limitsz6MixinStrUnicodeUserStringTest.test_formatting_c_limits:  s    !/<<	)2==??!CDIy#2Q6;	= 	= 	=	#+a/8	: 	: 	: 	y"Q,+	- 	- 	-	#,q0&9	; 	; 	; 	; 	;r   c                     t          d          D ]=}d|z  }d}t          d          D ]$}|dz  dz  dz  }|                     |d|           %>d S )	Nr#  z%%.%ifg{Gz?<   g.DT!	@g      @g      $@r>  )r}   rh   )r   precr#   r;   r6   s        r   test_floatformattingz2MixinStrUnicodeUserStringTest.test_floatformattingH  sv    #JJ 	9 	9D_FE2YY 9 9-3d:vy%88889	9 	9r   c                 2   |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      ddddd           |                      ddd           |                      ddd	           |                      ddd           |                      ddd
           |                      ddd           |                      ddd           |                      ddd           d S )Nr)   r  r   Tr  r   r  r   r}  r  r  r  r   s    r   test_inplace_rewritesz3MixinStrUnicodeUserStringTest.test_inplace_rewritesQ  s   S'***c9---S'***c9---S)S#666c9---S,///c9---S*---c9---S'***c9-----r   c                 n   |                      dddd           d}|                      d|dd           |                      d|dd	           |                      d
|dd           |                      d|dd           |                     t          |dd           |                     t          |dd            d S )N)zthis is the partiztion methodzthis is the partition method	partitionrf  http://www.python.orghttp://www.python.orgrk  )rh  r`   r`   rI  r`   http://rl  rn  zhttp://www.python.orgr`   rp  r`   r\   rf   r   rV   r   Ss     r   test_partitionz,MixinStrUnicodeUserStringTest.test_partitiond  s    @*K	? 	? 	? $91k5QQQ91k3OOO91k9UUU91k5QQQQR888A{D99999r   c                 n   |                      dddd           d}|                      d|dd           |                      d|dd	           |                      d
|dd           |                      d|dd           |                     t          |dd           |                     t          |dd            d S )N)zthis is the rpartirf  z	on methodzthis is the rpartition method
rpartitionrf  rh  ri  rk  )r`   r`   rh  rI  rm  rn  ro  rp  r`   rq  rr  s     r   test_rpartitionz-MixinStrUnicodeUserStringTest.test_rpartitions  s    A+\4	A 	A 	A $91lERRR91lCPPP91lIVVV91lERRRQb999A|T:::::r   c                    d}|                      d|ddd            |                      d|dddd            |                      d|ddd d           |                      d|ddd d            |                      d|d	dd            |                      d|d	ddd            |                      d|d	dd d           |                      d|d	dd d            |                      d|d
dd            |                      d|d
ddd            |                      d|d
dd d           |                      d|d
dd d            |                      d|ddd            |                      d|dddd            |                      d|ddd d           |                      d|ddd d            |                      d|ddd            |                      d|dddd            |                      d|ddd d           |                      d|ddd d            |                      d|ddd            |                      d|dddd            |                      d|ddd d           |                      d|ddd d            |                      d|ddd            |                      d|dddd            |                      d|ddd d           |                      d|ddd d            d S )Nr    rm   r   rt  rj   r  r   re  r   r   r   rl   rn   r6   Tr  rD  ry  Fr   r  )r   r   s     r   test_none_argumentsz1MixinStrUnicodeUserStringTest.test_none_arguments  s   1fc40001fc2t4441fc44441fc46661gsD1111gsB5551gsD"5551gsD$7771gsD1111gsB5551gsD"5551gsD$7771hT2221hR6661hT26661hT48881gsD1111gsB5551gsD"5551gsD$777aS$777aT2t<<<aS$;;;q*c4>>>asD999asB===asD"===q,T4@@@@@r   c           	      D   d}d}|                      t          d|j        |d d d            |                      t          d|j        |d d d            |                      t          d|j        |d d d            |                      t          d|j        |d d d            |                      t          d|j        |d d d            |                      t          d|j        |d d d            |                      t          d	|j        |d d d            | 	                    d
ddd           d S )Nr    r6   z^find\(z^rfind\(z^index\(z	^rindex\(z^count\(z^startswith\(z^endswith\(ro   rW  r   r   )
assertRaisesRegexrV   r   r   r   r   rl   r   r  r\   )r   r   r6   s      r   *test_find_etc_raise_correct_error_messageszHMixinStrUnicodeUserStringTest.test_find_etc_raise_correct_error_messages  sM   y*af !4t	5 	5 	5y+qw !4t	5 	5 	5y+qw !4t	5 	5 	5y, !4t	5 	5 	5y+qw !4t	5 	5 	5y*:AL !4t	5 	5 	5y.!* !4t	5 	5 	5 	.<<<<<r   N)r   r   r   r  r  r  r  r!  r+  r/  r<  rU  r   cpython_onlyr^  rb  rd  rt  rw  ry  r|  r   r   r   r  r  ;  s(       .B .B .B`2@ 2@ 2@h	; 	; 	;c c cA A A
> 
> 
>: : :". ". ".H3; 3; 3;j ; ; ;9 9 9. . .&: : :; ; ;$A $A $AL= = = = =r   r  c                       e Zd Zd ZdS )MixinStrUnicodeTestc                 r   | j         } G d d|          } |d          } |                                |g          }|                     ||           |                     t	          |          |            |d          } |                                |g          }|                     ||           d S )Nc                       e Zd ZdS )5MixinStrUnicodeTest.test_bug1001011.<locals>.subclassNrQ   r   r   r   subclassr    s        Dr   r  r   )r?   r   rU   rG   rH   )r   tr  s1s2s        r   test_bug1001011z#MixinStrUnicodeTest.test_bug1001011  s    
 N	 	 	 	 	q 	 	 	XfQSSXXrd^^R   d2hh"""QvYYQSSXXrd^^b"r   N)r   r   r   r  r   r   r   r  r    s#            r   r  )r  r$  ry   r   r   r   test.supportr   collectionsr   r   r   r   r&   r/   r  r  r  r   r   r   <module>r     s   % $ $ $ $ $ $ $ $ $ $ $ $ $ $ $       & & & & & &             1 1 1 1 1 1 1 1
> > > > >h > > >         h      @A @A @A @A @A @A @A @AF H H H H H H H H@A= A= A= A= A= A= A= A=H         r   