B
    u9aW                @   s   d dl Z d dlZd dlZd dlZd dlZd dlZd dlZd dlZd dlm	Z	m
Z
 dd Zee dd ZG dd deZG d	d
 d
e
je
je
jejZG dd dejZG dd dejZedkre  dS )    N)supportstring_testsc             C   sX   ddd}ddd}ddd}ddd	}| d
kr<||d d fS | dkrP||d d fS d S d S )Nstrictc             S   s   dS )N*    )inputerrorsr   r   "/usr/lib/python3.7/test_unicode.pydecode1   s    z search_function.<locals>.decode1c             S   s   dS )Nr   r   )r   r   r   r   r	   encode1   s    z search_function.<locals>.encode1c             S   s   dS )N)r   r   r   )r   r   r   r   r	   encode2   s    z search_function.<locals>.encode2c             S   s   dS )N)r   r   r   )r   r   r   r   r	   decode2   s    z search_function.<locals>.decode2ztest.unicode1ztest.unicode2)r   )r   )r   )r   r   )encodingr
   r   r   r   r   r   r	   search_function   s    



r   c             C   s   |    S )N)encodedecode)textr   r   r	   duplicate_string$   s    r   c               @   s   e Zd ZdS )StrSubclassN)__name__
__module____qualname__r   r   r   r	   r   .   s   r   c                   s|  e Zd Ze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d"d#d$ Zd%d& Zejd'd( Zd)d* Zd+d, Z fd-d.Z  fd/d0Z! fd1d2Z" fd3d4Z# fd5d6Z$ fd7d8Z% fd9d:Z&d;d< Z' fd=d>Z(d?d@ Z)dAdB Z*dCdD Z+dEdF Z,dGdH Z-dIdJ Z.dKdL Z/dMdN Z0 fdOdPZ1dQdR Z2dSdT Z3e4ejdUkdVejdWdX Z5dYdZ Z6d[d\ Z7d]d^ Z8d_d` Z9dadb Z:dcdd Z;dedf Z<dgdh Z=didj Z>dkdl Z?dmdn Z@dodp ZAejdqdr ZBdsdt ZCdudv ZDeEdwdxdydzd{ ZFd|d} ZGd~d ZHdd ZIdd ZJdd ZKdd ZLdd ZMdd ZNdd ZOdd ZPdd ZQdd ZRdd ZSdd ZTdd ZUdd ZVdd ZWdd ZXdd ZYdd ZZdd Z[dd Z\dd Z]dd Z^eejd!kp e_`ddkddd Zaejdd Zbdd Zcdd Zddd Zedd Zfdd Zgdd Zhdd Zi  ZjS )UnicodeTestc             G   s   t ||}|| }| || | t|t|k ||krG dd dt}||}t ||}|| }| || | ||k	 d S )Nc               @   s   e Zd Zdd ZdS )z)UnicodeTest.checkequalnofix.<locals>.usubc             S   s   dt |  S )Nzusub(%r))str__repr__)selfr   r   r	   r   B   s    z2UnicodeTest.checkequalnofix.<locals>.usub.__repr__N)r   r   r   r   r   r   r   r	   usubA   s   r   )getattrassertEqual
assertTruetyper   )r   resultobjectZ
methodnameargsmethodZ
realresultr   r   r   r	   checkequalnofix8   s    

zUnicodeTest.checkequalnofixc             C   sV   |  dd |  dd | ttd | ttd | ttdd  | dd d S )	N   ÿu   ￿z'\Ufffffffe'z'\Uffffffff'z'\U%08x'i   z\u0020 )r   assertRaisesSyntaxErrorevalassertNotEqual)r   r   r   r	   test_literalsJ   s    zUnicodeTest.test_literalsc             C   s<  t jds8| tdd | tdd | tdd | tdd	 | td
d | tdd | tdd | tdd | tdd | tdd | tdd | tdd | tdd d}tdtttd}| || | tdtd G dd d}| 	t
t|  d S ) Njavaabcz'abc'zab\cz'ab\\c'zab\z'ab\\'z\cz'\\c'\z'\\'
z'\n'z'\r'	z'\t'z'\x08'z'"z'\'"''z"'""z'"'a  '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0\xa1\xa2\xa3\xa4\xa5\xa6\xa7\xa8\xa9\xaa\xab\xac\xad\xae\xaf\xb0\xb1\xb2\xb3\xb4\xb5\xb6\xb7\xb8\xb9\xba\xbb\xbc\xbd\xbe\xbf\xc0\xc1\xc2\xc3\xc4\xc5\xc6\xc7\xc8\xc9\xca\xcb\xcc\xcd\xce\xcf\xd0\xd1\xd2\xd3\xd4\xd5\xd6\xd7\xd8\xd9\xda\xdb\xdc\xdd\xde\xdf\xe0\xe1\xe2\xe3\xe4\xe5\xe6\xe7\xe8\xe9\xea\xeb\xec\xed\xee\xef\xf0\xf1\xf2\xf3\xf4\xf5\xf6\xf7\xf8\xf9\xfa\xfb\xfc\xfd\xfe\xff'    u0  𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿c               @   s   e Zd Zdd ZdS )z)UnicodeTest.test_ascii.<locals>.WrongReprc             S   s   dS )Ns	   byte-reprr   )r   r   r   r	   r   y   s    z2UnicodeTest.test_ascii.<locals>.WrongRepr.__repr__N)r   r   r   r   r   r   r   r	   	WrongReprx   s   r8   )sysplatform
startswithr   asciijoinmapchrranger(   	TypeError)r   
latin1reprtestreprr8   r   r   r	   
test_asciiS   s*    

zUnicodeTest.test_asciic             C   s<  t jds8| tdd | tdd | tdd | tdd	 | td
d | tdd | tdd | tdd | tdd | tdd | tdd | tdd | tdd d}tdtttd}| || | tdtd G dd d}| 	t
t|  d S ) Nr-   r.   z'abc'zab\cz'ab\\c'zab\z'ab\\'z\cz'\\c'r/   z'\\'r0   z'\n'r1   z'\r'r2   z'\t'r3   z'\x08'z'"z'\'"'r4   z"'"r5   z'"'u%  '\x00\x01\x02\x03\x04\x05\x06\x07\x08\t\n\x0b\x0c\r\x0e\x0f\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1a\x1b\x1c\x1d\x1e\x1f !"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\x7f\x80\x81\x82\x83\x84\x85\x86\x87\x88\x89\x8a\x8b\x8c\x8d\x8e\x8f\x90\x91\x92\x93\x94\x95\x96\x97\x98\x99\x9a\x9b\x9c\x9d\x9e\x9f\xa0¡¢£¤¥¦§¨©ª«¬\xad®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'r6   r7   u0  𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿c               @   s   e Zd Zdd ZdS )z(UnicodeTest.test_repr.<locals>.WrongReprc             S   s   dS )Ns	   byte-reprr   )r   r   r   r	   r      s    z1UnicodeTest.test_repr.<locals>.WrongRepr.__repr__N)r   r   r   r   r   r   r   r	   r8      s   r8   )r9   r:   r;   r   reprr=   r>   r?   r@   r(   rA   )r   rB   rC   r8   r   r   r	   	test_repr}   s*    

zUnicodeTest.test_reprc             C   sJ   d  }| t|d | t|d | t|d | tt| d S )Nu	   ᄑ∢㌳u   ᄑu   ∢u   ㌳)__iter__r   nextr(   StopIteration)r   itr   r   r	   test_iterators   s
    zUnicodeTest.test_iteratorsc             C   sl  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 S )N   Zaaacountar   b   i   
   u   Ăaaaaaaaaaau   􀌄aaaaaaaaaau   􀌄ĂĂĂĂĂĂĂĂĂĂu   ĂZ
