B
    u9aŸ ã               @   s¤   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 G dd„ dƒZG dd„ deƒZ	G dd	„ d	eƒZ
G d
d„ dƒZG dd„ deƒZG dd„ dƒZG dd„ dƒZdS )é    N)Úsupport)ÚUserListc               @   s&   e Zd Zd	dd„Zdd„ Zdd„ ZdS )
ÚSequenceÚwxyzc             C   s
   || _ d S )N)Úseq)Úselfr   © r   ú"/usr/lib/python3.7/string_tests.pyÚ__init__
   ó    zSequence.__init__c             C   s
   t | jƒS )N)Úlenr   )r   r   r   r	   Ú__len__   r   zSequence.__len__c             C   s
   | j | S )N)r   )r   Úir   r   r	   Ú__getitem__   r   zSequence.__getitem__N)r   )Ú__name__Ú
__module__Ú__qualname__r
   r   r   r   r   r   r	   r   	   s   
r   c               @   s   e Zd Zdd„ Zdd„ ZdS )ÚBadSeq1c             C   s   dddg| _ d S )Né   Úhelloé{   )r   )r   r   r   r	   r
      r   zBadSeq1.__init__c             C   s   dj | jŽ S )Nz{0} {1} {2})Úformatr   )r   r   r   r	   Ú__str__   r   zBadSeq1.__str__N)r   r   r   r
   r   r   r   r   r	   r      s   r   c               @   s   e Zd Zdd„ Zdd„ ZdS )ÚBadSeq2c             C   s   dddg| _ d S )NÚaÚbÚc)r   )r   r   r   r	   r
      r   zBadSeq2.__init__c             C   s   dS )Né   r   )r   r   r   r	   r      r   zBadSeq2.__len__N)r   r   r   r
   r   r   r   r   r	   r      s   r   c               @   s\  e Zd ZdZdZdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Z	dd„ Z
dd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd „ Zd!d"„ Ze ejd#kpªe d$¡d%kd&¡d'd(„ ƒZd)d*„ Zd+d,„ Zd-d.„ Zd/d0„ Zd1d2„ Z d3d4„ Z!d5d6„ Z"d7d8„ Z#d9d:„ Z$d;d<„ Z%d=d>„ Z&d?d@„ Z'dAdB„ Z(dCdD„ Z)dEdF„ Z*dGdH„ Z+dIdJ„ Z,dKdL„ Z-dMdN„ Z.dOdP„ Z/dS )QÚBaseTestNFc                s~   t |tƒrˆ j |¡S t |tƒr2‡ fdd„|D ƒS t |tƒrRt‡ fdd„|D ƒƒS t |tƒrvt‡ fdd„| ¡ D ƒƒS |S d S )Nc                s   g | ]}ˆ   |¡‘qS r   )Úfixtype)Ú.0Úx)r   r   r	   ú
<listcomp>+   s    z$BaseTest.fixtype.<locals>.<listcomp>c                s   g | ]}ˆ   |¡‘qS r   )r   )r    r!   )r   r   r	   r"   -   s    c                s$   g | ]\}}ˆ   |¡ˆ   |¡f‘qS r   )r   )r    ÚkeyÚvalue)r   r   r	   r"   0   s   )Ú
isinstanceÚstrÚ	__class__Ú	type2testÚlistÚtupleÚdictÚitems)r   Úobjr   )r   r	   r   '   s    




zBaseTest.fixtypec             C   s   |   t|  d¡ƒ| j¡ d S )NÚ123)ÚassertIsÚtyper   r(   )r   r   r   r	   Útest_fixtype6   s    zBaseTest.test_fixtypec                s¬   ˆ   |¡}ˆ   |¡}ˆ   |¡}‡ fdd„| ¡ D ƒ}t||ƒ||Ž}ˆ  ||¡ ||kr¨yG dd„ dˆ jjƒ}W n tk
r„   Y n$X ||ƒ}t||ƒ|Ž }ˆ  ||¡ d S )Nc                s   i | ]\}}ˆ   |¡|“qS r   )r   )r    ÚkÚv)r   r   r	   ú
<dictcomp>>   s    z'BaseTest.checkequal.<locals>.<dictcomp>c               @   s   e Zd ZdS )z$BaseTest.checkequal.<locals>.subtypeN)r   r   r   r   r   r   r	   ÚsubtypeH   s   r5   )r   r,   ÚgetattrÚassertEqualr'   r(   Ú	TypeErrorÚassertIsNot)r   Úresultr-   Ú
methodnameÚargsÚkwargsZ
realresultr5   r   )r   r	   Ú
checkequal:   s     


zBaseTest.checkequalc          	   G   sN   |   |¡}|   |¡}|  |¡}t||ƒ|Ž  W d Q R X |  t|jƒd¡ d S )NÚ )r   ÚassertRaisesr6   ZassertNotEqualr&   Z	exception)r   Úexcr-   r;   r<   Úcmr   r   r	   ÚcheckraisesR   s
    