aaaaaaaaaau   􀌄u   ĂĂĂĂĂĂĂĂĂĂu   Ăa_a_a_a_a_a_a_a_a_a_a_u   􀌄a_a_a_a_a_a_a_a_a_a_u"   􀌄Ă_Ă_Ă_Ă_Ă_Ă_Ă_Ă_Ă_Ă_u   Ă_u   aĂu   a􀌄u   Ă􀌄)r   
CommonTest
test_countr%   
checkequal)r   r   r   r	   rV      s,    zUnicodeTest.test_countc             C   s  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 | tdj | td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 S )$Nd   uf   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaĂfindu   ĂrQ   u   ȁu   Ġu   Ƞuh   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa􀌄u   􀌄u   􀈄u   􂀄r   abcdefghiabcr.   	   rP   def   hellor   u   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂarN   u  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄au  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄Ădaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaau   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂu   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂa_rT   u  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄a_u  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄Ă_u   Ă_u   aĂu   a􀌄u   Ă􀌄)r   rU   	test_findrW   r%   r(   rA   rY   )r   r   r   r	   r`      s2    zUnicodeTest.test_findc             C   sp  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 S ) Nr   uf   Ăaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaarfindu   ĂrQ   u   ȁu   Ġu   Ƞuh   􀌄aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaau   􀌄u   􀈄u   􂀄r[   rZ   r.      r6   u   aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂrN   u  a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄u  Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄r_   u   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂu   _aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂ_au  _a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄u  _Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄u   _Ău   Ăau   􀌄au   􀌄Ă)r   rU   
test_rfindrW   r%   )r   r   r   r	   rd      s.    zUnicodeTest.test_rfindc             C   sX  t j|  | dddd | dddd | dddd | ddddd	 | tdjd
 | tdjdd	 | tdjdd | tdjdd | dddd | dddd | dddd | tdjd | tdjd | tdjd | dddd | dddd | dddd | tdjd | tdjd | tdjd  d S )!Nr   rZ   indexr6   rL   r\   r.   r[   rP   hibZabcdefghiab	abcdefghighi   rQ   rX   u   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂarN   u  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄au  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄Ău   Ăr_   u   􀌄u   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂu   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂa_rT   u  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄a_u  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄Ă_u   Ă_u   aĂu   a􀌄u   Ă􀌄)r   rU   
test_indexr%   r(   
ValueErrorre   rW   )r   r   r   r	   rj     s*    zUnicodeTest.test_indexc             C   sr  t j|  | dddd | dddd | dddd | d	dddd	d
 | tdjd | tdj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	ddd | d	ddd | tdjd | tdjd | tdjd | d	ddd | d	ddd | d	ddd | tdjd | tdjd | tdjd  d S )!Nrb   rZ   rindexr6   rL   r\   r[   r.   r   rQ   rf   Z	defghiabcrP   rg   rh   ri   u   aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂrN   u  a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄u  Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄u   Ăr_   u   􀌄u   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂu   _aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂrc   u  _a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄u  _Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄u   _Ău   Ăau   􀌄au   􀌄Ă)r   rU   test_rindexr%   r(   rk   rl   rW   )r   r   r   r	   rm     s,    zUnicodeTest.test_rindexc             C   s4  |  dddtdd i |  dddtdd tdtdi |  dddtdd tdtdtd	d
i |  d	ddtdd tddi |  dddtddi |  dddddi | jd dd}|  ddd| | jddd}|  ddd| | dtddd | dtddid | dtdd id | dtddid | dtddid | d td d!dd" | d td ddd# | dtdd$id% | dtddid | dtdd id | dtdd!id& | d'tdd(id) d*}x4d+D ],}t||i}d,| }| t|j| qRW | t	| jj | t| jjdd- | t	| jjd.d/ | t	| jjdd. | t	| jjdd/d. | t| jjd0d.i | t	| jjd1d.i | t	d2j | t	djdd d S )3NZbbbcZabababc	translaterN   ZiiicrO   iZiiixcxr6   ZxyyxZxzxzZyyz<i>)rN   rO   z
<i><i><i>cr.   ZxyzdZxyzzyZabdcdcbddddz[a]Xz[X]z[]ZXXXz[XXX]   éu   [é]Zaxb123Zx123u   xéu   <é>u   [<é>]z[123]u   [aé]u   <€>u	   [<€>é]i   u
   aé€􏿿z[%s]ZdefgrR   r\   Zxy)rP   r^   )
r%   ord	type2test	maketransr   rn   r   r(   rk   rA   )r   ZtblZinvalid_charZbeforemappingr   r   r   r	   test_maketrans_translate6  sl    


"




z$UnicodeTest.test_maketrans_translatec          	   C   s   t j|  xdD ]\}}|d9 }|d9 }xdD ]|}| || g|| d| | ||g|| | d| | || g|| d|d  | ||g||d  | d|d  q0W qW d S )N)bau   āĀu   𐌁𐌀r[   )rp   u   Ău   𐌂splitrR   )r   rU   
test_splitrW   )r   leftrightdelimr   r   r	   r~   |  s    


zUnicodeTest.test_splitc          	   C   s   t j|  xdD ]\}}|d9 }|d9 }xdD ]|}| || g|| d| | ||g|| | d| | || g|| d|d  | ||g||d  | d|d  q0W qW d S )N)r|   u   āĀu   𐌁𐌀r[   )rp   u   Ău   𐌂rsplitrR   )r   rU   test_rsplitrW   )r   r   r   r   r   r   r	   r     s    


zUnicodeTest.test_rsplitc          	   C   s   t j|  | dddd xdD ]\}}|d9 }|d9 }xdD ]}| || ddf|| d| | |||f|| | d| | || ddf|| d|d	  | ||d	 |f||d	  | d|d	  q@W q"W d S )
N)ABCDEFGHr6   r6   r   	partitionu   䈀)r|   u   āĀu   𐌁𐌀r[   )rp   u   Ău   𐌂r6   rR   )r   MixinStrUnicodeUserStringTesttest_partitionrW   )r   r   r   r   r   r   r	   r     s    
zUnicodeTest.test_partitionc          	   C   s   t j|  | dddd xdD ]\}}|d9 }|d9 }xdD ]}| dd|| f|| d| | |||f|| | d| | dd|| f|| d|d	  | ||d	 |f||d	  | d|d	  q@W q"W d S )
N)r6   r6   r   r   
rpartitionu   䈀)r|   u   āĀu   𐌁𐌀r[   )rp   u   Ău   𐌂r6   rR   )r   r   test_rpartitionrW   )r   r   r   r   r   r   r	   r     s    
zUnicodeTest.test_rpartitionc          	   C   s  t j|  G dd d}| ddddddd	g | d
ddd | dddt d | ddddddd	g | ddddddd	g | d
ddd | dddt d | tdddd|dg | tdddddt g | tdddddg | tdddddg d S )Nc               @   s   e Zd Zdd Zdd ZdS )z(UnicodeTest.test_join.<locals>.MyWrapperc             S   s
   || _ d S )N)sval)r   r   r   r   r	   __init__      z1UnicodeTest.test_join.<locals>.MyWrapper.__init__c             S   s   | j S )N)r   )r   r   r   r	   __str__  r   z0UnicodeTest.test_join.<locals>.MyWrapper.__str__N)r   r   r   r   r   r   r   r   r	   	MyWrapper  s   r   za b c dr'   r=   rN   rO   rp   rs   abcdr6   )rN   rO   rp   rs   zw x y zZwxyz12foo3rP   rR   rL   )r   r   	test_joinr%   SequencecheckraisesrA   bytes)r   r   r   r   r	   r     s    zUnicodeTest.test_joinl        z*needs too much memory on a 64-bit platformc             C   s4   t tjd d }d| f| }| tdj| d S )Ng      ?rP   Ar6   )intr9   maxsizer(   OverflowErrorr=   )r   sizeseqr   r   r	   test_join_overflow  s    zUnicodeTest.test_join_overflowc          
   C   s   t j|  | dddddd | tdjdd xd	D ]\}}|d
9 }|d
9 }xdD ]}xdD ]}| || || d|| | || | || | d|| | || || d|d | | || | ||d  | d|d | q`W qVW q8W d S )Nzone@two!three!zone!two!three!replace!@rP   rr   )r|   u   āĀu   𐌁𐌀r[   )rp   u   Ău   𐌂)rs   u   ău   𐌃rR   )r   rU   test_replacer%   r(   rA   r   rW   )r   r   r   r   replr   r   r	   r     s$    





zUnicodeTest.test_replacec             C   s    d}d}|  |||| d S )Nr.   zabc def)assertIsr   )r   patternr   r   r   r	   test_replace_id  s    zUnicodeTest.test_replace_idc          	   C   sl   t  Z tdt | ddkd | ddkd | dtdkd | dtdkd W d Q R X d S )Nignorer.   s   abcFT)r   check_warningswarningssimplefilterBytesWarningr   	bytearray)r   r   r   r	   test_bytes_comparison  s    
z!UnicodeTest.test_bytes_comparisonc                s:     dd  ddk  ddk   ddk  d S )Nr.   r   u   u   )r   r   )r   r   )r   Z
test_fixupZ
test_lecmpr	   test_comparison  s    5zUnicodeTest.test_comparisonc                s   t    | ddd | d  | d  | d  | d  | d  | d	  | d
  | d  d S )NFu   ῼisloweru   Ⅷu   ⅷu   𐐁u   𐐧u   𐐩u   𐑎u   🐍u   👯)supertest_islowerr%   assertFalser   r   )r   )	__class__r   r	   r   :  s    
zUnicodeTest.test_islowerc                s   t    tjds$| ddd | d  | d  | d  | d  | d	  | d
  | d  | d  d S )Nr-   Fu   ῼisupperu   Ⅷu   ⅷu   𐐁u   𐐧u   𐐩u   𐑎u   🐍u   👯)	r   test_isupperr9   r:   r;   r%   r   r   r   )r   )r   r   r	   r   I  s    
zUnicodeTest.test_isupperc                sj   t    | ddd | ddd | d  | d  x"dD ]}| | d| qHW d S )	NTu   ῼistitleu   Greek ῼitlecases ...u   𐐁𐐩u   𐐧𐑎)u   𐐩u   𐑎u   🐍u   👯z{!a} is not title)r   test_istitler%   r   r   r   format)r   ch)r   r   r	   r   Y  s    

zUnicodeTest.test_istitlec                s\   t    | ddd | ddd | ddd x"dD ]}| | d| q:W d S )	NTu    isspaceu    Fu   —)u   𐐁u   𐐧u   𐐩u   𐑎u   🐍u   👯z{!a} is not space.)r   test_isspacer%   r   r   r   )r   r   )r   r   r	   r   e  s    

zUnicodeTest.test_isspacec                s2   t    x"dD ]}| | d| qW d S )N)u   𐐁u   𐐧u   𐐩u   𐑎u   𝟶u   𑁦u   𐒠u   🄇z{!a} is alnum.)r   test_isalnumr   isalnumr   )r   r   )r   r   r	   r   o  s    

zUnicodeTest.test_isalnumc                sp   t    | ddd | d  | d  | d  | d  | d  | d	  d S )
NTu   ῼisalphau   𐐁u   𐐧u   𐐩u   𐑎u   🐍u   👯)r   test_isalphar%   r   r   r   )r   )r   r   r	   r   u  s    
zUnicodeTest.test_isalphac                s*   t    | d  | d  d S )Nu   €u   􏿿)r   test_isasciir   isascii)r   )r   r   r	   r     s    
zUnicodeTest.test_isasciic             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 x"dD ]}| | d| qW x"dD ]}| | d| qW d S )NFr6   	isdecimalrN   T0u   ①   ¼u   ٠
01234567890123456789ar.   r   )u   𐐁u   𐐧u   𐐩u   𐑎u   🐍u   👯u   𑁥u   🄇z{!a} is not decimal.)u   𝟶u   𑁦u   𐒠z{!a} is decimal.)r%   r   rA   r   r   r   r   )r   r   r   r   r	   test_isdecimal  s    

zUnicodeTest.test_isdecimalc                s   t    | ddd | ddd | ddd x"dD ]}| | d| q:W x"d	D ]}| | d
| q^W d S )NTu   ①isdigitFr   u   ٠)u   𐐁u   𐐧u   𐐩u   𐑎u   🐍u   👯u   𑁥z{!a} is not a digit.)u   𝟶u   𑁦u   𐒠u   🄇z{!a} is a digit.)r   test_isdigitr%   r   r   r   r   )r   r   )r   r   r	   r     s    


zUnicodeTest.test_isdigitc             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jd x"dD ]}| | d| qW x"dD ]}| | d| qW d S )NFr6   	isnumericrN   Tr   u   ①r   u   ٠r   r   r.   r   )u   𐐁u   𐐧u   𐐩u   𐑎u   🐍u   👯z{!a} is not numeric.)u   𑁥u   𝟶u   𑁦u   𐒠u   🄇z{!a} is numeric.)r%   r(   rA   r   r   r   r   )r   r   r   r   r	   test_isnumeric  s    

zUnicodeTest.test_isnumericc             C   s   |  d  |  d  |  d  |  d  |  d  |  d  |  d  |  d  | d	  | d
  | d  | d  d S )NrN   Z_Zb0ZbcZb_   µu   𝔘𝔫𝔦𝔠𝔬𝔡𝔢r'   [   ©r   )r   isidentifierr   )r   r   r   r	   test_isidentifier  s    zUnicodeTest.test_isidentifierc             C   s   |  d  |  d  |  d  | d  |  d  | d  | d  |  d  | d	  d S )
Nr6   r'   abcdefgzabcdefg
u   ʹu   ͸u   u   👯u   󠀠)r   isprintabler   )r   r   r   r	   test_isprintable  s    zUnicodeTest.test_isprintablec             C   s   x6dD ].}|  |  | |  | |  qW x6dD ].}| |  |  |  |  |  q>W x<dD ]4}tt|}x$dD ]}| ||d||f  qW qvW x<dD ]4}tt|}x$dD ]}| ||d||f  qW qW d S )N)u   abu   abu	   abau	   aba)u   ABu   ABu	   ABAu	   ABA)r   r   r   )u   u   u   u   z%a.%s() is False)r   r   r   r   r   r   r   r   )u   u   u   u   u   abu   abu	   abau	   aba)r   r   r   r   r   r   r   )r   sZ	meth_namemethr   r   r	   test_surrogates  s     




 


zUnicodeTest.test_surrogatesc             C   s   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 S )Nu   𐐧u   𐑏u   𐐧𐐧u   𐑏𐑏u   𐐧𐑏u
   X𐐧x𐑏u
   x𐑏x𐑏u   ﬁu   İu   i̇u   Σu   σu   ͅΣu   ͅσu   AͅΣu   aͅςu   AͅΣau   aͅσau   AΣͅu   aςͅu   Σͅ u   σͅ u   򏿾u   ⅷ)r   rU   
test_lowerr   lower)r   r   r   r	   r     s&    