zBaseTest.checkraisesc             G   s&   |   |¡}|   |¡}t||ƒ|Ž  d S )N)r   r6   )r   r-   r;   r<   r   r   r	   Ú	checkcallZ   s    

zBaseTest.checkcallc                sN  ˆ   dddd¡ ˆ   dddd¡ ˆ   dddd¡ ˆ   dddd¡ ˆ   dddd¡ ˆ   dddd¡ ˆ   dddd¡ ˆ   ddddd¡ ˆ   ddddd	¡ ˆ   ddddd
¡ ˆ   ddddd¡ ˆ   dddddd¡ ˆ   dddddd	¡ ˆ   dddddd
¡ ˆ   dddddd¡ ˆ   ddddd¡ ˆ   ddddd¡ ˆ   ddddd	¡ ˆ   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¡ dddg}d}t|ƒ}tƒ }xZt|| ƒD ]J}g }x.t|ƒD ]"}t	||ƒ\}}| 
|| ¡ qJW | d |¡¡ q8W ‡ fdd„|D ƒ}x°|D ]¨}t|ƒ}	x˜|D ]}| |¡}
|rît	|	t| |ˆ  d¡¡ƒ t|ƒƒ\}}nt|ƒd d }}|s|
|kr°ˆ  |dd||f ¡ ˆ  |
|d|
||f ¡ q°W qžW d S )Né   ÚaaaÚcountr   r   r   é   é   é
   éÿÿÿÿiöÿÿÿr?   é   Úxxr   é*   r   c                s   g | ]}ˆ   |¡‘qS r   )r   )r    Úts)r   r   r	   r"   ‘   s    z'BaseTest.test_count.<locals>.<listcomp>z%s != 0 for %sz%s != %s for %s)r>   ÚsysÚmaxsizerC   r8   Úcontains_bytesr   ÚsetÚrangeÚdivmodÚappendÚaddÚjoinrG   Úreplacer   r7   )r   ÚcharsetÚdigitsÚbaseÚteststringsr   ÚentryÚjÚmÚnÚr1Úr2Zremr   )r   r	   Ú
test_count_   sh    



zBaseTest.test_countc          	      sˆ  ˆ   dddd¡ ˆ   ddddd¡ ˆ   ddddd	¡ ˆ   dddd
d¡ ˆ   dddd
d¡ ˆ   dddd
d	¡ ˆ   ddd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 d¡ d
dddg}d}t|ƒ}tƒ }xZt|| ƒD ]J}g }x.t|ƒD ]"}t	||ƒ\}}| 
|| ¡ qÊW | d
 |¡¡ q¸W ‡ fdd„|D ƒ}xj|D ]b}xZ|D ]R}| |¡}	|	dk}
||k}ˆ  |
|¡ |	dkr(ˆ  ||	|	t|ƒ … |¡ q(W qW d S )Nr   ÚabcdefghiabcÚfindÚabcé	   rI   rK   ÚdefrL   r?   rE   rH   Úrrarrrrrrrrrar   é   é   r   rN   rM   ÚabÚxxxr   r   é   c                s   g | ]}ˆ   |¡‘qS r   )r   )r    rO   )r   r   r	   r"   Î   s    z&BaseTest.test_find.<locals>.<listcomp>)r>   rC   r8   rR   rP   rQ   r   rS   rT   rU   rV   rW   rX   rf   r7   )r   rZ   r[   r\   r]   r   r^   r_   r`   Úlocrb   rc   r   )r   r	   Ú	test_findŸ   sR    



zBaseTest.test_findc          	      s0  ˆ   dddd¡ ˆ   dddd¡ ˆ   dddd¡ ˆ   d	ddd
¡ ˆ   ddddd¡ ˆ   ddddd¡ ˆ   d	dddd¡ ˆ   ddd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g}d}t|ƒ}tƒ }xZt|| ƒD ]J}g }x.t|ƒD ]"}t||ƒ\}}| || ¡ qHW | 	d 
|¡¡ q6W ‡ fdd„|D ƒ}xj|D ]b}xZ|D ]R}| |¡}	|	d	k}
||k}ˆ  |
|¡ |	d	kr¦ˆ  ||	|	t|ƒ … |¡ q¦W qœW ˆ   d	dddtjd d¡ ˆ   dddd¡ d S )Nrh   re   Úrfindrg   rk   r?   r   ÚabcdrK   ZabczrE   rL   rj   r   rl   rH   r   rN   r   r   ro   c                s   g | ]}ˆ   |¡‘qS r   )r   )r    rO   )r   r   r	   r"   ý   s    z'BaseTest.test_rfind.<locals>.<listcomp>rm   rn   rI   u   <......Ð¼...ú<)r>   rC   r8   rR   r   rS   rT   rU   rV   rW   rX   rr   r7   rP   rQ   )r   rZ   r[   r\   r]   r   r^   r_   r`   rp   rb   rc   r   )r   r	   Ú
test_rfindØ   sJ    