zUnicodeTest.test_lowerc             C   st   |  d d |  d d |  d d |  d d |  d d |  d	 d
 |  d d d S )Nr^   ZhELlo   ßssu   ﬁfiu   Σu   σu   AͅΣu   aισr   u   μ)r   casefold)r   r   r   r	   test_casefold  s    zUnicodeTest.test_casefoldc             C   s   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 S )Nu   𐑏u   𐐧u   𐑏𐑏u   𐐧𐐧u   𐐧𐑏u
   X𐐧x𐑏u
   X𐐧X𐐧u   ﬁFIu   İu   Σr   SSu   ῒu   Ϊ̀u   򏿾u   ⅷu   Ⅷ)r   rU   
test_upperr   upper)r   r   r   r	   r     s    


zUnicodeTest.test_upperc             C   s   t j|  | d d | d d | d d | d d | d d | d d	 d
}| d | | d d | d d d S )Nu   𐑏u   𐐧u   𐑏𐑏u   𐐧𐑏u   𐑏𐐧u
   X𐐧x𐑏u
   X𐑏x𐑏u   hİu   Hi̇u	   Ϊ̀i̇u   ῒİu   ﬁnnishZFInnishu   AͅΣu   Aͅς)r   rU   test_capitalizer   
capitalize)r   Zexpr   r   r	   r      s    



zUnicodeTest.test_capitalizec                s   t    | d d | d d | d d | d d | d d | d d	 | d
 d | d d | d d d S )Nu   𐑏u   𐐧u   𐑏𐑏u   𐐧𐑏u   𐑏𐑏 𐑏𐑏u   𐐧𐑏 𐐧𐑏u   𐑏𐐧 𐑏𐐧u   X𐐧x𐑏 X𐐧x𐑏u   X𐑏x𐑏 X𐑏x𐑏u   ﬁNNISHZFinnishu	   AΣ ᾡxyu	   Aς ᾩxyu   AΣAu   Aσa)r   
test_titler   title)r   )r   r   r	   r   1  s    





zUnicodeTest.test_titlec             C   s0  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 S )Nu   𐑏u   𐐧u   𐑏𐑏u   𐐧𐐧u   𐐧𐑏u   𐑏𐐧u
   X𐐧x𐑏u
   x𐑏X𐐧u   ﬁr   u   İu   i̇u   Σu   σu   ͅΣu   Ισu   AͅΣu   aΙςu   AͅΣau   aΙσAu   AΣͅu   aςΙu   Σͅ u   σΙ r   r   u   ῒu   Ϊ̀)r   rU   test_swapcaser   swapcase)r   r   r   r	   r   B  s.    



zUnicodeTest.test_swapcasec             C   sL   t j|  | dddd | dddd | dddd d S )	Nrq   rR   u   􏿿u   x􏿿rL   u	   􏿿x􏿿r]   u   􏿿x􏿿􏿿)r   rU   test_centerr   center)r   r   r   r	   r   \  s    zUnicodeTest.test_centerizrequires 32-bit systemc             C   sT   d}yd| }W n& t k
r6   | d|d   Y nX z| t|j W d ~X d S )NiVUU   üz$no enough memory (%.0f MiB required)i   )MemoryErrorZskipTestr(   r   r   )r   r   r   r   r   r	   test_case_operation_overflowe  s    z(UnicodeTest.test_case_operation_overflowc             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 | tdj xjdD ]b}|d9 }xRdD ]J}| || |  |||  | |d | |  |d ||d   q^W qLW d S )NrN   ZabdbZbdabZbdabaZbdbaZbdb)rN   rP   N)rP   NrN   )rq   rP   y)rq   rP   Nr   Zabcxxxxabr.   )rP   Nr   r6    z abczabc ZasdfZasd)rN   u   Āu   𐌀r[   )rp   u   Ău   𐌂rR   )assertInZassertNotInr(   rA   __contains__)r   fillr   r   r   r	   test_containss  sD    

zUnicodeTest.test_containsc             C   sX   d   d  d  d  d  d  ddd ddd ddd d S )Nu   𐀀􀀀u   􀀀rL   u   𐀀)	r   r   r   r   r   r   r   ljustrjust)r   r   r   r	   test_issue18183  s    zUnicodeTest.test_issue18183c             C   s  |  d d |  d d |  d d |  d d |  d d |  d d	 |  d
 d |  d d dd l}|  ddd |  dtddd |  ddd |dd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&|j}G d'd( d(t}	G d)d* d*}