(zBaseTest.test_rfindc             C   s"  |   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¡ n|  tddd¡ d S )Nr   re   Úindexr?   rE   ri   rg   rh   rI   ÚhibZabcdefghiabÚ	abcdefghiÚghir   rK   rH   rj   r   rk   rL   rl   r   rN   )r>   rC   Ú
ValueErrorr8   rR   )r   r   r   r	   Ú
test_index  s"    zBaseTest.test_indexc             C   s<  |   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¡ n|  tddd¡ d S )Nrk   re   Úrindexr?   rE   ri   rh   rg   r   rK   rw   Z	defghiabcrI   rx   ry   r   rj   r   rL   rl   rH   r   rN   )r>   rC   rz   r8   rR   )r   r   r   r	   Útest_rindex&  s$    zBaseTest.test_rindexc             C   s0   |   ddd¡ |   ddd¡ |  tddd¡ d S )Nr   ÚHeLLoÚlowerrN   )r>   rC   r8   )r   r   r   r	   Ú
test_lower@  s    zBaseTest.test_lowerc             C   s0   |   ddd¡ |   ddd¡ |  tddd¡ d S )NZHELLOr~   Úupperr   rN   )r>   rC   r8   )r   r   r   r	   Ú
test_upperE  s    zBaseTest.test_upperc             C   sà   |   ddd¡ |   dddd¡ |   dddd¡ |   ddd¡ |   dddd¡ |   d	ddd¡ |   d
d
dd¡ | j ddddd | j ddddd |   dddd¡ |  tdddd¡ tjdk rÜt d¡dkrÜ|  tddtj¡ d S )Nzabcab      def
g       hizabcab	def
g	hiÚ
expandtabsr   zabcab  def
g   hirL   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
	brI   r   rN   l        ÚPz	a
	b)r>   rC   r8   rP   rQ   ÚstructÚcalcsizeÚOverflowError)r   r   r   r	   Útest_expandtabsJ  s.    

zBaseTest.test_expandtabsc             C   sb  |   ddddgddd¡ |   dgdddd¡ |   dd	gdddd
¡ |   dddgdddd¡ |   ddddgdddd¡ |   ddddgdddd¡ |   ddddgdddtjd ¡ |   dgdddd¡ |   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dgddd¡ |   dddgdddd¡ |   dgd dd d… dd¡ |   dgd d g dd d… ddd¡ |   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ddgd!dd"d¡ |   ddddgd!dd"d¡ |   ddddgd!dd"tjd% ¡ |   d!gd!dd"d¡ |   ddd&gd'dd"d¡ |   ddgd(dd)¡ |   dd*gd+dd)¡ |   dd,dgd-dd)¡ |   dd.gd/dd0¡ |   ddgd1dd1¡ |   d1gd1dd1d¡ |   d2d2gd3dd4¡ |   d5gd5dd6¡ |   dgddd1¡ |   d7gd7dd1¡ |   d8d9gd:dd;¡ |   d8d<dgd=dd;¡ |   dgd d>d d?… dd@¡ |   dgd d>d d?… dd@dA¡ |   dgdB dCg d>d d?… dd@dB¡ | j ddddgddddD | j dd	gdddd
dE | j dd	gdddd
dF | j dd	gddd
ddG | j ddHgdIdd
dE |  tdJddKdKdK¡ |  tdJdd¡ |  tdJddd¡ d S )LNr   r   r   Údza|b|c|dÚsplitú|r   zb|c|drI   zc|drH   rE   rL   r?   zb||c||dz
a||b||c||drs   zendcase z	endcase |z
 startcasez| startcaseÚbothcasez
|bothcase|zb c dza  b c dú é   z(a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|rK   é   z	a|a|a|a|az
a//b//c//dz//zb//c//dzc//drJ   zb////c////dza////b////c////dzendcase testÚtestz
 begincaseztest begincasez
 bothcase ztest bothcase testÚbcÚabbbcÚbbrF   rm   ÚabbaabÚbaÚaaaaÚaabÚaaÚAZbobbZ
AbbobbbobbÚbbobbÚBZAbbobbBbbobbÚdaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHaBLAHéüÿÿÿÚBLAHé   é   ÚaBLAHa)Úsep)Úmaxsplit)r£   r¤   )r¤   r£   zb c dza b c dr   rN   )r>   rP   rQ   rC   r8   rz   )r   r   r   r	   Ú
test_splitg  sr     