G d+d, d,}|  d d |  d- d- |  d.d-d- |  d/d-d- |  d0d-d1 |  d2d-d3 |  d4d-d5 |  d6d7d-d- |  d8d7d-d1 |  d9d7d-d3 |  d:d7d-d5 |  d.d;d< |  d=d;d-d> |  d?d;d-d@ |  dA dB |  dC dD |  dE dF |  dG dH |  dIdJdK |  dL dM |  dN dO |  dP dQ |  dRdSdTidT |  dUdVdTidT |  dWdXdYidZ |  d[j|d\d]d^ |  d_|d`|d\da |  db||d-d- |  dcd-ddgd- |  ded-ddgdd |  dfd-ddggdd |  dgd-|ddggdd |  dhd-d- |  dhdd |  dhdid- |  djdid |  dkd-d- |  dld-d- |  dmd-d |  dnd-do |  dpdqdq |  drdqdq |  dsdqdq |  dtdqdu |  dvdqdw |  dxdqdy |  dzdqdy |  d{dqd| |  d}dqd~ |  ddqd |  ddqd |  ddqd |  ddddXd   |  dddXd  |  dddXd  |  ddd |  ddd |  ddd |  ddd |  ddYd |  ddYd |  ddYd |  ddYd |  ddd |  ddd |  ddd |  ddd |  ddd |  ddd |  ddd |  ddd |  d| d- |  ddd |  ddd |  ddd |  ddd |  ddd |  ddd |  d|dd |  ddd |  ddd |  d|dd |  ddd |  ddd |  ddd |  ddd |  d|dd |  d|dd |  d.i dF |  d.g d |  d.d7gd |  d|dd¡ |  d|ddá | tdj|d | tdj|d | tdj|d |  dƠ|ddddȍdɡ |  d.|	d`d^ |  d/dd |  dʠdd̡d͡ |  dΠdd̡d͡ |  djdddЍd͡ |  djdd`ddҍdӡ |  djddddҍdӡ | tdBj | tdDj | tdj | tdj | tdj | tdj | t	d.j | t	d6jd- | t
dHj | tdOj | tdj | tdj | t	dj | tdjd | tdj | tdjg  | t
dj | tdjd | tdjd | tdjd | tdjd | t
dj | tdjd | tdjd | jt
djdYd | tdjdY | tdjd | tdjd | tdj | t	dj | t	dj | t	dFj d}| tdB| dD j | td| d jdg | tdjd g | tdjd g | tdjdd | tdjd-dd | tdjdd7ddYdddd
 | tdjd | ttdd | tdjd | ttdd | ttdd |  dd dd |  dhdd  |  djdd |  ddFdidա |  ddFdid |  ddBdid |  ddDdid |  dddid |  dd	did | td
jd | tdjd | tdjd |  dddd |
d}|  d|d | tdj| | tdFj| |d}|  d|d |  d|d | tdFj| d S (  Nr6   rN   r   za{{za{za}}za}z{{bz{bz}}bz}bza{{bza{br   zMy name is {0}ZFredzMy name is FredzMy name is {0[name]})namezMy name is {0} :-{{}}zMy name is Fred :-{}i  ri      zThe year is {0.year}zThe year is 2007c               @   s   e Zd ZdddZdd ZdS )z"UnicodeTest.test_format.<locals>.CrX   c             S   s
   || _ d S )N)_x)r   rq   r   r   r	   r     s    z+UnicodeTest.test_format.<locals>.C.__init__c             S   s   |S )Nr   )r   specr   r   r	   
__format__  s    z-UnicodeTest.test_format.<locals>.C.__format__N)rX   )r   r   r   r   r   r   r   r   r	   C  s   
r   c               @   s   e Zd Zdd Zdd ZdS )z"UnicodeTest.test_format.<locals>.Dc             S   s
   || _ d S )N)rq   )r   rq   r   r   r	   r     s    z+UnicodeTest.test_format.<locals>.D.__init__c             S   s
   t | jS )N)r   rq   )r   r   r   r   r	   r     s    z-UnicodeTest.test_format.<locals>.D.__format__N)r   r   r   r   r   r   r   r   r	   D  s   r   c               @   s   e Zd Zdd Zdd ZdS )z"UnicodeTest.test_format.<locals>.Ec             S   s
   || _ d S )N)rq   )r   rq   r   r   r	   r     s    z+UnicodeTest.test_format.<locals>.E.__init__c             S   s   d| j  d S )NzE())rq   )r   r   r   r	   r     s    z*UnicodeTest.test_format.<locals>.E.__str__N)r   r   r   r   r   r   r   r   r	   E  s   r  c               @   s   e Zd Zdd Zdd ZdS )z"UnicodeTest.test_format.<locals>.Fc             S   s
   || _ d S )N)rq   )r   rq   r   r   r	   r     s    z+UnicodeTest.test_format.<locals>.F.__init__c             S   s   d| j  d S )NzF(r  )rq   )r   r   r   r	   r     s    z+UnicodeTest.test_format.<locals>.F.__repr__N)r   r   r   r   r   r   r   r   r	   F  s   r  c               @   s$   e Zd Zdd Zdd Zdd ZdS )z"UnicodeTest.test_format.<locals>.Gc             S   s
   || _ d S )N)rq   )r   rq   r   r   r	   r     s    z+UnicodeTest.test_format.<locals>.G.__init__c             S   s
   d| j  S )Nz
string is )rq   )r   r   r   r	   r     s    z*UnicodeTest.test_format.<locals>.G.__str__c             S   s"   |dkrd| j  d S t| |S )Nrs   zG(r  )rq   r"   r   )r   format_specr   r   r	   r     s    z-UnicodeTest.test_format.<locals>.G.__format__N)r   r   r   r   r   r   r   r   r   r	   G  s   r  c               @   s   e Zd Zdd ZdS )z"UnicodeTest.test_format.<locals>.Ic             S   s
   |  |S )N)Zstrftime)r   r  r   r   r	   r     s    z-UnicodeTest.test_format.<locals>.I.__format__N)r   r   r   r   r   r   r   r	   I  s   r  c               @   s   e Zd Zdd ZdS )z"UnicodeTest.test_format.<locals>.Jc             S   s   t | d |S )NrR   )r   r   )r   r  r   r   r	   r     s    z-UnicodeTest.test_format.<locals>.J.__format__N)r   r   r   r   r   r   r   r	   J  s   r  c               @   s    e Zd Zdd Zdd ZdZdS )z"UnicodeTest.test_format.<locals>.Mc             S   s
   || _ d S )N)rq   )r   rq   r   r   r	   r     s    z+UnicodeTest.test_format.<locals>.M.__init__c             S   s   d| j  d S )NzM(r  )rq   )r   r   r   r	   r     s    z+UnicodeTest.test_format.<locals>.M.__repr__N)r   r   r   r   r   r   r   r   r   r	   M  s   r  c               @   s    e Zd Zdd Zdd ZdZdS )z"UnicodeTest.test_format.<locals>.Nc             S   s
   || _ d S )N)rq   )r   rq   r   r   r	   r     s    z+UnicodeTest.test_format.<locals>.N.__init__c             S   s   d| j  d S )NzN(r  )rq   )r   r   r   r	   r     s    z+UnicodeTest.test_format.<locals>.N.__repr__N)r   r   r   r   r   r   r   r   r   r	   N  s   r	  r.   z{0}z{0:}zX{0}ZXabcz{0}XZabcXzX{0}YZXabcYz{1}rP   zX{1}z{1}XzX{1}Yiz-15z{0}{1}z-15abcz{0}X{1}z-15Xabcz{{{z}}}z{{}}z{}z{{x}}z{x}z{{{0}}}{   z{123}z	{{{{0}}}}z{{0}}z}}{{z}{z}}x{{z}x{z{0[foo-bar]}zfoo-barZbazz{0[foo bar]}zfoo barz{0[ ]}r'   rL   r   z{foo._x}   )r   20z{1}{0}rS   Z2010z{0._x.x}z{0[0]}r\   z{0[1]}z	{0[1][0]}z{0[1][0].x}z{0:.3s}abcdefz{0:.0s}z{0:3.3s}z{0:2.3s}z{0:2.2s}z{0:3.2s}zab z{0:x<0s}r!   z{0:x<5s}z{0:x<6s}z{0:x<7s}Zresultxz{0:x<8s}Zresultxxz{0: <7s}zresult z{0:<7s}z{0:>7s}z resultz{0:>8s}z  resultz{0:^8s}z result z{0:^9s}z	 result  z{0:^10s}z
  result  z	{0:10000}i'  i'  z{0:10000000}i z{0: <6s}r   zfoo   z{0:<6s}zfooz{0: ^6s}z foo  z{0:^6s}z foo  z{0: <6}z3     z{0:<6}z3z{0: ^6}z  3   z{0:<6}z3     gQ	@z3.14  z3.14z 3.14 z{0:^6}z 3.14 z{0: <12}y      @       @z(3+2j)      z{0:<12}z(3+2j)z{0: ^12}z   (3+2j)   z{0:^12}z   (3+2j)   z{0:abc}z{0!s}ZHelloz{0!s:}z{0!s:15}zHello          z	{0!s:15s}z{0!r}z'Hello'z{0!r:}zF(Hello)u   ͸z'\u0378'u   ʹu   'ʹ'u   F(ʹ)z{0!a}z'\u0374'z{0!a:}z	F(\u0374)z[]z[1]z{0:d}datazG(data)zstring is dataz{0:^10}z{0:>15s}z{0:date: %Y-%m-%d}   )ZyearZmonthZdayzdate: 2007-08-27z{0:.{1}}zhello world   r^   z	{0:.{1}s}z{0:.{precision}s})	precisionz{0:{width}.{precision}s})widthr  z
hello     105z{az}azabc{0:{}z{0z{0.}z{0[}z{0]}z{0.[]}z{0..foo}z{0[0}z	{0[0:foo}z{c]}z	{{ {{{0}}z{0}}z{foo})barz{0!x}z{0!}z{0!rs}z{!}z{:}z{:s}Z,23098475029384702983476098230754973209482573z{[z]}z{0[0]x}z
{0[0](10)}z{0[{1}]}r   r]   z{0:{1:{2}}}r   z{0:{1:{2:{3:{4:{5:{6}}}}}}}rR         z{0:-s}-z{0:=s}#z#20z
{0:s}{1:s}ABCu   АБВu	   ABCАБВz{[{}]}z{[{]}z{[}]}z{[[]}r   z{[!]}r   z{a{}b}r   z{a{b}z{[}z0x{:0{:d}X}   Z0x0000000000000000z{!r}zM(data)z{!s}zN(data))r   r   datetimedictZdater   r(   rA   rk   
IndexErrorKeyError)r   r  rs   r   r   r  r  r  r  r  r  r	  Zbigmnr   r   r	   test_format  s   

zUnicodeTest.test_formatc             C   s  |  di d |  di d |  di d |  di d |  di d |  di d	 |  d
i d |  di d G dd dt}|  d| d |  d|ddd G dd d}|  d| d G dd d}|  dd|did | tdj | tdj | tdji  | tdji  | tdji  | tdji  | td ji  | td!ji  | td"jdd#i | td"jd | td$jd#d%d& G d'd( d(}| tdji  | tdjg  | tdj|  d S ))Nr6   rN   r   za{{za{za}}za}z{{bz{bz}}bz}bza{{bza{bc               @   s   e Zd Zdd ZdS )z,UnicodeTest.test_format_map.<locals>.Mappingc             S   s   |S )Nr   )r   keyr   r   r	   __missing__  s    z8UnicodeTest.test_format_map.<locals>.Mapping.__missing__N)r   r   r   r&  r   r   r   r	   Mapping  s   r'  z{hello}r^   z{a} {world})rN   zhello worldc               @   s   e Zd Zdd Zdd ZdS )z4UnicodeTest.test_format_map.<locals>.InternalMappingc             S   s   ddi| _ d S )NrN   r^   )rz   )r   r   r   r	   r     s    z=UnicodeTest.test_format_map.<locals>.InternalMapping.__init__c             S   s
   | j | S )N)rz   )r   r%  r   r   r	   __getitem__  s    z@UnicodeTest.test_format_map.<locals>.InternalMapping.__getitem__N)r   r   r   r   r(  r   r   r   r	   InternalMapping  s   r)  z{a}c               @   s   e Zd ZdddZdd ZdS )z&UnicodeTest.test_format_map.<locals>.CrX   c             S   s
   || _ d S )N)r   )r   rq   r   r   r	   r     s    z/UnicodeTest.test_format_map.<locals>.C.__init__c             S   s   |S )Nr   )r   r   r   r   r	   r     s    z1UnicodeTest.test_format_map.<locals>.C.__format__N)rX   )r   r   r   r   r   r   r   r   r	   r     s   
r   z{foo._x}r   r  r  r
  r  z{az}az{}rR   z{a} {}rP   )rN   rO   c               @   s   e Zd Zdd ZdS )z/UnicodeTest.test_format_map.<locals>.BadMappingc             S   s   dd S )NrP   r   r   )r   r%  r   r   r	   r(    s    z;UnicodeTest.test_format_map.<locals>.BadMapping.__getitem__N)r   r   r   r(  r   r   r   r	   
BadMapping  s   r*  )r   
format_mapr  r(   rA   rk   r!  ZeroDivisionError)r   r'  r)  r   r*  r   r   r	   test_format_map  s<    zUnicodeTest.test_format_mapc          	   C   s4   d tjd }| t t d|}W d Q R X d S )Nz.{}frP   gQ@)r   r9   r   r(   rk   )r   format_stringr!   r   r   r	   test_format_huge_precision  s    z&UnicodeTest.test_format_huge_precisionc          	   C   s4   d tjd }| t t d|}W d Q R X d S )Nz{}frP   gQ@)r   r9   r   r(   rk   )r   r.  r!   r   r   r	   test_format_huge_width  s    z"UnicodeTest.test_format_huge_widthc          	   C   s4   d tjd }| t | d}W d Q R X d S )Nz
{{{}:.6f}}rP   gQ@)r   r9   r   r(   rk   )r   r.  r!   r   r   r	   test_format_huge_item_number  s    z(UnicodeTest.test_format_huge_item_numberc             C   sp  G dd d}|  ddd |  ddd |  d	dd
 |  d|dd |  dddgd |  ddddd |  dddd |  dddd |  dddd | tdjdd | td jdd | td!jdd | td"jdd |  d#jdd$d%d& |  d'jdd$d%d( |  d)jdd*d+dd,d- |  d.jdddd+d/d0 d S )1Nc               @   s   e Zd ZdddZdd ZdS )z1UnicodeTest.test_format_auto_numbering.<locals>.CrX   c             S   s
   || _ d S )N)r   )r   rq   r   r   r	   r     s    z:UnicodeTest.test_format_auto_numbering.<locals>.C.__init__c             S   s   |S )Nr   )r   r   r   r   r	   r      s    z<UnicodeTest.test_format_auto_numbering.<locals>.C.__format__N)rX   )r   r   r   r   r   r   r   r   r	   r     s   
r   z{}rS   r  z{:5}r   zs    z{!r}z's'z{._x}z{[1]}rP   rR   r   z{[a]}r]   )rN   rO   4za{}b{}cr   Za0b1cza{:{}}brq   z^10za    x     bza{:{}x}br  r  Za0x14bz{}{1}z{1}{}z{:{1}}z{0:{}}z{f}{}test)fZtest4z{}{f}Z4testz{:{f}}{g}{}rL   g)r5  r4  z 1g3z{f:{}}{}{g})r4  r5  z 14g)r   r   r(   rk   )r   r   r   r   r	   test_format_auto_numbering  s$    z&UnicodeTest.test_format_auto_numberingc             C   s  t j|  | dd d | dd d | dd d | dd	 d
 | dd d | dd d tjd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# | tdj	d$ | dd# d# | t
dj	d% | td&j	d' | t
d(j	d% | d)d*di d+ | d)d*di d+ | d)d*di d+ | d)d*di d+ | d)dd,d- d+ | d)dd,d- d+ | d.d/ d0 | d1d/ d2 | d3d d+ | d4d5 d6 | d4d7 d8 | d9d: d; | d9d< d6 | d=d> d? | d@dA dB | ddC dC G dDdE dE}| dF|  d! tdG}tdH}| dI| dG | dJ| dK | dI| dH | dJ| dL | dMdN dC | dOdN dP G dQdR dR}G dSdT dT}|dU}|dV}| dWdX dY | dZd[ d\ | d]d^ d_ | ddV d` | dW| da | dZ| db | d]| dc | d| d` | t
ddtjdWdef | t
dftjdZdgf | t
dhtjd]dif | t
djtjdW|f | t
tjd|f d S )kNz%s, %s)r.   r.   zabc, abcz%s, %s, %i, %f, %5.2f)r.   r.   rP   rR   rL   zabc, abc, 1, 2.000000,  3.00)r.   r.   rP   rL   zabc, abc, 1, -2.000000,  3.00)r.   r.   rQ   r7  g      @zabc, abc, -1, -2.000000,  3.50)r.   r.   rQ   r7  g(\@zabc, abc, -1, -2.000000,  3.57)r.   r.   rQ   r7  g(\\@z abc, abc, -1, -2.000000, 1003.57r-   z%r, %r)s   abcr.   zb'abc', 'abc'z%r)u   ሴu   'ሴ'z%az'\u1234'z%(x)s, %(y)sr.   r\   )rq   r   zabc, defu   %(x)s, %(ü)s)rq   r   z%ci4  u   ሴi u   𡒃)i   Zaau   %.1ဲfgUUUUUU?z%iz...%(foo)s...r   z	...abc...r  )r   r\   z...%s...%s...%s...%s...)rP   rR   rL   r.   z...1...2...3...abc...z"...%%...%%s...%s...%s...%s...%s...z...%...%s...1...2...3...abc...z...%s...z%*s)r  r.   z  abc)r.   zabc  z%*.*s)r  rR   r.   z   ab)r  rL   r.   z%i %*.*s)rS   r  rL   r.   z10   abcz
%i%s %*.*s)rS   rL   r  rL   r.   z	103   abcrN   c               @   s   e Zd Zdd ZdS )z,UnicodeTest.test_formatting.<locals>.Wrapperc             S   s   dS )Nu   ሴr   )r   r   r   r	   r   d  s    z4UnicodeTest.test_formatting.<locals>.Wrapper.__str__N)r   r   r   r   r   r   r   r	   Wrapperc  s   r9  z%snaninfz%fz%FNANINFz%.1su   aé€z%.2su   aéc               @   s$   e Zd Zdd Zdd Zdd ZdS )z.UnicodeTest.test_formatting.<locals>.PseudoIntc             S   s   t || _d S )N)r   value)r   r>  r   r   r	   r   v  s    z7UnicodeTest.test_formatting.<locals>.PseudoInt.__init__c             S   s   | j S )N)r>  )r   r   r   r	   __int__x  s    z6UnicodeTest.test_formatting.<locals>.PseudoInt.__int__c             S   s   | j S )N)r>  )r   r   r   r	   	__index__z  s    z8UnicodeTest.test_formatting.<locals>.PseudoInt.__index__N)r   r   r   r   r?  r@  r   r   r   r	   	PseudoIntu  s   rA  c               @   s   e Zd Zdd Zdd ZdS )z0UnicodeTest.test_formatting.<locals>.PseudoFloatc             S   s   t || _d S )N)floatr>  )r   r>  r   r   r	   r   }  s    z9UnicodeTest.test_formatting.<locals>.PseudoFloat.__init__c             S   s
   t | jS )N)r   r>  )r   r   r   r	   r?    s    z8UnicodeTest.test_formatting.<locals>.PseudoFloat.__int__N)r   r   r   r   r?  r   r   r   r	   PseudoFloat|  s   rC  go!	@m   z%xr   Z2az%X   r  z%or[   Z11r"  Z6dZ6DZ155z,%x format: an integer is required, not floatgQ	@z,%X format: an integer is required, not floatgzG @z,%o format: an integer is required, not floatgp=
ף?z2%x format: an integer is required, not PseudoFloat)r   r   test_formattingr   r9   r:   r;   r(   r   __mod__rA   rk   rB  assertRaisesRegexoperatormod)r   r9  r<  r=  rA  rC  ZpiZletter_mr   r   r	   rF  :  s~    zUnicodeTest.test_formattingc          
   C   s  dd l }G dd dt|j}G dd d|j}G dd dt|j}| d|j|jf d	 | d
|j|j|j|j|j|j|jf d | dd|ji d | dd|ji d | dd|ji d | dd|ji d | d|j|jd d | d|jdd d d S )Nr   c               @   s   e Zd ZdZdS )z4UnicodeTest.test_formatting_with_enum.<locals>.FloatgJM!	@N)r   r   r   PIr   r   r   r	   Float  s   rL  c               @   s   e Zd ZdZdS )z2UnicodeTest.test_formatting_with_enum.<locals>.IntrE  N)r   r   r   IDESr   r   r   r	   Int  s   rN  c               @   s   e Zd ZdZdS )z2UnicodeTest.test_formatting_with_enum.<locals>.Strr.   N)r   r   r   r  r   r   r   r	   Str  s   rO  z%s, %szStr.ABC, Str.ABCz%s, %s, %d, %i, %u, %f, %5.2fz-Str.ABC, Str.ABC, 15, 15, 15, 3.141593,  3.14z...%(foo)s...r   z...Str.ABC...z...Int.IDES...z...%(foo)i...z...15...z...%(foo)d...z...%(foo)u...)r   r\   z...%(foo)f...r  z...3.141593...)	enumrB  EnumIntEnumr   r   r  rM  rK  )r   rP  rL  rN  rO  r   r   r	   test_formatting_with_enum  s.    z%UnicodeTest.test_formatting_with_enumc          	   C   s2   d tjd }| t |d }W d Q R X d S )Nz%.{}frP   gQ@)r   r9   r   r(   rk   )r   r.  r!   r   r   r	   test_formatting_huge_precision  s    z*UnicodeTest.test_formatting_huge_precisionc             C   s(   G dd dt }| d|d d d S )Nc               @   s   e Zd Zdd ZdS )zBUnicodeTest.test_issue28598_strsubclass_rhs.<locals>.SubclassedStrc             S   s
   d |S )Nz'Success, self.__rmod__({!r}) was called)r   )r   otherr   r   r	   __rmod__  s    zKUnicodeTest.test_issue28598_strsubclass_rhs.<locals>.SubclassedStr.__rmod__N)r   r   r   rV  r   r   r   r	   SubclassedStr  s   rW  z	lhs %% %rZrhsz.Success, self.__rmod__('lhs %% %r') was called)r   r   )r   rW  r   r   r	   test_issue28598_strsubclass_rhs  s    z+UnicodeTest.test_issue28598_strsubclass_rhsc          	   C   s<   ddl m} d|d }| t |d }W d Q R X d S )Nr   )INT_MAXz%.{}frP   gQ@)	_testcapirY  r   r(   rk   )r   rY  r.  r!   r   r   r	   'test_formatting_huge_precision_c_limits  s    z3UnicodeTest.test_formatting_huge_precision_c_limitsc          	   C   s2   d tjd }| t |d }W d Q R X d S )Nz%{}frP   gQ@)r   r9   r   r(   rk   )r   r.  r!   r   r   r	   test_formatting_huge_width  s    z&UnicodeTest.test_formatting_huge_widthc          
   C   s\   xVdj djfD ]F}| t}|dg W d Q R X t|j}| d| | d| qW d S )Nr   r4  r   tuple)r;   endswithr(   rA   r   	exceptionr   )r   r   cmexcr   r   r	   test_startswith_endswith_errors  s    
z+UnicodeTest.test_startswith_endswith_errorsLC_ALLde_DEfr_FRc             C   s   |  ddd  d S )Nz1.0z%.1fg      ?)r   )r   r   r   r	   test_format_float  s    zUnicodeTest.test_format_floatc             C   sf  |  tdd xddD ]\}t|}|  t|| |  t|t| |dkr|  |dd |  |dd qW |  tdd G dd d}|  t|d	d	 |d
}|  t|d
 |  t|d
 x$dD ]}|  t|tt| qW tjds| t	tddd |  tdddd tjdsP|  tt
dddd | t	tddd d S )Nzunicode remains unicode)r<   ru   u   €u   􏿿r<   s   asciizutf-8z strings are converted to unicodec               @   s   e Zd Zdd Zdd ZdS )z2UnicodeTest.test_constructor.<locals>.StringCompatc             S   s
   || _ d S )N)rq   )r   rq   r   r   r	   r     s    z;UnicodeTest.test_constructor.<locals>.StringCompat.__init__c             S   s   | j S )N)rq   )r   r   r   r	   r     s    z:UnicodeTest.test_constructor.<locals>.StringCompat.__str__N)r   r   r   r   r   r   r   r   r	   StringCompat  s   rg  z)__str__ compatible objects are recognizedz#unicode(obj) is compatible to str())r  g^@r  r-   z!decoding unicode is not supportedr   s   strings are decoded to unicodezstrings are decoded to unicodes(   character buffers are decoded to unicodez(character buffers are decoded to unicoder   )r   r   r   lenr   r9   r:   r;   r(   rA   
memoryview)r   r   subclassrg  oobjr   r   r	   test_constructor  sP    



zUnicodeTest.test_constructorc             C   sR   |  tddd |  tdddd |  tdddd |  tdddd d S )	Nr   )r"   s   foozutf-8)r"   r   r   )r   )r"   r   )r   r   )r   r   r   r	   test_constructor_keyword_args  s    z)UnicodeTest.test_constructor_keyword_argsc             C   sT   |  t d |  tddd dd}|  t|ddd | jtt|dd d S )Nr6   r   )r      ¢zutf-8r<   )r   )r   r   r   r(   UnicodeDecodeError)r   Z	utf8_centr   r   r	   test_constructor_defaults'  s
    
z%UnicodeTest.test_constructor_defaultsc             C   s  dddddddddd	d
dddg}x"|D ]\}}|  |d| q&W |  ddd |  ddd |  ddd |  ddd |  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 ]6}|  |d|d |  |dd| qW x&|D ]}|  |dd| qZW d S ) N)u   A≢Α.s	   A+ImIDkQ.)u   Hi Mom -☺-!s   Hi Mom -+Jjo--!)u	   日本語s
   +ZeVnLIqe-)u   Item 3 is £1.s   Item 3 is +AKM-1.)+s   +-)z+-s   +--)z+?s   +-?)z\?s   +AFw?)z\\?s   +AFwAXA?)z\\\?s
   +AFwAXABc?)z++--s   +-+---)u   򫳞s   +2m/c3g-)/   /zutf-7u   s   +2AE-u   xs   +2AE-xu   s   +3AE-u   xs   +3AE-xu   򫳞s
   +2AHab9ze-s   +r   r6   zGABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'(),-./:?z!"#$%&*;<=>@[]^_`{|}utf7r<   )r   r   r   )r   ZutfTestsrq   r   Zset_dZset_orp   r   r   r	   test_codecs_utf72  sD    

zUnicodeTest.test_codecs_utf7c             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 |  td	dd |  tddd |  tddd d S )Nr6   zutf-8r   u   €s   €u   𐀂s   𐀂u   𣑖s   𣑖u   surrogatepasss   u   s   u(   𐀂𐀂𐀂𐀂𐀂𐀂𐀂𐀂𐀂𐀂s(   𐀂𐀂𐀂𐀂𐀂𐀂𐀂𐀂𐀂𐀂u   正確に言うと翻訳はされていません。一部はドイツ語ですが、あとはでたらめです。実際には「Wenn ist das Nunstuck git unds   正確に言うと翻訳はされていません。一部はドイツ語ですが、あとはでたらめです。実際には「Wenn ist das Nunstuck git und)r   r   r   )r   r   r   r	   test_codecs_utf8a  s    zUnicodeTest.test_codecs_utf8c             C   sB   ddddddddd	d
dg}x"|D ]\}}|  |d| q W d S )N)    r   )   arN   )   )s      )s   ߿u   ߿)s   ࠀu   ࠀ)s   ퟿u   ퟿)s   u   )s   ￿u   ￿)s   𐀀u   𐀀)s   􏿿u   􏿿zutf-8)r   r   )r   	sequencesr   resr   r   r	    test_utf8_decode_valid_sequences  s    z,UnicodeTest.test_utf8_decode_valid_sequencesc       
      C   sD  dd t ddD }dd t ddD }dd t dd	D }|| | d
d t ddD  }x|D ]}| t|jd qbW x.|D ]&}x |D ]}| t|| jd qW qW xT|D ]L}xF|d d D ]6}x0|d d D ] }	| t|| d |	 jd qW qW qW xNdd t ddD D ]6}| td| d jd | td| d jd qW xNdd t ddD D ]6}| td| d jd | td| d jd qfW xNdd t ddD D ]6}| td| d jd | td| d jd qW xNdd t ddD D ]6}| td| d jd | td| d jd qW d S )Nc             S   s   g | ]}t |gqS r   )r   ).0rq   r   r   r	   
<listcomp>  s    zBUnicodeTest.test_utf8_decode_invalid_sequences.<locals>.<listcomp>      c             S   s   g | ]}t |gqS r   )r   )r  rq   r   r   r	   r    s       c             S   s   g | ]}t |gqS r   )r   )r  rq   r   r   r	   r    s          c             S   s   g | ]}t |gqS r   )r   )r  rq   r   r   r	   r    s       r7   zutf-8rL      c             S   s   g | ]}t |gqS r   )r   )r  rq   r   r   r	   r    s             c             S   s   g | ]}t |gqS r   )r   )r  rq   r   r   r	   r    s       c             S   s   g | ]}t |gqS r   )r   )r  rq   r   r   r	   r    s          s   s   c             S   s   g | ]}t |gqS r   )r   )r  rq   r   r   r	   r    s       )r@   r(   rp  r   )
r   Zcontinuation_bytesZinvalid_2B_seq_start_bytesZinvalid_4B_seq_start_bytesZinvalid_start_bytesbyteZsbcbZcb1Zcb3r   r   r	   "test_utf8_decode_invalid_sequences  sD     