zBaseTest.test_splitc             C   sN  |   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ddgdddd¡ |   ddddgdddd¡ |   ddddgdddtjd ¡ |   dgdddd¡ |   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dgddd¡ |   dddgdddd¡ |   dgd dd d… dd¡ |   d gdgd!  dd d… ddd!¡ |   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ddgd"dd#d¡ |   ddddgd"dd#d¡ |   ddddgd"dd#tjd& ¡ |   d"gd"dd#d¡ |   d'ddgd(dd#d¡ |   ddgd)dd*¡ |   ddgd+dd*¡ |   dd,dgd-dd*¡ |   d.dgd/dd0¡ |   ddgd1dd1¡ |   d1gd1dd1d¡ |   d.d.gd2dd3¡ |   d4gd4dd5¡ |   dgddd1¡ |   d6gd6dd1¡ |   d7d8gd9dd:¡ |   dd;d8gd<dd:¡ |   dgd d=d d>… dd?¡ |   dgd d=d d>… dd?d@¡ |   dAgdgdB  d=d d>… dd?dB¡ | j ddddgddddC | j ddgdddd	dD | j ddgdddd	dE | j ddgddd	ddF | j dGdgdHdd	dD |  tdIddJdJdJ¡ |  tdIdd¡ |  tdIddd¡ d S )KNr   r   r   rŠ   za|b|c|dÚrsplitrŒ   za|b|crI   za|brH   rE   rL   éd   r   za||b||cr?   z
a||b||c||drs   z
 begincasez| begincasezendcase z	endcase |r   z
|bothcase|za  bza  b c drŽ   r   z(a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|a|rK   z	a|a|a|a|ar   z
a//b//c//dz//za//b//cza//bro   za////b////cza////b////c////dztest begincaser‘   zendcase testz
 bothcase ztest bothcase testrm   r“   r”   rF   r•   r–   r—   r˜   r™   Zbbobrš   Z
bbobbbobbAr›   rœ   ZbbobbBbbobbAr   rž   rŸ   r    r¢   r¡   )r£   )r¤   )r£   r¤   )r¤   r£   za b cza b c dr   rN   )r>   rP   rQ   rC   r8   rz   )r   r   r   r	   Útest_rsplit­  sp     




zBaseTest.test_rsplitc             C   sä  | 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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d€d¡ |  tdddd€¡ d S )‚Nr?   rY   rš   r§   z*A*Ú*z*1A*1z*1z*-#A*-#z*-#z*-A*-A*-ÚAAz*-rK   rL   rE   z*-A*-ArH   z*-AArI   r   ZAAAZ
AAAAAAAAAAZBCDZABACADAro   ZBCDAZBCADAZBACADAZABCADZABCADAAz*************z^A^aê  ^AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA^iç  ÚtheZaterZtheaterZthetheZthethethether—   ZtheatheatheatheaÚthatZthaetzhere and rezhere and therezhere and re and rezhere and there and therezhere and re and thererg   ZabcdefgZbobZbbobobZbobXbobZbbobobXbbobobZaaaaaaaZ
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 tissueZcobobZbobobZcobZcobobXcobocobZbobobXbobobobZbotZReyKKjaviKKZ	Reykjavikr2   ZKKZ
ReyKKjavikzA----B----C----zA.B.C.z----u   ...Ð¼......&lt;u   ...Ð¼......<rt   z&lt;zham, ham, eggs and hamzspam, spam, eggs and spamZspamZhamzham, ham, eggs and spamzham, spam, eggs and spamZbobobobZbobobXbobobZbobobobXbobobobZBOBOBOBZbobbyzone@two!three!zone!two!three!ú@Zonetwothreezone@two@three!zone@two@three@r!   z-a-b-c-ú-z-a-b-crm   z--Zxyr.   Z123123Z123x123r   rN   Úh)r>   rP   rQ   rC   r8   )r   ZEQr   r   r	   Útest_replaceó  s"   
zBaseTest.test_replacel        r…   rL   z only applies to 32-bit platformsc             C   sF   dd }|   t|dd|¡ |   t|dd|¡ |   t|dd|| ¡ d S )Nrš   i   rY   r?   rª   )rC   rˆ   )r   ZA2_16r   r   r	   Útest_replace_overflow£  s    zBaseTest.test_replace_overflowc             C   sZ   |   ddd¡ |   ddd¡ |   ddd¡ |   ddd¡ |   ddd¡ |  tddd	¡ d S )
Nz hello Ú
capitalizezHello zhello ZAaaar—   ZAaAar   rN   )r>   rC   r8   )r   r   r   r	   Útest_capitalize¬  s    zBaseTest.test_capitalizec             C   sJ  |   dddddgdd¡ |   ddd	d
gdd¡ |   ddgddd d¡ |   dddgddd d¡ |   ddd	d
gddd d¡ |   ddd	d
gddd d¡ |   ddd	d
gddd tjd ¡ |   dgddd d¡ |   dgddd d¡ |   dddg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¡ |   dddgddd d¡ |   ddd	gddd d¡ |   ddgdd¡ d }|   dgd! |d¡ |   dg|dd … g |dd d¡ |   dgd" d#g |dd d"¡ xJd$D ]B}|   d%d&g|d¡ |   d%d&g|dd ¡ |   d%d&g|dd d¡ q W d S )'NÚthisrµ   r«   r‹   Úfunctionzthis is the split functionr   r   r   rŠ   za b c d zb c dza b c drI   zc drH   rE   rL   r   z	  a b c dzc  dz
a  b  c  dz	         z  a    z  a    b   zb   za    b   c   z  a    b   c   zb   c   zc   z
	a 	 b  z< 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>   rP   rQ   )r   rF   r   r   r   r	   Útest_additional_splitµ  s:    "
zBaseTest.test_additional_splitc             C   sN  |   dddddgdd¡ |   ddd	d
gdd¡ |   dd
gddd d¡ |   dd	d
gddd d¡ |   ddd	d
gddd d¡ |   ddd	d
gddd d¡ |   ddd	d
gddd tjd ¡ |   dgddd d¡ |   dgddd d¡ |   dd	d
g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¡ |   ddd	gddd d¡ |   ddd	gddd d¡ |   ddgddd d ¡ d!}|   dgd |d¡ |   |d d"… gdg |dd d¡ |   d#gdgd$  |dd d$¡ xJd%D ]B}|   d&d'g|d¡ |   d&d'g|dd ¡ |   d&d'g|dd d¡ qW d S )(Nr½   rµ   r«   r¦   r¾   zthis is the rsplit functionr   r   r   rŠ   za b c d za b cza b c drI   za brH   rE   rL   r   r   z	a b c d  za  bz
a  b  c  dz	         z  a    z  a    b   z  az  a    b   cz  a    b   c   z  a    bz
	a 	 b  éX   z< a  a  a  a  a  a  a  a  a  a  a  a  a  a  a  a  a  a  a  a rž   z a  ar¡   )zarf	barfzarf
barfzarfbarfzarfbarfzarfbarfr¿   rÀ   )r>   rP   rQ   )r   rF   r   r   r   r	   Útest_additional_rsplitÙ  sB    "
zBaseTest.test_additional_rsplitc             C   sª   |   ddd¡ |   ddd¡ |   ddd¡ |   ddd¡ 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 	
rg   z	abc 	
z	 	
abc)r>   )r   r   r   r   r	   Útest_strip_whitespace  s    zBaseTest.test_strip_whitespacec             C   sš   |   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   ZxyzzyhelloxyzzyrÄ   ZxyzZ
helloxyzzyrÅ   Z
xyzzyhellorÆ   r?   ZmississippiZ
mississippr   rN   )r>   rC   r8   )r   r   r   r	   Ú
test_strip  s    zBaseTest.test_stripc             C   sd   |   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       rg   ÚljustrJ   zabc   rl   rE   rH   z
abc*******r©   )r>   rC   r8   )r   r   r   r	   Ú
test_ljust!  s    zBaseTest.test_ljustc             C   sd   |   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
       abcrg   ÚrjustrJ   z   abcrl   rE   rH   z
*******abcr©   )r>   rC   r8   )r   r   r   r	   Ú
test_rjust)  s    zBaseTest.test_rjustc             C   sd   |   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    rg   ÚcenterrJ   z abc  rl   rE   rH   z
***abc****r©   )r>   rC   r8   )r   r   r   r	   Útest_center1  s    zBaseTest.test_centerc             C   s"   |   ddd¡ |  tddd¡ d S )NzhEllO CoMPuTErSzHeLLo cOmpUteRsÚswapcaser   rN   )r>   rC   r8   )r   r   r   r	   Útest_swapcase9  s    zBaseTest.test_swapcasec             C   sÒ   |   dddd¡ |   dddd¡ |   dddd¡ |   dddd¡ |   dddd¡ |   dddd	¡ |   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 )Nr.   ÚzfillrH   rE   Z0123rL   z+123z+0123ro   z-123z-0123Z000r?   Z34rI   Z0034)r>   rC   r8   )r   r   r   r	   Ú
test_zfill>  s    zBaseTest.test_zfillc             C   sv   |   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š   Ú
rg   ZaBczabc
rN   )r>   rC   r8   )r   r   r   r	   Útest_islowerN  s    zBaseTest.test_islowerc             C   sv   |   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Ô   ÚABCZAbCzABC
rg   rN   )r>   rC   r8   )r   r   r   r	   Útest_isupperX  s    zBaseTest.test_isupperc             C   s®   |   ddd¡ |   ddd¡ |   ddd¡ |   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 StringZNOTrg   rN   )r>   rC   r8   )r   r   r   r	   Útest_istitleb  s    zBaseTest.test_istitlec             C   s„   |   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 	
arg   rN   )r>   rC   r8   )r   r   r   r	   Útest_isspacep  s    zBaseTest.test_isspacec             C   sv   |   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Ô   rg   ZaBc123zabc
rN   )r>   rC   r8   )r   r   r   r	   Útest_isalpha{  s    zBaseTest.test_isalphac             C   s„   |   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Ô   Z	123abc456Za1b3czaBc000 zabc
rg   rN   )r>   rC   r8   )r   r   r   r	   Útest_isalnum…  s    zBaseTest.test_isalnumc             C   sÊ   |   ddd¡ |   ddd¡ |   ddd¡ |   ddd¡ |   ddd¡ |   dd	d¡ xptd
ƒD ]d}|   dd| d d¡ |   dd| d d¡ |   dd| d d d¡ |   dd| d d d¡ q^W d S )NTr?   ÚisasciirŽ   úz Fõ   Â€õ   Ã©r   rÜ   z        )r>   rT   )r   Úpr   r   r	   Útest_isascii  s    zBaseTest.test_isasciic             C   sZ   |   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Ú
0123456789Z0123456789arg   rN   )r>   rC   r8   )r   r   r   r	   Útest_isdigitŸ  s    zBaseTest.test_isdigitc             C   sh   |   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 z hello ÚtitlezHello zhello zFormat This As Title StringzfOrMaT thIs aS titLe StringzFormat,This-As*Title;StringzfOrMaT,thIs-aS*titLe;StringZGetintZgetIntr   rN   )r>   rC   r8   )r   r   r   r	   Ú
test_title¨  s    zBaseTest.test_titlec             C   s  |   ddddgdd¡ |   ddddgdd¡ |   dddgdd¡ |   dddgd	d¡ |   ddddgd
d¡ |   dddddgdd¡ |   dddddgddd¡ |   dddddgddd¡ | j dddddgdddd | j dddddgdddd |  tdddd¡ d S )Nrg   ri   r?   ry   zabc
def
ghiÚ
splitlineszabc
def