"z.UnicodeTest.test_utf8_decode_invalid_sequencesc          ?   C   s   d}d|fd|d fd|fd|d fd|fd|d fd	|d fd
|fd|d fd|d fd|d fd|fd|d fd|d fd|d fd|fd|d fd|d | fd|d fd|d fd|d d fd|d | fd|fd|d fd|d fd |d fd!|d" fd#|fd$|fd%|d fd&|d fd'|d fd(|d | fd)|d |d  fd*|d | d fd+|d | fd,|d | fd-|d |d  fd.|d d fd/|d |d  fd0|fd1|d fd2|d fd3|d fd4|d fd5|d d fd6|d d | fd7|d |d  d fd8|fd9|d fd:|d fd;|d d fd<|d" fd=|fd>|d fd?|d fd@|dA fdB|fdC|d fdDdEdFdGg?}xxt |D ]l\}\}}| t|jdHdI | |dHdJ| | |dK dHdJ|dL  | |dHdM|ddN qW d S )ONu   �r  s   rR      s      s   s      s   s   rL   s   Ar      s   s   s   r]   s   s   As   As   AAZAAs   As   As   A   s   s   s   s   r  s   s   s   As   AAs   As   As   As   AAs   AAs   As   As   As   A   s   s   s   s   s   As   As   AA   s   s   s   As      s   s   s   r     s   )s   ABCu   �ABC)s   BCu   ��BC)s   Cu   �C)s   abcdu   a���b�c��dzutf-8r   r      brO   r   r6   )	enumerater(   rp  r   r   r   )r   FFFDr~  r#  r   r  r   r   r	   test_issue8271  s    






























zUnicodeTest.test_issue8271c          	   C   s   |  t}|d W d Q R X |j}| |t| | |dd| | d| d ddd| d  |dd}| |dd	| | d| d dd	d| d  d S )
Nzutf-8r   s   aaaas   bbbbZaaaaZbbbbu   �r6   r   )r(   rp  r   r_  r   r   r   r   )r   r   r  errr`  ra  r   r   r	   assertCorrectUTF8Decoding  s    z%UnicodeTest.assertCorrectUTF8Decodingc             C   s*   d}x dD ]}|  t|gdd q
W d S )Nu   �s   zinvalid start byte)r  r   )r   r  r  r   r   r	   test_invalid_start_byte2  s    
z#UnicodeTest.test_invalid_start_bytec          &   C   sz   ddddddddd	d
dddddddddddddddddddddd d!d"d#d$d%d&g&}d'}x |D ]}|  t|d'd( qZW d S ))NZC2ZDFzE0 A0zE0 BFzE1 80zE1 BFzEC 80zEC BFzED 80zED 9FzEE 80zEE BFzEF 80zEF BFzF0 90zF0 BFzF0 90 80zF0 90 BFzF0 BF 80zF0 BF BFzF1 80zF1 BFzF1 80 80zF1 80 BFzF1 BF 80zF1 BF BFzF3 80zF3 BFzF3 80 80zF3 80 BFzF3 BF 80zF3 BF BFzF4 80zF4 8FzF4 80 80zF4 80 BFzF4 8F 80zF4 8F BFu   �zunexpected end of data)r  r   fromhex)r   r~  r  r   r   r   r	   test_unexpected_end_of_data?  s    
z'UnicodeTest.test_unexpected_end_of_datac          	   C   sz   d}|d }d|d fd|d fd|fd|fd	|d fd
|d fd|fd|fg}x$|D ]\}}|  t||d qVW d S )Nu   �rR   zC2 00r   zC2 7Fr|  zC2 C0zC2 FFzDF 00zDF 7FzDF C0zDF FFzinvalid continuation byte)r  r   r  )r   r  FFFDx2r~  r   r  r   r   r	   test_invalid_cb_for_2bytes_seqY  s    
z*UnicodeTest.test_invalid_cb_for_2bytes_seqc          M   C   s  d}|d }d|d fd|d fd|fd|fd	|fd
|fd|d fd|d fd|fd|fd|d fd|d fd|fd|fd|d fd|d fd|fd|fd|d fd|d fd|fd|fd|d fd|d fd|fd|fd|d fd |d fd!|fd"|fd#|d fd$|d fd%|fd&|fd'|d fd(|d fd)|fd*|fd+|d fd,|d fd-|fd.|fd/|fd0|fd1|d fd2|d fd3|fd4|fd5|d fd6|d fd7|fd8|fd9|d fd:|d fd;|fd<|fd=|d fd>|d fd?|fd@|fdA|d fdB|d fdC|fdD|fdE|d fdF|d fdG|fdH|fdI|d fdJ|d fdK|fdL|fdM|d fdN|d fdO|fdP|fgL}x&|D ]\}}|  t||dQ qnW d S )RNu   �rR   zE0 00r   zE0 7Fr|  zE0 80zE0 9FzE0 C0zE0 FFzE0 A0 00zE0 A0 7FzE0 A0 C0zE0 A0 FFzE0 BF 00zE0 BF 7FzE0 BF C0zE0 BF FFzE1 00zE1 7FzE1 C0zE1 FFzE1 80 00zE1 80 7FzE1 80 C0zE1 80 FFzE1 BF 00zE1 BF 7FzE1 BF C0zE1 BF FFzEC 00zEC 7FzEC C0zEC FFzEC 80 00zEC 80 7FzEC 80 C0zEC 80 FFzEC BF 00zEC BF 7FzEC BF C0zEC BF FFzED 00zED 7FzED A0zED BFzED C0zED FFzED 80 00zED 80 7FzED 80 C0zED 80 FFzED 9F 00zED 9F 7FzED 9F C0zED 9F FFzEE 00zEE 7FzEE C0zEE FFzEE 80 00zEE 80 7FzEE 80 C0zEE 80 FFzEE BF 00zEE BF 7FzEE BF C0zEE BF FFzEF 00zEF 7FzEF C0zEF FFzEF 80 00zEF 80 7FzEF 80 C0zEF 80 FFzEF BF 00zEF BF 7FzEF BF C0zEF BF FFzinvalid continuation byte)r  r   r  )r   r  r  r~  r   r  r   r   r	   test_invalid_cb_for_3bytes_seqo  sL    
z*UnicodeTest.test_invalid_cb_for_3bytes_seqc          u   C   s  d}|d }d|d fd|d fd|fd|fd	|fd
|fd|d fd|d fd|fd|fd|d fd|d fd|fd|fd|d fd|d fd|fd|fd|d fd|d fd|fd|fd|d fd|d fd|fd|fd|d fd |d fd!|fd"|fd#|d fd$|d fd%|fd&|fd'|d fd(|d fd)|fd*|fd+|d fd,|d fd-|fd.|fd/|d fd0|d fd1|fd2|fd3|d fd4|d fd5|fd6|fd7|d fd8|d fd9|fd:|fd;|d fd<|d fd=|fd>|fd?|d fd@|d fdA|fdB|fdC|d fdD|d fdE|fdF|fdG|d fdH|d fdI|fdJ|fdK|d fdL|d fdM|fdN|fdO|d fdP|d fdQ|fdR|fdS|d fdT|d fdU|fdV|fdW|d fdX|d fdY|fdZ|fd[|d fd\|d fd]|fd^|fd_|fd`|fda|d fdb|d fdc|fdd|fde|d fdf|d fdg|fdh|fdi|d fdj|d fdk|fdl|fdm|d fdn|d fdo|fdp|fdq|d fdr|d fds|fdt|fdu|d fdv|d fdw|fdx|fgt}x&|D ]\}}|  t||dy qW d S )zNu   �rR   zF0 00r   zF0 7Fr|  zF0 80zF0 8FzF0 C0zF0 FFzF0 90 00zF0 90 7FzF0 90 C0zF0 90 FFzF0 BF 00zF0 BF 7FzF0 BF C0zF0 BF FFzF0 90 80 00zF0 90 80 7FzF0 90 80 C0zF0 90 80 FFzF0 90 BF 00zF0 90 BF 7FzF0 90 BF C0zF0 90 BF FFzF0 BF 80 00zF0 BF 80 7FzF0 BF 80 C0zF0 BF 80 FFzF0 BF BF 00zF0 BF BF 7FzF0 BF BF C0zF0 BF BF FFzF1 00zF1 7FzF1 C0zF1 FFzF1 80 00zF1 80 7FzF1 80 C0zF1 80 FFzF1 BF 00zF1 BF 7FzF1 BF C0zF1 BF FFzF1 80 80 00zF1 80 80 7FzF1 80 80 C0zF1 80 80 FFzF1 80 BF 00zF1 80 BF 7FzF1 80 BF C0zF1 80 BF FFzF1 BF 80 00zF1 BF 80 7FzF1 BF 80 C0zF1 BF 80 FFzF1 BF BF 00zF1 BF BF 7FzF1 BF BF C0zF1 BF BF FFzF3 00zF3 7FzF3 C0zF3 FFzF3 80 00zF3 80 7FzF3 80 C0zF3 80 FFzF3 BF 00zF3 BF 7FzF3 BF C0zF3 BF FFzF3 80 80 00zF3 80 80 7FzF3 80 80 C0zF3 80 80 FFzF3 80 BF 00zF3 80 BF 7FzF3 80 BF C0zF3 80 BF FFzF3 BF 80 00zF3 BF 80 7FzF3 BF 80 C0zF3 BF 80 FFzF3 BF BF 00zF3 BF BF 7FzF3 BF BF C0zF3 BF BF FFzF4 00zF4 7FzF4 90zF4 BFzF4 C0zF4 FFzF4 80 00zF4 80 7FzF4 80 C0zF4 80 FFzF4 8F 00zF4 8F 7FzF4 8F C0zF4 8F FFzF4 80 80 00zF4 80 80 7FzF4 80 80 C0zF4 80 80 FFzF4 80 BF 00zF4 80 BF 7FzF4 80 BF C0zF4 80 BF FFzF4 8F 80 00zF4 8F 80 7FzF4 8F 80 C0zF4 8F 80 FFzF4 8F BF 00zF4 8F BF 7FzF4 8F BF C0zF4 8F BF FFzinvalid continuation byte)r  r   r  )r   r  r  r~  r   r  r   r   r	   test_invalid_cb_for_4bytes_seq  sx    z*UnicodeTest.test_invalid_cb_for_4bytes_seqc             C   s   |  ddd d S )Nzwww.python.org.Zidnas   www.python.org.)r   r   )r   r   r   r	   test_codecs_idna  s    zUnicodeTest.test_codecs_idnac             C   s  |  tdjd |  tdjdd | dddd | dddd | ddddjddd | ddddjddd	 |  ttd
d |  ttd
dd | td
ddd | td
ddd | tdddd | dddd |  tdjd |  tdjd |  ttdd |  tdjd |  tdjd |  tdjddd |  ttd |  ttd |  tt	d |  tt	d |  tt
d |  tt
d d S )Nu   Andr xr<   r   r   s   Andr xr   s   Andr? x)r   )r   r   s   Andr xzAndr xu	   Andr� xs    xu   � xs	   \N{foo}xxzunicode-escapeZxx   \s   helloztest.unicode1ztest.unicode2r^   r   u   u   )r(   UnicodeErrorr   r   r   r   rA   rk   r   rB  complex)r   r   r   r	   test_codecs_errors  s4    zUnicodeTest.test_codecs_errorsc             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 x^tdD ]R}t|}xDdD ]<}t * tdt |  t|||| W d Q R X qW qW x@tdD ]4}t|}x&dD ]}|  t|||| q
W qW xBtdD ]6}t|}x&dD ]}|  t|||| qLW q:W t > tdt d}x&dD ]}|  t|||| qW W d Q R X d	t
tttddttdd }x&dD ]}|  t|||| qW d S )Nr^   r<   s   hellozutf-7zutf-8z	utf-16-les
   h e l l o z	utf-16-bes
    h e l l ozlatin-1u   ☃s   ☃i   )zutf-7zutf-8zutf-16z	utf-16-lez	utf-16-beraw_unicode_escapeunicode_escapeunicode_internalr   r7   )zlatin-1r  )r<   u   𐀁𠀂𰀃񀀄񐀅)zutf-8zutf-16z	utf-16-lez	utf-16-ber  r  r  r6   r   i   i   i   )zutf-8)r   r   r@   r?   r   catch_warningsr   DeprecationWarningr   r=   r>   list)r   rp   ur   r   r   r	   test_codecs%  s>    