ghizabc
def
ghizabc
def
ghi
zabc
def
ghi
z
abc
def
ghi
FrÔ   zabc
zdef
zghi
rÞ   T)ÚkeependsrN   )r>   rC   r8   )r   r   r   r	   Útest_splitlines±  s    


zBaseTest.test_splitlines)0r   r   r   r(   rR   r   r1   r>   rC   rD   rd   rq   ru   r{   r}   r€   r‚   r‰   r¥   r¨   r¹   ÚunittestZskipIfrP   rQ   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      sR   @95FF 1	$(


		r   c               @   s   e Zd Zdd„ Zdd„ ZdS )Ú
CommonTestc             C   sJ   |   d¡}|   d¡}x|D ]}||7 }t|ƒ qW |  t|ƒt|ƒ¡ d S )NZDNSSECr?   )r(   Úhashr7   )r   r   r   r   r   r   r	   Ú	test_hashÈ  s    


zCommonTest.test_hashc             C   sX   |   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   r   r   r	   Útest_capitalize_nonasciiÑ  s    z#CommonTest.test_capitalize_nonasciiN)r   r   r   rö   r÷   r   r   r   r	   rô   Ä  s   	rô   c               @   s’   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	d
„ Zdd„ Zdd„ Z	dd„ Z
dd„ Zejdd„ ƒZdd„ Zdd„ Zdd„ Zdd„ Zdd„ Zdd „ Zd!S )"ÚMixinStrUnicodeUserStringTestc             C   s°  |   dddd¡ |   dddd¡ |   dddd¡ |   dddd¡ |   dddd¡ |   ddddd	¡ |   dddd
d¡ |   dddd
d¡ |   ddddd¡ |   ddddd¡ |   ddddd¡ |   dddddd¡ |   dddddd¡ |   dddddd	¡ |   dddddd¡ |   ddddd	d¡ |   dddddd¡ |   dddddd¡ |   dddddd¡ |   dddddd¡ |   ddddd¡ |   dd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   Ú
startswithÚheFzhello worldr?   ÚellorI   r­   rL   ro   Úlorl   Ú
helloworldÚloworE   r   r   rK   iËÿÿÿiöÿÿÿéûÿÿÿrž   éþÿÿÿéýÿÿÿi÷ÿÿÿrN   )rú   Úha)rü   Úllo)Úhelloxr   r   )ÚhellowoÚrldrþ   )r  rû   r  )rü   rú   )rú   ÚhelrH   )rN   )r>   rC   r8   )r   r   r   r	   Útest_startswithè  sP    z-MixinStrUnicodeUserStringTest.test_startswithc             C   s  |   dddd¡ |   dddd¡ |   dddd¡ |   dddd¡ |   dd	dd
¡ |   dd	dd
dd¡ |   dd	dddd¡ |   dd	dddd¡ |   dd	dddd¡ |   dd	dddd¡ |   dd	dddd¡ |   dd	dddd¡ |   dddddd¡ |   dddddd¡ |   dddddd¡ |   dddddd¡ |   dddddd¡ |   ddddd¡ |   ddddd¡ |   dddddd¡ |   dddddd¡ |   dd	dd
d¡ |   dd	dd
dd¡ |   dd	dd
dd¡ |   dd	dddd¡ |   dd	dddd¡ |   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   Úendswithrü   Frú   r?   zhello worldrý   ZworlrE   rh   Zworldrk   rþ   rI   r   rH   rL   r   rm   r   r   r  iöÿÿÿiúÿÿÿrÿ   rK   iùÿÿÿiÿÿÿiøÿÿÿrž   rN   )rú   r  )rü   r  )r  r   r   )r  r  rþ   )r  rû   r  )ÚhellZell)rú   r  )rú   r
  )rN   )r>   rC   r8   )r   r   r   r	   Útest_endswith  sX    z+MixinStrUnicodeUserStringTest.test_endswithc             C   s”   |   dddd¡ |   dddd¡ |   dddd¡ |   d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__rg   FrŽ   z abczabc r   ZasdfZasd)r>   )r   r   r   r	   Útest___contains__L  s    z/MixinStrUnicodeUserStringTest.test___contains__c             C   sœ   |   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 S )Nr   rg   r   r   r   rK   rE   iè  rI   r?   ri   )r>   ÚslicerC   r8   )r   r   r   r	   Útest_subscriptW  s    z,MixinStrUnicodeUserStringTest.test_subscriptc             C   sÚ   |   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 )Nrg   r   r   iè  rE   rm   rH   r’   rI   r   r?   iÐ  ri   )r>   r  rC   r8   )r   r   r   r	   Ú
test_sliceb  s    z(MixinStrUnicodeUserStringTest.test_slicec             C   sŠ   t jt j }dd dddtjdddf	}x`|D ]X}xR|D ]J}xD|dd … D ]4}t|ƒ|||… }|  d |¡|d	t|||ƒ¡ qFW q4W q*W d S )
Nr   rI   rE   é)   rK   r   iÛÿÿÿr?   r   )	ÚstringZascii_lettersr[   rP   rQ   r)   r>   rX   r  )r   ÚsÚindicesÚstartÚstopÚstepÚLr   r   r	   Útest_extended_getsliceo  s    

z4MixinStrUnicodeUserStringTest.test_extended_getslicec             C   sb   |   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?   rg   Ú__mul__rK   r   rI   Z	abcabcabcrE   )r>   rC   r8   )r   r   r   r	   Útest_mul{  s    z&MixinStrUnicodeUserStringTest.test_mulc          
   C   sØ  |   dddddddg¡ |   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dddg¡ |  tdjdddg¡ xhdD ]`}|   d| d | d d… ddd| g| ¡ |   d| d | d d… ddd| f| ¡ q²W |   dddtƒ ¡ |  tdd¡ |  tddd ¡ |  tddd¡ |  tddddtƒ g¡ ydd„ }|  	d¡ |ƒ ¡ W n< tk
rÈ } zdt
|ƒkr¸|  d ¡ W d d }~X Y nX |  d!¡ d S )"Nza b c drÜ   rX   r   r   r   rŠ   rs   r?   )r   r   r   rŠ   Zbd)r?   r   r?   rŠ   Zac)r   r?   r   r?   zw x y zrg   )rg   Úzza.b.cr´   rE   )ro   é   é}   r·   rK   za b cr   rI   rH   c               s   s   dd V  d S )NrL   r?   r   r   r   r   r	   Úf¡  s    z2MixinStrUnicodeUserStringTest.test_join.<locals>.fú+zjoin() ate exception messagezexception not raised)r>   r   r   r@   r8   rX   r   rC   Úbytesr   r&   Zfail)r   r   r  Úer   r   r	   Ú	test_join†  s4    
z'MixinStrUnicodeUserStringTest.test_joinc             C   sj  |   dddd¡ |   dddd¡ |   dd	dd¡ |   dd	dd¡ |   d
d	dd¡ |   dd	dd¡ |   dddd¡ |   dd	dd¡ x dD ]}|  ttfd	d|¡ q†W tjd }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/d0 dd1¡ |  td2d0 dd1¡ |  td*dtjd3 d4f¡ |  td5dtjd3 d6f¡ G d7d8„ d8t
ƒ}|  t	dd|ƒ ¡ d S )9Nz+hello+z+%s+Ú__mod__r   z+10+z+%d+rJ   r   z%cú"é"   ú$é$   Z10z%drå   é   )iœÿÿÿi    z 42z%3ldrN   Z42g      E@z0042.00z%07.2fz%07.2Frg   z%(foo)sz%s%s)rN   )Nz%(fooz%(foo)s %(bar)s)ÚfoorN   y      E@        Úbarz	%((foo))sz(foo)Zhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaxz%sxZgaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz%*s)r*  r+  z%10.*f)r*  g      E@z%10z%%%dfl            gš™™™™™	@z%%.%dfrI   r?   z%.*fg’$I’$IÂ?c               @   s   e Zd ZdS )z8MixinStrUnicodeUserStringTest.test_formatting.<locals>.XN)r   r   r   r   r   r   r	   ÚXÜ  s    r,  )r>   rC   rz   rˆ   rP   rQ   r&   rD   Úfloatr8   Úobject)r   ZordinalZ	longvalueZ
slongvaluer,  r   r   r	   Útest_formattingª  sN    