*
"
$

(
zUnicodeTest.test_codecsc             C   sj   t td}x$dD ]}| t|||| qW t tdd}x$dD ]}| t|||| qFW d S )Nr  )9cp037cp1026cp273cp437cp500cp720cp737cp775cp850cp852cp855cp858cp860cp861cp862cp863cp865cp866cp1125
iso8859_10
iso8859_13
iso8859_14
iso8859_15	iso8859_2	iso8859_3	iso8859_4	iso8859_5	iso8859_6	iso8859_7	iso8859_9koi8_rkoi8_tkoi8_ukz1048latin_1mac_cyrillic
mac_latin2cp1250cp1251cp1252cp1253cp1254cp1255cp1256cp1257cp1258Zcp856cp857cp864cp869Zcp874	mac_greekmac_iceland	mac_romanmac_turkishZcp1006	iso8859_8r7   ) r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  )r   r@   r   r   r   )r   r   r   r   r   r	   test_codecs_charmap\  s    zUnicodeTest.test_codecs_charmapc             C   s@   |  dd |  dd |  dd |  dd |  dd d S )Nr  rg   )r   )r   r   r   r	   test_concatenation  s
    zUnicodeTest.test_concatenationc             C   s   G dd d}| }t d|d t dd|d t dd|d t dd|d t d|d t dd|d t dd|d t d	|d t d	|d d S )
Nc               @   s   e Zd Zdd ZdS )z,UnicodeTest.test_printing.<locals>.BitBucketc             S   s   d S )Nr   )r   r   r   r   r	   write  s    z2UnicodeTest.test_printing.<locals>.BitBucket.writeN)r   r   r   r  r   r   r   r	   	BitBucket  s   r  r.   )filer\   zabc
r'   )endr  zdef
)print)r   r  outr   r   r	   test_printing  s    zUnicodeTest.test_printingc          
   C   s   d}| dd}| || d}|d d}| || d}|d d}| || ydd W n> tk
r } z | |jd | |jd W d d }~X Y nX | d d S )	Nu   􀀀zraw-unicode-escapes
   \U00100000s
   \U00010000s
   \U11111111r   rS   z%Should have raised UnicodeDecodeError)r   r   r   rp  startr  Zfail)r   rq   r   er   r   r	   	test_ucs4  s     zUnicodeTest.test_ucs4c             C   s   G dd d}G dd dt }G dd dt }| t | d | t |dd t |d}| |d	 | t|| t|d}| |d	 | t|t d S )
Nc               @   s   e Zd Zdd ZdS )z0UnicodeTest.test_conversion.<locals>.ObjectToStrc             S   s   dS )Nr   r   )r   r   r   r	   r     s    z8UnicodeTest.test_conversion.<locals>.ObjectToStr.__str__N)r   r   r   r   r   r   r   r	   ObjectToStr  s   r  c               @   s   e Zd Zdd ZdS )z5UnicodeTest.test_conversion.<locals>.StrSubclassToStrc             S   s   dS )Nr   r   )r   r   r   r	   r     s    z=UnicodeTest.test_conversion.<locals>.StrSubclassToStr.__str__N)r   r   r   r   r   r   r   r	   StrSubclassToStr  s   r  c               @   s   e Zd ZdddZdd ZdS )z=UnicodeTest.test_conversion.<locals>.StrSubclassToStrSubclassr6   c             S   s   t | d| S )NrR   )r   __new__)clsZcontentr   r   r	   r    s    zEUnicodeTest.test_conversion.<locals>.StrSubclassToStrSubclass.__new__c             S   s   | S )Nr   )r   r   r   r	   r     s    zEUnicodeTest.test_conversion.<locals>.StrSubclassToStrSubclass.__str__N)r6   )r   r   r   r  r   r   r   r   r	   StrSubclassToStrSubclass  s   
r  r   r  Zfoofoo)r   r   r   r    r   )r   r  r  r  r   r   r   r	   test_conversion  s    zUnicodeTest.test_conversionc             C   sD   G dd d}G dd d}|  t| d |  t| d d S )Nc               @   s   e Zd Zdd ZdS )z)UnicodeTest.test_unicode_repr.<locals>.s1c             S   s   dS )Nz\nr   )r   r   r   r	   r     s    z2UnicodeTest.test_unicode_repr.<locals>.s1.__repr__N)r   r   r   r   r   r   r   r	   s1  s   r  c               @   s   e Zd Zdd ZdS )z)UnicodeTest.test_unicode_repr.<locals>.s2c             S   s   dS )Nz\nr   )r   r   r   r	   r     s    z2UnicodeTest.test_unicode_repr.<locals>.s2.__repr__N)r   r   r   r   r   r   r   r	   s2  s   r   z\n)r   rE   )r   r  r   r   r   r	   test_unicode_repr  s    zUnicodeTest.test_unicode_reprc             C   s(   |  tddd  |  tdd d S )Nu   𐀀z'%c')i   u   𔀀z'\U00014000')r   rE   )r   r   r   r	   test_printable_repr  s    zUnicodeTest.test_printable_reprPr]   z only applies to 32-bit platformsc             C   s   |  tdjtj d S )Nzt	t	)r(   r   
expandtabsr9   r   )r   r   r   r	   $test_expandtabs_overflows_gracefully  s    z0UnicodeTest.test_expandtabs_overflows_gracefullyc             C   s   d}|  | | d S )Nr.   )r   r  )r   r   r   r   r	   test_expandtabs_optimization  s    z(UnicodeTest.test_expandtabs_optimizationc                s   t ddkrd}d}nd}d}xtdD ]l t }|dk rDd	}|}n|d
k rVd}|}nd}|}tj| |  fdd}| t| | t| q&W d S )Nr  ri   0   H      $   )rN   ru   u   €u   􏿿r7   rP   i   rR   r]   c                  s     S )Nr   r   )charmaxlenr   r	   <lambda>	  r   z0UnicodeTest.test_raiseMemError.<locals>.<lambda>)structcalcsizerw   r9   r   r(   r   )r   Zascii_struct_sizeZcompact_struct_sizecodeZ	char_sizeZstruct_sizeZallocr   )r  r  r	   test_raiseMemError  s&    
zUnicodeTest.test_raiseMemErrorc             C   s>   G dd dt }|d}| d| d | d|d d S )Nc               @   s   e Zd Zdd ZdS )z+UnicodeTest.test_format_subclass.<locals>.Sc             S   s   dS )Nz__str__ overriddenr   )r   r   r   r	   r   	  s    z3UnicodeTest.test_format_subclass.<locals>.S.__str__N)r   r   r   r   r   r   r   r	   S	  s   r  xxxz%sz__str__ overriddenz{})r   r   r   )r   r  r   r   r   r	   test_format_subclass	  s    z UnicodeTest.test_format_subclassc             C   sX   G dd dt }| |d|d d G dd dt }|d}|d7 }| |d d S )Nc               @   s   e Zd Zdd ZdS )z(UnicodeTest.test_subclass_add.<locals>.Sc             S   s   dS )Nr   r   )r   rk  r   r   r	   __add__	  s    z0UnicodeTest.test_subclass_add.<locals>.S.__add__N)r   r   r   r  r   r   r   r	   r  	  s   r  r2  r  r   c               @   s   e Zd Zdd ZdS )z(UnicodeTest.test_subclass_add.<locals>.Sc             S   s   dS )Nr   r   )r   rk  r   r   r	   __iadd__	  s    z1UnicodeTest.test_subclass_add.<locals>.S.__iadd__N)r   r   r   r  r   r   r   r	   r  	  s   r   )r   r   )r   r  r   r   r   r	   test_subclass_add	  s    zUnicodeTest.test_subclass_addc             C   s@   d}|  }| |d | | |d | | t|d d S )Nr.   r   rP   )__getnewargs__assertIsNotr   rh  )r   r   r#   r   r   r	   test_getnewargs%	  s
    zUnicodeTest.test_getnewargsc          
   C   s   xt dddD ]v}d| d }tdtfR |d}| |d| |d7 }|d}| || | |d| W d Q R X qW d S )	NrP   rX   r  rN   rO   z*unicode_internal codec has been deprecatedr  rp   )r@   r   r   r  r   r   r   r+   )r   lengthr   r.   r  r   r   r	   test_resize,	  s    