z-MixinStrUnicodeUserStringTest.test_formattingc             C   sŒ   ddl m}m}m} d| ¡ d > d }|  tdd|d df¡ |  tdd|d df¡ |  tdd|d df¡ |  tdd|d df¡ d S )	Nr   )ÚPY_SSIZE_T_MAXÚINT_MAXÚUINT_MAXrI   z%*sr$  r?   z%.*fg’$I’$IÂ?)Z	_testcapir0  r1  r2  Ú
bit_lengthrC   rˆ   )r   r0  r1  r2  ZSIZE_MAXr   r   r	   Útest_formatting_c_limitsß  s    



z6MixinStrUnicodeUserStringTest.test_formatting_c_limitsc             C   sR   xLt dƒD ]@}d| }d}x.t dƒD ]"}|d d d }|  |d|¡ q$W q
W d S )	Nr§   z%%.%ifg{®Gáz„?é<   gê.DTû!	@g      @g      $@r$  )rT   rD   )r   Zprecr   r$   r!   r   r   r	   Útest_floatformattingí  s    z2MixinStrUnicodeUserStringTest.test_floatformattingc             C   s°   |   ddd¡ |   ddd¡ |   ddd¡ |   ddd¡ |   ddd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Ó   rY   r»   rÏ   rî   )r>   )r   r   r   r	   Útest_inplace_rewritesö  s    z3MixinStrUnicodeUserStringTest.test_inplace_rewritesc             C   sx   |   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Ú	partitionr8  zhttp://www.python.org)Úhttpz://zwww.python.orgz://)zhttp://www.python.orgr?   r?   r²   )r?   zhttp://zwww.python.orgzhttp://)zhttp://www.python.Úorgr?   r;  r?   )r>   rC   rz   r8   )r   ÚSr   r   r	   Útest_partition	  s    
z,MixinStrUnicodeUserStringTest.test_partitionc             C   sx   |   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 rpartir8  z	on methodzthis is the rpartition methodÚ
rpartitionr8  zhttp://www.python.org)r:  z://zwww.python.orgz://)r?   r?   zhttp://www.python.orgr²   )r?   zhttp://zwww.python.orgzhttp://)zhttp://www.python.r;  r?   r;  r?   )r>   rC   rz   r8   )r   r<  r   r   r	   Útest_rpartition  s    
z-MixinStrUnicodeUserStringTest.test_rpartitionc             C   s*  d}|   d|ddd ¡ |   d|dddd ¡ |   d|ddd d¡ |   d|ddd d ¡ |   d|d	dd ¡ |   d|d	ddd ¡ |   d|d	dd d¡ |   d|d	dd d ¡ |   d|d
dd ¡ |   d|d
ddd ¡ |   d|d
dd d¡ |   d|d
dd d ¡ |   d|ddd ¡ |   d|dddd ¡ |   d|ddd d¡ |   d|ddd d ¡ |   d|ddd ¡ |   d|dddd ¡ |   d|ddd d¡ |   d|ddd d ¡ |   d|ddd ¡ |   d|dddd ¡ |   d|ddd d¡ |   d|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   rH   rf   ÚlrE   r   r   r¸   rr   rv   r|   rG   rI   r!   Tr	  r­   rü   Frù   )r>   )r   r  r   r   r	   Útest_none_arguments'  s:    z1MixinStrUnicodeUserStringTest.test_none_argumentsc          	   C   sÄ   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   r!   z^find\(z^rfind\(z^index\(z	^rindex\(z^count\(z^startswith\(z^endswith\(rJ   u   ...Ð¼......<rf   rt   )
ZassertRaisesRegexr8   rf   rr   rv   r|   rG   rù   r	  r>   )r   r  r!   r   r   r	   Ú*test_find_etc_raise_correct_error_messagesM  s"    zHMixinStrUnicodeUserStringTest.test_find_etc_raise_correct_error_messagesN)r   r   r   r  r  r  r  r  r  r  r#  r/  r   Zcpython_onlyr4  r6  r7  r=  r?  rA  rB  r   r   r   r	   rø   ä  s    04$5	&rø   c               @   s   e Zd Zdd„ ZdS )ÚMixinStrUnicodeTestc             C   sn   | j }G dd„ d|ƒ}|dƒ}|ƒ  |g¡}|  ||¡ |  t|ƒ|¡ |dƒ}|ƒ  |g¡}|  ||¡ d S )Nc               @   s   e Zd ZdS )z5MixinStrUnicodeTest.test_bug1001011.<locals>.subclassN)r   r   r   r   r   r   r	   Úsubclassm  s   rD  rs   )r(   rX   r9   r/   r0   )r   ÚtrD  Ús1Ús2r   r   r	   Útest_bug1001011g  s    z#MixinStrUnicodeTest.test_bug1001011N)r   r   r   rH  r   r   r   r	   rC  d  s   rC  )ró   r  rP   r†   r‘   r   Úcollectionsr   r   r   r   r   rô   rø   rC  r   r   r   r	   Ú<module>   s&           5    