zUnicodeTest.test_resizec             C   s  d}d| }d| }d| }d| }d| }d| }d| }d	| }	||||||||	f}
xt |
d
D ]\}}||k}| ||k| | ||k|  |rf| ||k | ||k t|}t|}| || | ||k | ||k | ||k | ||k qfW | ||k  | ||k  | ||k  | ||k  | ||k | ||k | ||k | ||k | ||k  | ||k  | ||k  | ||k  | ||k | ||k | ||k | ||k | ||k  | ||k  | ||k  | ||k  | ||k | ||k | ||k | ||k | ||k  | ||k  | ||k  | ||	k  | ||k | ||k | ||k | ||	k d S )NrS   rN   rr   r}  r&   u   Āu   ￿u   􀀀u   􏿿rR   )	itertoolscombinationsr   r   r   r  r   )r   r	  r<   Zascii2latinlatin2ZbmpZbmp2ZastralZastral2stringsZtext1Ztext2ZequalZcopy1Zcopy2r   r   r	   test_compare=	  sv    zUnicodeTest.test_comparec             C   s    t | tt t | tt d S )N)r   Zcheck_free_after_iteratingiterr   reversed)r   r   r   r	   test_free_after_iterating	  s    z%UnicodeTest.test_free_after_iterating)kr   r   r   r   rx   r%   r,   rD   rF   rK   rV   r`   rd   rj   rm   r{   r~   r   r   r   r   unittestZskipIfr9   r   r   r   r   cpython_onlyr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   Z
skipUnlessr   r   r   r$  r-  r/  r0  r1  r6  rF  rS  rT  rX  r[  r\  rb  Zrun_with_localerf  rm  rn  rq  rv  rx  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r  r"  r%  __classcell__r   r   )r   r	   r   1   s   	**F;
		'  37W 	F	/%/Y:O)77Jr   c               @   s   e Zd Zdd Zejdd Zejdd Zejdd Zejd	d
 Z	ejdd Z
ejdd Zejdd Zejdd ZdS )CAPITestc          	      s  t d ddlm}mm}m}m}m}m	}m
}m}m}	m}
m} d}t||_fdd  fdd}|d	d
d td dd |dd|d |dd|d t  d|d W d Q R X |dd|d|d |dd |dd |dd |dd |d d!d" |d#d$d% |d&d'd(d) |d*d+d, |d-d.d/ |d0d1d, |d2d3d/ |d4d5d/ |d4d6d/ |d4d7d/d  |d&d8d d(d) |d9d:d# |d;d<d# |d=d>d# |d?d@d# |dAdBd# |dCdDd# |d?dEd# |dAdFd# |dCdGd# |d9dHd" |d;dId" |d=dJd" |d9dKd# |d;dLd# |d=dMd# |d9dNd#dO |d;dPd#dO |d=dQd#dO |dRdNd dO |dSdPd dO |dTdQd dO |dUdV|dW |dXdY|dW |dZd[|d\ |dZd]|d\ |dZd^|d\ |dZd_|d\ |dZd`|d\ |dZda|d\ |dZdb|d\ |dZdc|d\ |ddde|df |dddg|df |dddh|	df |dddi|
df djdk|| dl   }| dl }|t|db|| |t|db|| djdk||	  dl }|t|dh|	|  dm|dn |dddWdodp|df |dddqdr|df |dddqdods|df |dddtdodqdu|df |dddWdodv|df |dddqdw|df |dddqdodx|df |dddtdodqdy|df |dddWdodz|d{ |dddqd||d{ |dddqdod}|d{ |dddtdodqd~|d{ |ddd |ddd#d |ddd d |ddd d |ddd" |dd |dd|dW |ddd" |dd |ddd d S )Nctypesr   )	pythonapi	py_objectsizeofc_intc_long
c_longlong	c_ssize_tc_uintc_ulongc_ulonglongc_size_tc_void_pPyUnicode_FromFormatc                s$   t fdd|D } | f| S )Nc             3   s$   | ]}t |tr |n|V  qd S )N)
isinstancer   )r  arg)r,  r   r	   	<genexpr>	  s   zJCAPITest.test_from_format.<locals>.PyUnicode_FromFormat.<locals>.<genexpr>)r]  )r   r#   Zcargs)_PyUnicode_FromFormatr,  r   r	   r7  	  s    

z7CAPITest.test_from_format.<locals>.PyUnicode_FromFormatc                s    |f| } | | d S )N)r   )Zexpectedr   r#   r   )r7  r   r   r	   check_format	  s    z/CAPITest.test_from_format.<locals>.check_formatu   ascii=unicodeés	   ascii=%Uu	   unicodeéz^^PyUnicode_FromFormatV\(\) expects an ASCII-encoded format string, got a non-ASCII byte: 0xe9$s   unicode=%sr<   u   ꯍs   %ciͫ  u   􏿿i i   u   𐀀􀀀s   %c%ci   i   %   %s   %%z%ss   %%sz[%]s   [%%]z%abcs   %%%ss   abcr.   s   %.3ss   abcdefu   abc[�s   %.5su   abc[€]utf8z'\u20acABC's   %Au   €ABCz'\u20s   %.5Au	   €ABCDEFu   '€ABC's   %Ru   '€As   %.3Ru   €ABs   %.3Ss   %.3Us   %.3Vs   %.5Vz
repr=  abcs   repr=%5Szrepr=abs	   repr=%.2Sz
repr=   abs
   repr=%5.2Szrepr=   'abc's   repr=%8Rzrepr='abs	   repr=%.3Rz
repr=  'abs
   repr=%5.3Rs   repr=%8As	   repr=%.3As
   repr=%5.3As   repr=%5ss	   repr=%.2ss
   repr=%5.2ss   repr=%5Us	   repr=%.2Us
   repr=%5.2Us   repr=%5Vs   123s	   repr=%.2Vs
   repr=%5.2Vz
repr=  123zrepr=12z
repr=   12Z010s   %03irS   Z0010s   %0.4iz-123s   %iis   %lis   %llis   %zis   %ds   %lds   %llds   %zdrv   s   %ur  s   %lus   %llus   %zurR   ri   rP   s   %prQ   r   s   %010irX   s   %100is   %.100iP   s   %100.80is   %010us   %100us   %.100us   %100.80us   %010xi#  s   %100xs   %.100xs   %100.80xz%A:'abc\xe9\uabcd\U0010ffff's   %%A:%Au   abcéꯍ􏿿zrepr=abcs   repr=%Vs   xyzu   repr=人民s   人民u   repr=abc�s   abcs   %1%sz%1abcs   %1abcz%+is   %+iz%.%ss   %.%sr6   r   s   %s)r   import_moduler*  r+  r,  r-  r.  r/  r0  r1  r2  r3  r4  r5  r6  r   ZrestyperH  rk   r(   r   r   r   r   )r   r+  r-  r.  r/  r0  r1  r2  r3  r4  r5  r6  r   r<  Zmin_longlongZmax_longlongZmax_ulonglongr   )r7  r;  r,  r   r	   test_from_format	  s\   
8















zCAPITest.test_from_formatc       	      C   s:  ddl m} td ddlm}m} |dd\}}| |d | |d |dd	\}}| |d	 | |d |dd
\}}| |d	 | |d |dd\}}| |d	 | |d |dd\}}| |d | |d td}||dkrd	}d}nd}d}|||\}}| || | ||d  d S )Nr   )unicode_aswidecharr*  )c_wcharr-  r  rR   r   r.   rL   r]   zabc rS   zabc defr  r  zabc def i rP   r   )	rZ  rC  r   rA  r*  rD  r-  r   r?   )	r   rC  rD  r-  wcharr   nonbmpbuflenncharr   r   r	   test_aswidechar~
  s6    
zCAPITest.test_aswidecharc             C   s   ddl m} td ddlm}m} |d\}}| |d | |d |d\}}| |d	 | |d
 td}||dkrd}nd}||\}}| || | ||d  d S )Nr   )unicode_aswidecharstringr*  )rD  r-  r.   rL   zabc zabc defr  zabc def i rR   rP   r   )	rZ  rJ  r   rA  r*  rD  r-  r   r?   )r   rJ  rD  r-  rE  r   rF  rH  r   r   r	   test_aswidecharstring
  s     
zCAPITest.test_aswidecharstringc             C   s   ddl m} xdD ]}t|}| |||d|d  | |||d|d  | |||d d|d  | |||d d|d  | t|||d d | t|||d d d||g}| ||t|d|d  | ||t|d|d  qW d S )	Nr   )unicode_asucs4)r.   u   ¡¢u   你好u   a😀u	   abcu   rP   r   u   ￿u    ￿rR   )rZ  rL  rh  r   r(   SystemErrorr=   )r   rL  r   lr   r   r	   test_asucs4
  s    
zCAPITest.test_asucs4c          
   C   sx  ddl m} xbdD ]Z}xTt|D ]H\}}| ||t|dt|d| | ||t|dt|d| q W qW d}| ||ddt|dd | ||ddt|dd | ||tddt|d dd	 | ||tddt|d dd	 | ||tddddd | ||tdt|ddd | ||tdt| ddd | ||tdt| ddd d S )
Nr   )unicode_findchar)   ¡u   耀肀u   u   🄀🇱rP   rQ   z!>_<!i   r   r]   )rZ  rP  r  r   rw   rh  )r   rP  r   ro   r   r   r   r	   test_findchar
  s    
 ($$ "zCAPITest.test_findcharc       	      C   s  ddl m} ddddg}xt|D ]\}}x*|d | D ]}| t||d|dd q8W xDtdD ]8}| ||d||d|||d  ddd| f q`W xDtdD ]8}| |||||d|||d  ddd| f qW q"W |d }| t	||d	|dd | t	||d
|dd | t	||d|d	d | t	||d|d
d | t||d|dd | t||d|dd
 | t||dddd d S )Nr   )unicode_copycharactersZabcdeu
   ¡¢£¤¥u   你好世界！u   😀😁😂😃😄r  r   r  rQ   rP   r   )
rZ  rS  r  r(   rM  r@   r   r   r   r   )	r   rS  r!  idxZfrom_toZ
from_startZto_startr   r   r   r	   test_copycharacters
  s6    zCAPITest.test_copycharactersc             C   sb   ddl m} | |dd | |dd | |dd | t|d	d
 | td|d	d d S )Nr   )unicode_encodedecimalrv   s   123u   ٣.١٤s   3.14u
    3.14 s    3.14 u   123€r   z'^'decimal' codec can't encode characterr   )rZ  rW  r   r(   UnicodeEncodeErrorrH  rk   )r   rW  r   r   r	   test_encode_decimal  s    



zCAPITest.test_encode_decimalc             C   sP   ddl m} | |dd | |dd | |dd | |dd d S )Nr   )unicode_transformdecimaltoasciirv   u   ٣.١٤z3.14u
    3.14 u   123€)rZ  rZ  r   )r   Ztransform_decimalr   r   r	   test_transform_decimal  s    



zCAPITest.test_transform_decimalc             C   s   ddl m} xndD ]f}d}x\tdD ]P}|t|7 }| ||t| |d   | ||t| |d   q$W qW d S )Nr   )getargs_s_hash)r
     i   i r6   r  rP   )rZ  r\  r@   r?   r   r   )r   r\  kr   ro   r   r   r	   test_pep393_utf8_caching_bug*  s    
 z%CAPITest.test_pep393_utf8_caching_bugN)r   r   r   rB  r   r'  rI  rK  rO  rR  rV  rY  r[  r_  r   r   r   r	   r)  	  s    p&*r)  c               @   s   e Zd Zdd Zdd ZdS )StringModuleTestc             C   s   dd }|d}|  |ddddg |d}|  |d	d
g |d}|  |dg |d}|  |g  |d}|  |dg | ttjd d S )Nc             S   s   t t| S )N)r  _stringformatter_parser)r   r   r   r	   parse=  s    z5StringModuleTest.test_formatter_parser.<locals>.parsez2prefix {2!s}xxx{0:^+10.3f}{obj.attr!s} {z[0]!s:10})zprefix r   r6   r   )r  r   z^+10.3fN)r6   zobj.attrr6   r   )r'   zz[0]r  r   zprefix {} suffix)zprefix r6   r6   N)z suffixNNNr   )r   NNNr6   z{0})r6   r   r6   NrP   )r   r(   rA   ra  rb  )r   rc  	formatterr   r   r	   test_formatter_parser<  s(    z&StringModuleTest.test_formatter_parserc             C   sv   dd }|  |ddg g |  |dddgg |  |dddgg |  |dddd	d
gg | ttjd d S )Nc             S   s"   t t| }t |d |d< |S )NrP   )r  ra  formatter_field_name_split)r   itemsr   r   r	   r}   ^  s    z?StringModuleTest.test_formatter_field_name_split.<locals>.splitrl  zobj.arg)Tr9  zobj[key])Fr%  zobj.arg[key1][key2])FZkey1)FZkey2rP   )r   r(   rA   ra  rf  )r   r}   r   r   r	   test_formatter_field_name_split]  s    

z0StringModuleTest.test_formatter_field_name_splitN)r   r   r   re  rh  r   r   r   r	   r`  ;  s   !r`  __main__)ra  codecsr  rI  r  r9   r&  r   r3  r   r   r   registerr   r   r   rU   r   ZMixinStrUnicodeTestZTestCaser   r)  r`  r   mainr   r   r   r	   <module>   sR   

                  j   23