HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //proc/thread-self/root/usr/local/lib/python3.7/test/__pycache__/test_unicode.cpython-37.pyc
B

��g	�@s�dZddlZddlZddlZddlZddlZddlZddlZddlZddl	Z	ddl
mZmZdd�Z
e�e
�dd�ZGdd	�d	e�ZGd
d�dejejejej�ZGdd
�d
ej�ZGdd�dej�Zedkr�e��dS)z� Test script for the Unicode implementation.

Written by Marc-Andre Lemburg (mal@lemburg.com).

(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.

�N)�support�string_testscCsXddd�}d
dd�}ddd�}ddd	�}|d
kr<||ddfS|dkrP||ddfSdSdS)N�strictcSsdS)N�*�)�input�errorsrr�-/usr/local/lib/python3.7/test/test_unicode.py�decode1sz search_function.<locals>.decode1cSsdS)Nrr)rrrrr	�encode1sz search_function.<locals>.encode1cSsdS)N)rrr)rrrrr	�encode2sz search_function.<locals>.encode2cSsdS)N)rrr)rrrrr	�decode2sz search_function.<locals>.decode2z
test.unicode1z
test.unicode2)r)r)r)rr)�encodingr
rrr
rrr	�search_functions



rcCs|����S)z�
    Try to get a fresh clone of the specified text:
    new object with a reference count of 1.

    This is a best-effort: latin1 single letters and the empty
    string ('') are singletons and cannot be cloned.
    )�encode�decode)�textrrr	�duplicate_string%src@seZdZdS)�StrSubclassN)�__name__�
__module__�__qualname__rrrr	r/srcs�eZdZeZdd�Zdd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd �Ze�ejd!kd"�d#d$��Zd%d&�Zejd'd(��Zd)d*�Zd+d,�Z�fd-d.�Z �fd/d0�Z!�fd1d2�Z"�fd3d4�Z#e�$d5�d6d7��Z%�fd8d9�Z&�fd:d;�Z'�fd<d=�Z(d>d?�Z)�fd@dA�Z*dBdC�Z+dDdE�Z,dFdG�Z-dHdI�Z.dJdK�Z/dLdM�Z0dNdO�Z1dPdQ�Z2�fdRdS�Z3dTdU�Z4dVdW�Z5e�6ejdXkdY�ejdZd[���Z7d\d]�Z8d^d_�Z9d`da�Z:dbdc�Z;ddde�Z<dfdg�Z=dhdi�Z>djdk�Z?dldm�Z@dndo�ZAdpdq�ZBdrds�ZCejdtdu��ZDdvdw�ZEdxdy�ZFe�Gdzd{d|�d}d~��ZHdd��ZId�d��ZJd�d��ZKd�d��ZLd�d��ZMd�d��ZNd�d��ZOd�d��ZPd�d��ZQd�d��ZRd�d��ZSd�d��ZTd�d��ZUd�d��ZVd�d��ZWd�d��ZXd�d��ZYd�d��ZZd�d��Z[d�d��Z\d�d��Z]d�d��Z^d�d��Z_d�d��Z`e�ejd!k�p2ea�bd��d�kd��d�d���Zcejd�d���Zdd�d��Zed�d��Zfd�d��Zgd�d��Zhd�d��Zid�d��Zjd�dÄZk�ZlS)��UnicodeTestcGs�t||�}||�}|�||�|�t|�t|�k�||kr�Gdd�dt�}||�}t||�}||�}|�||�|�||k	�dS)Nc@seZdZdd�ZdS)z)UnicodeTest.checkequalnofix.<locals>.usubcSsdt�|�S)Nzusub(%r))�str�__repr__)�selfrrr	rCsz2UnicodeTest.checkequalnofix.<locals>.usub.__repr__N)rrrrrrrr	�usubBsr)�getattr�assertEqual�
assertTrue�typer)r�result�objectZ
methodname�args�methodZ
realresultrrrr	�checkequalnofix9s

zUnicodeTest.checkequalnofixcCsV|�dd�|�dd�|�ttd�|�ttd�|�ttdd�|�dd�dS)	N�ÿu￿z'\Ufffffffe'z'\Uffffffff'z'\U%08x'iz\u0020� )r�assertRaises�SyntaxError�eval�assertNotEqual)rrrr	�
test_literalsKszUnicodeTest.test_literalscCs<tj�d��s8|�td�d�|�td�d�|�td�d�|�td�d	�|�td
�d�|�td�d
�|�td�d�|�td�d�|�td�d�|�td�d�|�td�d�|�td�d�|�td�d�d}td�tttd����}|�||�|�td�td��Gdd�d�}|�	t
t|��dS) N�java�abcz'abc'zab\cz'ab\\c'zab\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'��u�0𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿c@seZdZdd�ZdS)z)UnicodeTest.test_ascii.<locals>.WrongReprcSsdS)Ns	byte-reprr)rrrr	rzsz2UnicodeTest.test_ascii.<locals>.WrongRepr.__repr__N)rrrrrrrr	�	WrongReprysr8)�sys�platform�
startswithr�ascii�join�map�chr�ranger(�	TypeError)r�
latin1repr�testreprr8rrr	�
test_asciiTs*

zUnicodeTest.test_asciicCs<tj�d��s8|�td�d�|�td�d�|�td�d�|�td�d	�|�td
�d�|�td�d
�|�td�d�|�td�d�|�td�d�|�td�d�|�td�d�|�td�d�|�td�d�d}td�tttd����}|�||�|�td�td��Gdd�d�}|�	t
t|��dS) Nr-r.z'abc'zab\cz'ab\\c'zab\z'ab\\'z\cz'\\c'r/z'\\'r0z'\n'r1z'\r'r2z'\t'r3z'\x08'z'"z'\'"'r4z"'"r5z'"'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®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'r6r7u�0𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿c@seZdZdd�ZdS)z(UnicodeTest.test_repr.<locals>.WrongReprcSsdS)Ns	byte-reprr)rrrr	r�sz1UnicodeTest.test_repr.<locals>.WrongRepr.__repr__N)rrrrrrrr	r8�sr8)r9r:r;r�reprr=r>r?r@r(rA)rrBrCr8rrr	�	test_repr~s*

zUnicodeTest.test_reprcCsJd��}|�t|�d�|�t|�d�|�t|�d�|�tt|�dS)Nu	ᄑ∢㌳uᄑu∢u㌳)�__iter__r�nextr(�
StopIteration)r�itrrr	�test_iterators�s
zUnicodeTest.test_iteratorscCsltj�|�|�dddd�|�dddd�|�dddd�|�dddd�|�dddd�|�ddddd�|�ddddd	�|�d
ddddd�|�dddddd	�|�dddd�|�dd
dd�|�dddd�|�dddd�|�dddd�|�dddd�|�dddd�|�dddd�|�dddd�|�dddd�|�dddd�|�dddd�dS)N�Zaaa�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Ă_uaĂua􀌄uĂ􀌄)r�
CommonTest�
test_countr%�
checkequal)rrrr	rV�s,zUnicodeTest.test_countcCs�tj�|�|�dddd�|�dddd�|�dddd�|�dddd�|�dd	dd
�|�dd	dd�|�dd	dd�|�d
ddd�|�ddddd�|�ddddd�|�tdj�|�tdjd�|�dddd�|�dddd�|�dddd�|�dddd�|�dddd
�|�dddd
�|�dddd�|�dddd�|�dddd �|�dddd!�|�dddd"�|�dddd#�dS)$N�dufaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaĂ�finduĂrQuȁuĠuȠuhaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa􀌄u􀌄u􀈄u􂀄r�abcdefghiabcr.�	rP�def��helloru�ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂarNu�􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄au�􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄Ă�daaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaau�ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂu�ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂa_rTu�􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄a_u�􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄Ă_uĂ_uaĂua􀌄uĂ􀌄)rrU�	test_findrWr%r(rArY)rrrr	r`�s2zUnicodeTest.test_findcCsptj�|�|�dddd�|�dddd�|�dddd�|�dddd�|�dd	dd
�|�dd	dd�|�dd	dd�|�d
ddd�|�dddd�|�dddd�|�dddd�|�dddd�|�dddd�|�dddd�|�dddd
�|�dddd
�|�dddd�|�dddd�|�dddd�|�dddd�|�dddd�|�dddd�dS) NrufĂaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa�rfinduĂrQuȁuĠuȠuh􀌄aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaau􀌄u􀈄u􂀄r[rZr.�r6u�aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂrNu�a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄u�Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄r_u�ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂu�_aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂ�_au�_a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄u�_Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄u_ĂuĂau􀌄au􀌄Ă)rrU�
test_rfindrWr%)rrrr	rd�s.zUnicodeTest.test_rfindcCsXtj�|�|�dddd�|�dddd�|�dddd�|�ddddd	�|�tdjd
�|�tdjdd	�|�tdjd
d�|�tdjd
d�|�dddd�|�dddd�|�dddd�|�tdjd�|�tdjd�|�tdjd�|�dddd�|�dddd�|�dddd�|�tdjd�|�tdjd�|�tdjd �dS)!NrrZ�indexr6rLr\r.r[rP�hibZabcdefghiab�	abcdefghi�ghi�rQrXu�ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂarNu�􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄au�􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄ĂuĂr_u􀌄u�ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂu�ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂa_rTu�􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄a_u�􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄Ă_uĂ_uaĂua􀌄uĂ􀌄)rrU�
test_indexr%r(�
ValueErrorrerW)rrrr	rjs*zUnicodeTest.test_indexcCsrtj�|�|�dddd�|�dddd�|�dddd�|�d	dddd	d
�|�tdjd�|�tdjdd
�|�tdjdd	d
�|�tdjdd	d�|�tdjdd	d
�|�d	ddd�|�d	ddd�|�d	ddd�|�tdjd�|�tdjd�|�tdjd�|�d	ddd�|�d	ddd�|�d	ddd�|�tdjd�|�tdjd�|�tdjd �dS)!NrbrZ�rindexr6rLr\r[r.rrQrfZ	defghiabcrPrgrhriu�aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂrNu�a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄u�Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄uĂr_u􀌄u�ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂu�_aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂrcu�_a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄u�_Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄u_ĂuĂau􀌄au􀌄Ă)rrU�test_rindexr%r(rkrlrW)rrrr	rms,zUnicodeTest.test_rindexcCs4|�dddtd�di�|�dddtd�dtd�td�i�|�dddtd�dtd�td�td	�d
i�|�d	ddtd�dtd�di�|�dd
dtd�di�|�dddddi�|j�ddd��}|�ddd|�|j�ddd�}|�ddd|�|�d�t�dd��d�|�d�t�ddi��d�|�d�t�ddi��d�|�d�t�ddi��d�|�d�t�ddi��d�|�d �t�dd!d���d"�|�d �t�ddd���d#�|�d�t�dd$i��d%�|�d�t�ddi��d�|�d�t�ddi��d�|�d�t�dd!i��d&�|�d'�t�dd(i��d)�d*}x4d+D],}t�||i�}d,|}|�t|j|��qRW|�t	|jj�|�t|jjdd-�|�t	|jjd.d/�|�t	|jjdd.�|�t	|jjdd/d.�|�t|jjd0d.i�|�t	|jjd1d.i�|�t	d2j�|�t	djdd�dS)3NZbbbcZabababc�	translaterNZiiicrO�iZiiix�c�xr6ZxyyxZxzx�zZyyz<i>)rNrOz
<i><i><i>cr.Zxyz�dZxyzzyZabdcdcbddddz[a]�Xz[X]z[]ZXXXz[XXX]�éu[é]Zaxb�123Zx123uxéu<é>u[<é>]z[123]u[aé]u<€>u	[<€>é]iu
aé€􏿿z[%s]ZdefgrRr\Zxy)rPr^)
r%�ord�	type2test�	maketransrrnrr(rkrA)rZtblZinvalid_charZbefore�mappingrrrr	�test_maketrans_translate7sl


"




z$UnicodeTest.test_maketrans_translatec	Cs�tj�|�x�dD]�\}}|d9}|d9}x�dD]|}|�||g||d|�|�||g|||d|�|�||g||d|d�|�||g||d|d|d�q0WqWdS)N)�bauāĀu𐌁𐌀r[)rpuĂu𐌂�splitrR)rrU�
test_splitrW)r�left�right�delimrrr	r~}s


zUnicodeTest.test_splitc	Cs�tj�|�x�dD]�\}}|d9}|d9}x�dD]|}|�||g||d|�|�||g|||d|�|�||g||d|d�|�||g||d|d|d�q0WqWdS)N)r|uāĀu𐌁𐌀r[)rpuĂu𐌂�rsplitrR)rrU�test_rsplitrW)rrr�r�rrr	r��s


zUnicodeTest.test_rsplitc	Cs�tj�|�|�dddd�x�dD]�\}}|d9}|d9}x�dD]�}|�||ddf||d|�|�|||f|||d|�|�||ddf||d|d	�|�||d	|f||d	|d|d	�q@Wq"WdS)
N)�ABCDEFGHr6r6r��	partitionu䈀)r|uāĀu𐌁𐌀r[)rpuĂu𐌂r6rR)r�MixinStrUnicodeUserStringTest�test_partitionrW)rrr�r�rrr	r��s
zUnicodeTest.test_partitionc	Cs�tj�|�|�dddd�x�dD]�\}}|d9}|d9}x�dD]�}|�dd||f||d|�|�|||f|||d|�|�dd||f||d|d	�|�||d	|f||d	|d|d	�q@Wq"WdS)
N)r6r6r�r��
rpartitionu䈀)r|uāĀu𐌁𐌀r[)rpuĂu𐌂r6rR)rr��test_rpartitionrW)rrr�r�rrr	r��s
zUnicodeTest.test_rpartitionc	Cstj�|�Gdd�d�}|�ddddddd	g�|�d
ddd�|�d
ddt�d��|�ddddddd	g�|�ddddddd	g�|�d
ddd�|�d
ddt�d��|�tdddd|d�g�|�tdddddt�g�|�tdddddg�|�tdddddg�dS)Nc@seZdZdd�Zdd�ZdS)z(UnicodeTest.test_join.<locals>.MyWrappercSs
||_dS)N)�sval)rr�rrr	�__init__��z1UnicodeTest.test_join.<locals>.MyWrapper.__init__cSs|jS)N)r�)rrrr	�__str__�r�z0UnicodeTest.test_join.<locals>.MyWrapper.__str__N)rrrr�r�rrrr	�	MyWrapper�sr�za b c dr'r=rNrOrprs�abcdr6)rNrOrprszw x y zZwxyz�1�2�foo�3rPrRrL)rr��	test_joinr%�Sequence�checkraisesrA�bytes)rr�rrr	r��szUnicodeTest.test_joinlz*needs too much memory on a 64-bit platformcCs4ttjd�d}d|f|}|�tdj|�dS)Ng�?rP�Ar6)�intr9�maxsizer(�
OverflowErrorr=)r�size�seqrrr	�test_join_overflow�szUnicodeTest.test_join_overflowc
Cs�tj�|�|�dddddd�|�tdjdd�x�d	D]�\}}|d
9}|d
9}x�dD]�}x�dD]�}|�||||d||�|�||||||d||�|�||||d|d
|�|�|||||d
|d|d
|�q`WqVWq8WdS)Nzone@two!three!zone!two!three!�replace�!�@rP�rr)r|uāĀu𐌁𐌀r[)rpuĂu𐌂)rsuău𐌃rR)rrU�test_replacer%r(rAr�rW)rrr�r��replrrr	r��s$





zUnicodeTest.test_replacecCs d}d}|�|�||�|�dS)Nr.zabc def)�assertIsr�)r�patternrrrr	�test_replace_id�szUnicodeTest.test_replace_idc	Cslt���Zt�dt�|�ddkd�|�ddkd�|�dtd�kd�|�dtd�kd�WdQRXdS)N�ignorer.sabcFT)r�check_warnings�warnings�simplefilter�BytesWarningr�	bytearray)rrrr	�test_bytes_comparison�s
z!UnicodeTest.test_bytes_comparisoncs:��dd���ddk���ddk���ddk�dS)Nr.r�u��u��)rr)rr)rZ
test_fixupZ
test_lecmpr	�test_comparisons5zUnicodeTest.test_comparisoncs�t���|�ddd�|�d���|�d���|�d���|�d���|�d���|�d	���|�d
���|�d���dS)NFuῼ�isloweruⅧuⅷu𐐁u𐐧u𐐩u𐑎u🐍u👯)�super�test_islowerr%�assertFalser�r)r)�	__class__rr	r�;s
zUnicodeTest.test_islowercs�t���tj�d�s$|�ddd�|�d���|�d���|�d���|�d���|�d	���|�d
���|�d���|�d���dS)
Nr-Fuῼ�isupperuⅧuⅷu𐐁u𐐧u𐐩u𐑎u🐍u👯)	r��test_isupperr9r:r;r%rr�r�)r)r�rr	r�Js
zUnicodeTest.test_isuppercsjt���|�ddd�|�ddd�|�d���|�d���x"dD]}|�|��d�|��qHWdS)	NTuῼ�istitleuGreek ῼitlecases ...u𐐁𐐩u𐐧𐑎)u𐐩u𐑎u🐍u👯z{!a} is not title)r��test_istitler%rr�r��format)r�ch)r�rr	r�Zs

zUnicodeTest.test_istitlecs\t���|�ddd�|�ddd�|�ddd�x"dD]}|�|��d�|��q:WdS)	NTu �isspaceu Fu—)u𐐁u𐐧u𐐩u𐑎u🐍u👯z{!a} is not space.)r��test_isspacer%r�r�r�)rr�)r�rr	r�fs

zUnicodeTest.test_isspaceZcpucCsTxNttjd�D]<}t|�}t�|�}t�|�}|�|��|dkpH|dk�qWdS)NrP)ZWS�B�SZZs)	r@r9�
maxunicoder?�unicodedata�
bidirectional�categoryrr�)rZ	codepoint�charr�r�rrr	�test_isspace_invariantps


z"UnicodeTest.test_isspace_invariantcs2t���x"dD]}|�|��d�|��qWdS)N)u𐐁u𐐧u𐐩u𐑎u𝟶u𑁦u𐒠u🄇z{!a} is alnum.)r��test_isalnumr�isalnumr�)rr�)r�rr	r�zs

zUnicodeTest.test_isalnumcspt���|�ddd�|�d���|�d���|�d���|�d���|�d���|�d	���dS)
NTuῼ�isalphau𐐁u𐐧u𐐩u𐑎u🐍u👯)r��test_isalphar%rr�r�)r)r�rr	r��s
zUnicodeTest.test_isalphacs*t���|�d���|�d���dS)Nu€u􏿿)r��test_isasciir��isascii)r)r�rr	r��s
zUnicodeTest.test_isasciicCs�|�ddd�|�ddd�|�ddd�|�ddd�|�ddd�|�dd	d�|�dd
d�|�ddd�|�tddd
�x"dD]}|�|��d�|��q�Wx"dD]}|�|��d�|��q�WdS)NFr6�	isdecimalrNT�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�rAr�r�r�r)rr�rrr	�test_isdecimal�s

zUnicodeTest.test_isdecimalcs�t���|�ddd�|�ddd�|�ddd�x"dD]}|�|��d�|��q:Wx"d	D]}|�|��d
�|��q^WdS)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)rr�)r�rr	r��s


zUnicodeTest.test_isdigitcCs�|�ddd�|�ddd�|�ddd�|�ddd�|�ddd�|�dd	d�|�dd
d�|�ddd�|�tdjd
�x"dD]}|�|��d�|��q�Wx"dD]}|�|��d�|��q�WdS)NFr6�	isnumericrNTr�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(rAr�r�r�r)rr�rrr	�test_isnumeric�s

zUnicodeTest.test_isnumericcCs�|�d���|�d���|�d���|�d���|�d���|�d���|�d���|�d���|�d	���|�d
���|�d���|�d���dS)
NrN�Z�_Zb0ZbcZb_�µu𝔘𝔫𝔦𝔠𝔬𝔡𝔢r'�[�©r�)r�isidentifierr�)rrrr	�test_isidentifier�szUnicodeTest.test_isidentifiercCs�|�d���|�d���|�d���|�d���|�d���|�d���|�d���|�d���|�d	���dS)
Nr6r'�abcdefgzabcdefg
uʹu͸u�u👯u󠀠)r�isprintabler�)rrrr	�test_isprintable�szUnicodeTest.test_isprintablecCs�x6dD].}|�|���|�|���|�|���qWx6dD].}|�|���|�|���|�|���q>Wx<dD]4}tt|�}x$dD]}|�||�d||f�q�WqvWx<dD]4}tt|�}x$dD]}|�||�d||f�q�Wq�WdS)N)ua�b�ua�b�u	a�b�au	a�b�a)uA�B�uA�B�u	A�B�Au	A�B�A)r�r�r�)u�u�u��u��z%a.%s() is False)r�r�r�r�r�r�r�r�)u�u�u��u��ua�b�ua�b�u	a�b�au	a�b�a)rr�r�r�r�rr)r�sZ	meth_name�methrrr	�test_surrogates�s 




 


zUnicodeTest.test_surrogatescCstj�|�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d	��d
�|�d��d�|�d
��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d�dS)Nu𐐧u𐑏u𐐧𐐧u𐑏𐑏u𐐧𐑏u
X𐐧x𐑏u
x𐑏x𐑏ufiuİui̇uΣuσuͅΣuͅσuAͅΣuaͅςuAͅΣauaͅσauAΣͅuaςͅuΣͅ uσͅ u򏿾uⅷ)rrU�
test_lowerr�lower)rrrr	r��s&


zUnicodeTest.test_lowercCst|�d��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d	��d
�|�d��d�dS)
Nr^ZhELlo�ß�ssufi�fiuΣuσuAͅΣuaισr�uμ)r�casefold)rrrr	�
test_casefoldszUnicodeTest.test_casefoldcCs�tj�|�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d	�|�d
��d
�|�d��d�|�d��d
�|�d��d�|�d��d�|�d��d�dS)Nu𐑏u𐐧u𐑏𐑏u𐐧𐐧u𐐧𐑏u
X𐐧x𐑏u
X𐐧X𐐧ufi�FIuİuΣr��SSuῒuΪ̀u򏿾uⅷuⅧ)rrU�
test_upperr�upper)rrrr	r�s


zUnicodeTest.test_uppercCs�tj�|�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d	�d
}|�d��|�|�d��d
�|�d��d�dS)Nu𐑏u𐐧u𐑏𐑏u𐐧𐑏u𐑏𐐧u
X𐐧x𐑏u
X𐑏x𐑏uhİuHi̇u	Ϊ̀i̇uῒİufinnishZFInnishuAͅΣuAͅς)rrU�test_capitalizer�
capitalize)rZexprrr	r�+s



zUnicodeTest.test_capitalizecs�t���|�d��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d	�|�d
��d�|�d��d
�|�d��d�dS)Nu𐑏u𐐧u𐑏𐑏u𐐧𐑏u𐑏𐑏 𐑏𐑏u𐐧𐑏 𐐧𐑏u𐑏𐐧 𐑏𐐧uX𐐧x𐑏 X𐐧x𐑏uX𐑏x𐑏 X𐑏x𐑏ufiNNISHZFinnishu	AΣ ᾡxyu	Aς ᾩxyuAΣAuAσa)r��
test_titler�title)r)r�rr	r�<s





zUnicodeTest.test_titlecCs0tj�|�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d	��d
�|�d��d�|�d
��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d
��d�|�d��d�|�d��d�dS)Nu𐑏u𐐧u𐑏𐑏u𐐧𐐧u𐐧𐑏u𐑏𐐧u
X𐐧x𐑏u
x𐑏X𐐧ufir�uİui̇uΣuσuͅΣuΙσuAͅΣuaΙςuAͅΣauaΙσAuAΣͅuaςΙuΣͅ uσΙ r�r�uῒuΪ̀)rrU�
test_swapcaser�swapcase)rrrr	r�Ms.



zUnicodeTest.test_swapcasecCsLtj�|�|�d�dd�d�|�d�dd�d�|�d�dd�d�dS)	NrqrRu􏿿ux􏿿rLu	􏿿x􏿿r]u
􏿿x􏿿􏿿)rrU�test_centerr�center)rrrr	r�gszUnicodeTest.test_centeri���zrequires 32-bit systemcCsTd}yd|}Wn&tk
r6|�d|d�YnXz|�t|j�Wd~XdS)NiVUU�üz$no enough memory (%.0f MiB required)i)�MemoryErrorZskipTestr(r�r�)rr�r�rrr	�test_case_operation_overflowpsz(UnicodeTest.test_case_operation_overflowcCs�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd	�|�dd
�|�dd�|�d
d�|�d
d�|�d
d�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�dd�|�tdj�xjdD]b}|d9}xRdD]J}|�||�|�|||�|�|d|�|�|d||d��q^W�qLWdS)NrNZabdbZbdabZbdabaZbdbaZbdb)rNrPN)rPNrN)rqrP�y)rqrPNr�Zabcxxxx�abr.)rPNr�r6�zabczabcZasdfZasd)rNuĀu𐌀r[)rpuĂu𐌂rR)�assertInZassertNotInr(rA�__contains__)r�fillr�rrr	�
test_contains~sD

zUnicodeTest.test_containscCsXd��d��d��d��d��d��d�dd�d�dd�d�dd�dS)Nu𐀀􀀀u􀀀rLu𐀀)	r�r�r�r�r�r�r��ljust�rjust)rrrr	�test_issue18183�szUnicodeTest.test_issue18183cCs�
|�d��d�|�d��d�|�d��d�|�d��d�|�d��d�|�d��d	�|�d
��d�|�d��d
�ddl}|�d�d�d�|�d�tdd��d�|�d�d�d�|�ddd�}|�d�|�d�Gdd�d�}Gdd�d�}Gdd �d �}Gd!d"�d"�}Gd#d$�d$�}Gd%d&�d&|j�}Gd'd(�d(t�}	Gd)d*�d*�}
Gd+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-ddgg�dd�|�dg�d-|dd�gg�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�ddXd��|�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á|�td�j|d���|�td�j|d���|�td�j|d���|�dƠ|ddd�dȍ�dɡ|�d.�|	d`��d^�|�d/�d�d�|�dʠd�d̡d͡|�dΠd�d̡d͡|�d�jd�d�dЍd͡|�d�jd�d`d�dҍdӡ|�d�jd�d�d�dҍdӡ|�tdBj�|�tdDj�|�tdj�|�tdj�|�td�j�|�td�j�|�t	d.j�|�t	d6jd-�|�t
dHj�|�tdOj�|�td�j�|�td�j�|�t	d�j�|�td�jd�|�td�j�|�td�jg�|�t
d�j�|�td�jd�|�td�jd�|�td�jd�|�td�jd�|�t
d�j�|�td�jd�|�td�jd�|jt
d�jdYd�|�td�jdY�|�td�jd�|�td�jd�|�td�j�|�t	d�j�|�t	d�j�|�t	dFj�d�}|�tdB|dDj�|�td�|d�jdg�|�td�jdg�|�td�jdg�|�td�jd�d�|�td�jd-d�d�|�td�jdd7d�dYd�d�d�d��
|�td�jd�|�ttdd��|�td�jd�|�ttdd��|�ttdd��|�d���d�d��d�|�dh��d��d�|�dj��d�d�|��d�dFd�i�dա|��d�dFdi�d�|��d�dBdi�d�|��d�dDdi�d�|��d��ddi�d�|��d��d	di�d�|�t�d
j�d�|�t�dj�d�|�t�d
j�d�|��d�d�d��d�|
d��}
|��d�|
��d�|�t�dj|
�|�tdFj|
�|d��}|��d�|��d�|��d�|��d�|�tdFj|�dS(Nr6rNr�za{{za{za}}za}z{{bz{bz}}bz}bza{{bza{brzMy name is {0}ZFredzMy name is FredzMy name is {0[name]})�namezMy name is {0} :-{{}}zMy name is Fred :-{}i�ri�zThe year is {0.year}zThe year is 2007c@seZdZddd�Zdd�ZdS)z"UnicodeTest.test_format.<locals>.CrXcSs
||_dS)N)�_x)rrqrrr	r��sz+UnicodeTest.test_format.<locals>.C.__init__cSs|S)Nr)r�specrrr	�
__format__�sz-UnicodeTest.test_format.<locals>.C.__format__N)rX)rrrr�rrrrr	�C�s
rc@seZdZdd�Zdd�ZdS)z"UnicodeTest.test_format.<locals>.DcSs
||_dS)N)rq)rrqrrr	r��sz+UnicodeTest.test_format.<locals>.D.__init__cSs
t|j�S)N)rrq)rrrrr	r�sz-UnicodeTest.test_format.<locals>.D.__format__N)rrrr�rrrrr	�D�src@seZdZdd�Zdd�ZdS)z"UnicodeTest.test_format.<locals>.EcSs
||_dS)N)rq)rrqrrr	r��sz+UnicodeTest.test_format.<locals>.E.__init__cSsd|jdS)NzE(�))rq)rrrr	r��sz*UnicodeTest.test_format.<locals>.E.__str__N)rrrr�r�rrrr	�E�sr
c@seZdZdd�Zdd�ZdS)z"UnicodeTest.test_format.<locals>.FcSs
||_dS)N)rq)rrqrrr	r��sz+UnicodeTest.test_format.<locals>.F.__init__cSsd|jdS)NzF(r	)rq)rrrr	r�sz+UnicodeTest.test_format.<locals>.F.__repr__N)rrrr�rrrrr	�F�src@s$eZdZdd�Zdd�Zdd�ZdS)z"UnicodeTest.test_format.<locals>.GcSs
||_dS)N)rq)rrqrrr	r��sz+UnicodeTest.test_format.<locals>.G.__init__cSs
d|jS)Nz
string is )rq)rrrr	r��sz*UnicodeTest.test_format.<locals>.G.__str__cSs"|dkrd|jdSt�||�S)NrszG(r	)rqr"r)r�format_specrrr	r�sz-UnicodeTest.test_format.<locals>.G.__format__N)rrrr�r�rrrrr	�G�sr
c@seZdZdd�ZdS)z"UnicodeTest.test_format.<locals>.IcSs
|�|�S)N)Zstrftime)rrrrr	r�sz-UnicodeTest.test_format.<locals>.I.__format__N)rrrrrrrr	�I�src@seZdZdd�ZdS)z"UnicodeTest.test_format.<locals>.JcSst�|d|�S)NrR)r�r)rrrrr	r�sz-UnicodeTest.test_format.<locals>.J.__format__N)rrrrrrrr	�J�src@s eZdZdd�Zdd�ZdZdS)z"UnicodeTest.test_format.<locals>.McSs
||_dS)N)rq)rrqrrr	r��sz+UnicodeTest.test_format.<locals>.M.__init__cSsd|jdS)NzM(r	)rq)rrrr	r�sz+UnicodeTest.test_format.<locals>.M.__repr__N)rrrr�rr�rrrr	�M�src@s eZdZdd�Zdd�ZdZdS)z"UnicodeTest.test_format.<locals>.NcSs
||_dS)N)rq)rrqrrr	r��sz+UnicodeTest.test_format.<locals>.N.__init__cSsd|jdS)NzN(r	)rq)rrrr	r�sz+UnicodeTest.test_format.<locals>.N.__repr__N)rrrr�rrrrrr	�N�srr.z{0}z{0:}zX{0}ZXabcz{0}XZabcXzX{0}YZXabcYz{1}rPzX{1}z{1}XzX{1}Yi�z-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]}zfoo-barZbazz{0[foo bar]}zfoo barz{0[ ]}r'rLr�z{foo._x}�)r��20z{1}{0}rSZ2010z{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}zab z{0:x<0s}r!z{0:x<5s}z{0:x<6s}z{0:x<7s}Zresultxz{0:x<8s}Zresultxxz{0: <7s}zresult 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�zfooz{0:<6s}zfooz{0:^6s}zfooz{0:^6s}z foo  z{0:<6}z3z{0:<6}z3z{0:^6}z3z{0:<6}z3     g��Q�	@z3.14z3.14z3.14z{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}ZHelloz{0!s:}z{0!s:15}zHello          z	{0!s:15s}z{0!r}z'Hello'z{0!r:}zF(Hello)u͸z'\u0378'uʹu'ʹ'uF(ʹ)z{0!a}z'\u0374'z{0!a:}z	F(\u0374)z[]z[1]z{0:d}�datazG(data)zstring is dataz{0:^10}z{0:>15s}z{0:date: %Y-%m-%d}�)ZyearZmonthZdayzdate: 2007-08-27z{0:.{1}}zhello world�r^z	{0:.{1}s}z{0:.{precision}s})�	precisionz{0:{width}.{precision}s})�widthrz
hello     �10�5z{az}azabc{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}rz{a{b}z{[}z0x{:0{:d}X}�Z0x0000000000000000z{!r}zM(data)z{!s}zN(data))rr��datetime�dictZdater�r(rArk�
IndexError�KeyError)rr&rsrrr
rr
rrrrZbig�m�nrrr	�test_format�s�

zUnicodeTest.test_formatcCs|�d�i�d�|�d�i�d�|�d�i�d�|�d�i�d�|�d�i�d�|�d�i�d	�|�d
�i�d�|�d�i�d
�Gdd�dt�}|�d�|��d�|�d�|dd��d�Gdd�d�}|�d�|��d�Gdd�d�}|�d�d|d�i�d�|�tdj�|�tdj�|�tdji�|�tdji�|�tdji�|�tdji�|�td ji�|�td!ji�|�td"jdd#i�|�td"jd�|�td$jd#d%d&��Gd'd(�d(�}|�tdji�|�tdjg�|�tdj|��dS))Nr6rNr�za{{za{za}}za}z{{bz{bz}}bz}bza{{bza{bc@seZdZdd�ZdS)z,UnicodeTest.test_format_map.<locals>.MappingcSs|S)Nr)r�keyrrr	�__missing__�sz8UnicodeTest.test_format_map.<locals>.Mapping.__missing__N)rrrr.rrrr	�Mapping�sr/z{hello}r^z{a} {world})rNzhello worldc@seZdZdd�Zdd�ZdS)z4UnicodeTest.test_format_map.<locals>.InternalMappingcSsddi|_dS)NrNr^)rz)rrrr	r��sz=UnicodeTest.test_format_map.<locals>.InternalMapping.__init__cSs
|j|S)N)rz)rr-rrr	�__getitem__�sz@UnicodeTest.test_format_map.<locals>.InternalMapping.__getitem__N)rrrr�r0rrrr	�InternalMapping�sr1z{a}c@seZdZddd�Zdd�ZdS)z&UnicodeTest.test_format_map.<locals>.CrXcSs
||_dS)N)r)rrqrrr	r��sz/UnicodeTest.test_format_map.<locals>.C.__init__cSs|S)Nr)rrrrr	r�sz1UnicodeTest.test_format_map.<locals>.C.__format__N)rX)rrrr�rrrrr	r�s
rz{foo._x}r�rrrrz{az}az{}rRz{a} {}rP)rNrOc@seZdZdd�ZdS)z/UnicodeTest.test_format_map.<locals>.BadMappingcSsddS)NrPrr)rr-rrr	r0sz;UnicodeTest.test_format_map.<locals>.BadMapping.__getitem__N)rrrr0rrrr	�
BadMappingsr2)r�
format_mapr'r(rArkr)�ZeroDivisionError)rr/r1rr2rrr	�test_format_map�s<zUnicodeTest.test_format_mapc	Cs4d�tjd�}|�t��td|�}WdQRXdS)Nz.{}frPg���Q�@)r�r9r�r(rk)r�
format_stringr!rrr	�test_format_huge_precisionsz&UnicodeTest.test_format_huge_precisionc	Cs4d�tjd�}|�t��td|�}WdQRXdS)Nz{}frPg���Q�@)r�r9r�r(rk)rr6r!rrr	�test_format_huge_widthsz"UnicodeTest.test_format_huge_widthc	Cs4d�tjd�}|�t��|�d�}WdQRXdS)Nz
{{{}:.6f}}rPg���Q�@)r�r9r�r(rk)rr6r!rrr	�test_format_huge_item_number"sz(UnicodeTest.test_format_huge_item_numbercCspGdd�d�}|�d�d�d�|�d�d�d�|�d	�d�d
�|�d�|d��d�|�d�d
dg�d�|�d�ddd��d�|�d�dd
�d�|�d�dd�d�|�d�dd�d�|�tdjd
d�|�td jd
d�|�td!jd
d�|�td"jd
d�|�d#jdd$d%�d&�|�d'jdd$d%�d(�|�d)jd
d*d+dd,�d-�|�d.jddd
d+d/�d0�dS)1Nc@seZdZddd�Zdd�ZdS)z1UnicodeTest.test_format_auto_numbering.<locals>.CrXcSs
||_dS)N)r)rrqrrr	r�)sz:UnicodeTest.test_format_auto_numbering.<locals>.C.__init__cSs|S)Nr)rrrrr	r+sz<UnicodeTest.test_format_auto_numbering.<locals>.C.__format__N)rX)rrrr�rrrrr	r(s
rz{}rSrz{:5}r�zs    z{!r}z's'z{._x}z{[1]}rPrRr�z{[a]}r])rNrO�4za{}b{}crZa0b1cza{:{}}brqz^10za    x     bza{:{}x}brr#Za0x14bz{}{1}z{1}{}z{:{1}}z{0:{}}z{f}{}�test)�fZtest4z{}{f}Z4testz{:{f}}{g}{}rL�g)r=r<z 1g3z{f:{}}{}{g})r<r=z 14g)rr�r(rk)rrrrr	�test_format_auto_numbering's$z&UnicodeTest.test_format_auto_numberingcCstj�|�|�ddd�|�ddd�|�ddd�|�dd	d
�|�ddd�|�dd
d�tj�d�s�|�ddd�|�ddd�|�ddd�|�dddd�d�|�dddd�d�|�dd d!�|�dd"d#�|�tdj	d$�|�dd#d#�|�t
dj	d%�|�td&j	d'�|�t
d(j	d%�|�d)d*did+�|�d)d*did+�|�d)d*did+�|�d)d*did+�|�d)dd,d-�d+�|�d)dd,d-�d+�|�d.d/d0�|�d1d/d2�|�d3dd+�|�d4d5d6�|�d4d7d8�|�d9d:d;�|�d9d<d6�|�d=d>d?�|�d@dAdB�|�ddCdC�GdDdE�dE�}|�dF|�d!�tdG�}tdH�}|�dI|dG�|�dJ|dK�|�dI|dH�|�dJ|dL�|�dMdNdC�|�dOdNdP�GdQdR�dR�}GdSdT�dT�}|dU�}|dV�}|�dWdXdY�|�dZd[d\�|�d]d^d_�|�ddVd`�|�dW|da�|�dZ|db�|�d]|dc�|�d|d`�|�
t
ddtjdWde�f|�
t
dftjdZdg�f|�
t
dhtjd]di�f|�
t
djtjdW|�f|�t
tjd|�fdS)kNz%s, %s)r.r.zabc, abcz%s, %s, %i, %f, %5.2f)r.r.rPrRrLzabc, abc, 1, 2.000000,  3.00)r.r.rP���rLzabc, abc, 1, -2.000000,  3.00)r.r.rQr?g@zabc, abc, -1, -2.000000,  3.50)r.r.rQr?g��(\�@zabc, abc, -1, -2.000000,  3.57)r.r.rQr?g�(\�\�@z abc, abc, -1, -2.000000, 1003.57r-z%r, %r)sabcr.z
b'abc', 'abc'z%r)uሴu'ሴ'z%az'\u1234'z%(x)s, %(y)sr.r\)rqr�zabc, defu
%(x)s, %(ü)s)rqr�z%ci4uሴi�u𡒃)iZaau%.1ဲfgUUUUUU�?z%iz
...%(foo)s...r�z	...abc...r)r�r\z...%s...%s...%s...%s...)rPrRrLr.z...1...2...3...abc...z"...%%...%%s...%s...%s...%s...%s...z...%...%s...1...2...3...abc...z...%s...z%*s)rr.z  abc)���r.zabc  z%*.*s)rrRr.z   ab)rrLr.z%i %*.*s)rSrrLr.z10   abcz
%i%s %*.*s)rSrLrrLr.z	103   abcrNc@seZdZdd�ZdS)z,UnicodeTest.test_formatting.<locals>.WrappercSsdS)Nuሴr)rrrr	r�osz4UnicodeTest.test_formatting.<locals>.Wrapper.__str__N)rrrr�rrrr	�WrappernsrAz%s�nan�infz%fz%F�NAN�INFz%.1suaé€z%.2suaéc@s$eZdZdd�Zdd�Zdd�ZdS)z.UnicodeTest.test_formatting.<locals>.PseudoIntcSst|�|_dS)N)r��value)rrFrrr	r��sz7UnicodeTest.test_formatting.<locals>.PseudoInt.__init__cSs|jS)N)rF)rrrr	�__int__�sz6UnicodeTest.test_formatting.<locals>.PseudoInt.__int__cSs|jS)N)rF)rrrr	�	__index__�sz8UnicodeTest.test_formatting.<locals>.PseudoInt.__index__N)rrrr�rGrHrrrr	�	PseudoInt�srIc@seZdZdd�Zdd�ZdS)z0UnicodeTest.test_formatting.<locals>.PseudoFloatcSst|�|_dS)N)�floatrF)rrFrrr	r��sz9UnicodeTest.test_formatting.<locals>.PseudoFloat.__init__cSs
t|j�S)N)r�rF)rrrr	rG�sz8UnicodeTest.test_formatting.<locals>.PseudoFloat.__int__N)rrrr�rGrrrr	�PseudoFloat�srKgo���!	@�mz%xrZ2az%X�rz%or[Z11r*Z6dZ6DZ155z,%x format: an integer is required, not floatg��Q�	@z,%X format: an integer is required, not floatg�z�G�@z,%o format: an integer is required, not floatg�p=
ף�?z2%x format: an integer is required, not PseudoFloat)rr��test_formattingrr9r:r;r(r��__mod__rArkrJ�assertRaisesRegex�operator�mod)rrArDrErIrKZpiZletter_mrrr	rNEs~zUnicodeTest.test_formattingc
Csddl}Gdd�dt|j�}Gdd�d|j�}Gdd�dt|j�}|�d|j|jfd	�|�d
|j|j|j|j|j|j|jfd�|�dd
|jid�|�dd
|jid�|�dd
|jid�|�dd
|jid�|�d|j|jd�d�|�d|jdd�d�dS)Nrc@seZdZdZdS)z4UnicodeTest.test_formatting_with_enum.<locals>.FloatgJ�M�!	@N)rrr�PIrrrr	�Float�srTc@seZdZdZdS)z2UnicodeTest.test_formatting_with_enum.<locals>.IntrMN)rrr�IDESrrrr	�Int�srVc@seZdZdZdS)z2UnicodeTest.test_formatting_with_enum.<locals>.Strr.N)rrrr$rrrr	�Str�srWz%s, %szStr.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...rz...3.141593...)	�enumrJ�Enum�IntEnumrrr$rUrS)rrXrTrVrWrrr	�test_formatting_with_enum�s.z%UnicodeTest.test_formatting_with_enumc	Cs2d�tjd�}|�t��|d}WdQRXdS)Nz%.{}frPg���Q�@)r�r9r�r(rk)rr6r!rrr	�test_formatting_huge_precision�sz*UnicodeTest.test_formatting_huge_precisioncCs(Gdd�dt�}|�d|d�d�dS)Nc@seZdZdd�ZdS)zBUnicodeTest.test_issue28598_strsubclass_rhs.<locals>.SubclassedStrcSs
d�|�S)Nz'Success, self.__rmod__({!r}) was called)r�)r�otherrrr	�__rmod__�szKUnicodeTest.test_issue28598_strsubclass_rhs.<locals>.SubclassedStr.__rmod__N)rrrr^rrrr	�
SubclassedStr�sr_z	lhs %% %rZrhsz.Success, self.__rmod__('lhs %% %r') was called)rr)rr_rrr	�test_issue28598_strsubclass_rhs�sz+UnicodeTest.test_issue28598_strsubclass_rhsc	Cs<ddlm}d�|d�}|�t��|d}WdQRXdS)Nr)�INT_MAXz%.{}frPg���Q�@)�	_testcapirar�r(rk)rrar6r!rrr	�'test_formatting_huge_precision_c_limits�sz3UnicodeTest.test_formatting_huge_precision_c_limitsc	Cs2d�tjd�}|�t��|d}WdQRXdS)Nz%{}frPg���Q�@)r�r9r�r(rk)rr6r!rrr	�test_formatting_huge_width�sz&UnicodeTest.test_formatting_huge_widthc
Cs\xVdjdjfD]F}|�t��}|dg�WdQRXt|j�}|�d|�|�d|�qWdS)Nr�r<r�tuple)r;�endswithr(rAr�	exceptionr�)rr��cm�excrrr	�test_startswith_endswith_errors�s
z+UnicodeTest.test_startswith_endswith_errors�LC_ALL�de_DE�fr_FRcCs|�ddd�dS)Nz1.0z%.1fg�?)r)rrrr	�test_format_float�szUnicodeTest.test_format_floatcCsf|�td�d�xddD]\}t|�}|�t|�|�|�t|�t|��|dkr|�|�d�d�|�|�d�d�qW|�td�d�Gdd�d�}|�t|d	��d	�|d
�}|�t|�d
�|�t|�d
�x$dD]}|�t|�tt|���q�Wtj�d��s|�t	td
dd�|�tddd�d�tj�d��sP|�tt
d�dd�d�|�t	tddd�dS)Nzunicode remains unicode)r<ruu€u􏿿r<sasciizutf-8z strings are converted to unicodec@seZdZdd�Zdd�ZdS)z2UnicodeTest.test_constructor.<locals>.StringCompatcSs
||_dS)N)rq)rrqrrr	r��sz;UnicodeTest.test_constructor.<locals>.StringCompat.__init__cSs|jS)N)rq)rrrr	r��sz:UnicodeTest.test_constructor.<locals>.StringCompat.__str__N)rrrr�r�rrrr	�StringCompat�sroz)__str__ compatible objects are recognizedz#unicode(obj) is compatible to str())rg������^@rr-z!decoding unicode is not supportedrsstrings are decoded to unicodezstrings are decoded to unicodes(character buffers are decoded to unicodez(character buffers are decoded to unicoder)rrr�lenrr9r:r;r(rA�
memoryview)rr�subclassro�o�objrrr	�test_constructor�sP



zUnicodeTest.test_constructorcCsR|�tdd�d�|�tddd�d�|�tddd�d�|�tddd�d�d	S)
z>Pass various keyword argument combinations to the constructor.r�)r"sfoozutf-8)r"rr)r)r"rN)rr)rrrr	�test_constructor_keyword_args)sz)UnicodeTest.test_constructor_keyword_argscCsT|�t�d�|�tdd�d�d�d�}|�t|dd�d�|jtt|dd�dS)	z(Check the constructor argument defaults.r6r)r�¢zutf-8r<)rN)rrrr(�UnicodeDecodeError)rZ	utf8_centrrr	�test_constructor_defaults2s

z%UnicodeTest.test_constructor_defaultscCs�dddddddddd	d
dd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�dd�d�d}d}x>|D]6}|�|�d�|�d��|�|�d��d�|��qWx&|D]}|�|�d��d�|��qZWdS) N)uA≢Α.s	A+ImIDkQ.)u
Hi Mom -☺-!sHi Mom -+Jjo--!)u	日本語s
+ZeVnLIqe-)uItem 3 is £1.sItem 3 is +AKM-1.)�+s+-)z+-s+--)z+?s+-?)z\?s+AFw?)z\\?s+AFwAXA?)z\\\?s
+AFwAXABc?)z++--s+-+---)u򫳞s+2m/c3g-)�/�/zutf-7u�s+2AE-u�xs+2AE-xu�s+3AE-u�xs+3AE-xu�򫳞s
+2AHab9ze-s+�r�r6zGABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'(),-./:?z!"#$%&*;<=>@[]^_`{|}�utf7r<)rrr)rZutfTestsrqr�Zset_dZset_orprrr	�test_codecs_utf7=sD

zUnicodeTest.test_codecs_utf7cCs�|�d�d�d�|�d�d�d�|�d�d�d�|�d�d�d	�|�d
�dd�d�|�d
�dd�d�|�d�d�d�|�d�d�d�|�td	d�d�|�tdd�d�|�tdd�d�dS)Nr6zutf-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)rrr)rrrr	�test_codecs_utf8ls
zUnicodeTest.test_codecs_utf8cCsBddddddddd	d
dg}x"|D]\}}|�|�d�|�q WdS)
N)�r�)�arN)��)s€�€)s߿u߿)sࠀuࠀ)s퟿u퟿)su)s￿u￿)s𐀀u𐀀)s􏿿u􏿿zutf-8)rr)r�	sequencesr��resrrr	� test_utf8_decode_valid_sequences�sz,UnicodeTest.test_utf8_decode_valid_sequencesc
CsDdd�tdd�D�}dd�tdd�D�}dd�tdd	�D�}|||d
d�tdd�D�}x|D]}|�t|jd
�qbWx.|D]&}x |D]}|�t||jd
�q�Wq�WxT|D]L}xF|dd�D]6}x0|dd�D] }	|�t||d|	jd
�q�Wq�Wq�WxNdd�tdd�D�D]6}|�td|djd
�|�td|djd
��qWxNdd�tdd�D�D]6}|�td|djd
�|�td|djd
��qfWxNdd�tdd�D�D]6}|�td|djd
�|�td|djd
��q�WxNdd�tdd�D�D]6}|�td|djd
�|�td|djd
��qWdS)NcSsg|]}t|g��qSr)r�)�.0rqrrr	�
<listcomp>�szBUnicodeTest.test_utf8_decode_invalid_sequences.<locals>.<listcomp>��cSsg|]}t|g��qSr)r�)r�rqrrr	r��s��cSsg|]}t|g��qSr)r�)r�rqrrr	r��s��cSsg|]}t|g��qSr)r�)r�rqrrr	r��s�r7zutf-8rL��cSsg|]}t|g��qSr)r�)r�rqrrr	r��s�����cSsg|]}t|g��qSr)r�)r�rqrrr	r��s��cSsg|]}t|g��qSr)r�)r�rqrrr	r��s���s��s��cSsg|]}t|g��qSr)r�)r�rqrrr	r��s��)r@r(rxr)
rZcontinuation_bytesZinvalid_2B_seq_start_bytesZinvalid_4B_seq_start_bytesZinvalid_start_bytes�byteZsb�cbZcb1Zcb3rrr	�"test_utf8_decode_invalid_sequences�sD 



"z.UnicodeTest.test_utf8_decode_invalid_sequencesc?Csd}d|fd|dfd|fd|dfd|fd|dfd	|dfd
|fd|dfd|d
fd|dfd|fd|dfd|d
fd|dfd|fd|dfd|d|fd|dfd|dfd|ddfd|d|fd|fd|dfd|d
fd |dfd!|d"fd#|fd$|fd%|dfd&|dfd'|dfd(|d|fd)|d|dfd*|d|dfd+|d|fd,|d|fd-|d|dfd.|ddfd/|d|dfd0|fd1|dfd2|dfd3|d
fd4|dfd5|ddfd6|dd|fd7|d|ddfd8|fd9|dfd:|dfd;|ddfd<|d"fd=|fd>|dfd?|d
fd@|dAfdB|fdC|d
fdDdEdFdGg?}xxt|�D]l\}\}}|�t|jdHdI�|�|�dHdJ�|�|�|dK�dHdJ�|dL�|�|�dHdM�|�ddN���q�WdS)ONu�r�s��rR��s����s��s����s��s���rLs�Ar���s��s���s����r]s�s�As�A�s�AAZAAs�As��As�A���s��s���s����s�����rs�s�s�As�AAs�As�A�s�A��s�A�As�AA�s�A�s�A��s��As�A����s��s��s���s����s��As��A�s�A��A��s��s��s��As�������s��s���s������r ��s���)s�ABCu�ABC)s�BCu��BC)s�Cu�C)s
a���b�c��dua���b�c��dzutf-8rr��brOr�r6)�	enumerater(rxrrr�)r�FFFDr�r+r�r�rrr	�test_issue8271�s�






























zUnicodeTest.test_issue8271c	Cs�|�t��}|�d�WdQRX|j}|�|t|��|�|�dd�|�|�d|d�dd�d|d�|�dd	�}|�|�dd
�|�|�d|d�dd
�d|d�dS)z�
        Check that an invalid UTF-8 sequence raises a UnicodeDecodeError when
        'strict' is used, returns res when 'replace' is used, and that doesn't
        return anything when 'ignore' is used.
        zutf-8Nr�saaaasbbbbZaaaaZbbbbu�r6r�)r(rxrrgr�rrr�)rr�r��errrhrirrr	�assertCorrectUTF8Decoding*sz%UnicodeTest.assertCorrectUTF8DecodingcCs*d}x dD]}|�t|g�dd�q
WdS)ah
        Test that an 'invalid start byte' error is raised when the first byte
        is not in the ASCII range or is not a valid start byte of a 2-, 3-, or
        4-bytes sequence. The invalid start byte is replaced with a single
        U+FFFD when errors='replace'.
        E.g. <80> is a continuation byte and can appear only after a start byte.
        u�s��������zinvalid start byteN)r�r�)rr�r�rrr	�test_invalid_start_byte=s
z#UnicodeTest.test_invalid_start_bytec&Cszddddddddd	d
ddd
ddddddddddddddddddd d!d"d#d$d%d&g&}d'}x |D]}|�t�|�d'd(�qZWd)S)*aa
        Test that an 'unexpected end of data' error is raised when the string
        ends after a start byte of a 2-, 3-, or 4-bytes sequence without having
        enough continuation bytes.  The incomplete sequence is replaced with a
        single U+FFFD when errors='replace'.
        E.g. in the sequence <F3 80 80>, F3 is the start byte of a 4-bytes
        sequence, but it's followed by only 2 valid continuation bytes and the
        last continuation bytes is missing.
        Note: the continuation bytes must be all valid, if one of them is
        invalid another error will be raised.
        ZC2ZDFzE0 A0zE0 BFzE1 80zE1 BFzEC 80zEC BFzED 80zED 9FzEE 80zEE BFzEF 80zEF BFzF0 90zF0 BFzF0 90 80zF0 90 BFzF0 BF 80zF0 BF BFzF1 80zF1 BFzF1 80 80zF1 80 BFzF1 BF 80zF1 BF BFzF3 80zF3 BFzF3 80 80zF3 80 BFzF3 BF 80zF3 BF BFzF4 80zF4 8FzF4 80 80zF4 80 BFzF4 8F 80zF4 8F BFu�zunexpected end of dataN)r�r��fromhex)rr�r�r�rrr	�test_unexpected_end_of_dataJs

z'UnicodeTest.test_unexpected_end_of_datac	Cszd}|d}d|dfd|dfd|fd|fd	|dfd
|dfd|fd|fg}x$|D]\}}|�t�|�|d
�qVWdS)a�
        Test that an 'invalid continuation byte' error is raised when the
        continuation byte of a 2-bytes sequence is invalid.  The start byte
        is replaced by a single U+FFFD and the second byte is handled
        separately when errors='replace'.
        E.g. in the sequence <C2 41>, C2 is the start byte of a 2-bytes
        sequence, but 41 is not a valid continuation byte because it's the
        ASCII letter 'A'.
        u�rRzC2 00r�zC2 7Fr�zC2 C0zC2 FFzDF 00zDF 7FzDF C0zDF FFzinvalid continuation byteN)r�r�r�)rr��FFFDx2r�r�r�rrr	�test_invalid_cb_for_2bytes_seqds
z*UnicodeTest.test_invalid_cb_for_2bytes_seqcMCs�d}|d}d|dfd|dfd|fd|fd	|fd
|fd|dfd|dfd
|fd|fd|dfd|dfd|fd|fd|dfd|dfd|fd|fd|dfd|dfd|fd|fd|dfd|dfd|fd|fd|dfd |dfd!|fd"|fd#|dfd$|dfd%|fd&|fd'|dfd(|dfd)|fd*|fd+|dfd,|dfd-|fd.|fd/|fd0|fd1|dfd2|dfd3|fd4|fd5|dfd6|dfd7|fd8|fd9|dfd:|dfd;|fd<|fd=|dfd>|dfd?|fd@|fdA|dfdB|dfdC|fdD|fdE|dfdF|dfdG|fdH|fdI|dfdJ|dfdK|fdL|fdM|dfdN|dfdO|fdP|fgL}x&|D]\}}|�t�|�|dQ��qnWdRS)Sa�
        Test that an 'invalid continuation byte' error is raised when the
        continuation byte(s) of a 3-bytes sequence are invalid.  When
        errors='replace', if the first continuation byte is valid, the first
        two bytes (start byte + 1st cb) are replaced by a single U+FFFD and the
        third byte is handled separately, otherwise only the start byte is
        replaced with a U+FFFD and the other continuation bytes are handled
        separately.
        E.g. in the sequence <E1 80 41>, E1 is the start byte of a 3-bytes
        sequence, 80 is a valid continuation byte, but 41 is not a valid cb
        because it's the ASCII letter 'A'.
        Note: when the start byte is E0 or ED, the valid ranges for the first
        continuation byte are limited to A0..BF and 80..9F respectively.
        Python 2 used to consider all the bytes in range 80..BF valid when the
        start byte was ED.  This is fixed in Python 3.
        u�rRzE0 00r�zE0 7Fr�zE0 80zE0 9FzE0 C0zE0 FFzE0 A0 00zE0 A0 7FzE0 A0 C0zE0 A0 FFzE0 BF 00zE0 BF 7FzE0 BF C0zE0 BF FFzE1 00zE1 7FzE1 C0zE1 FFzE1 80 00zE1 80 7FzE1 80 C0zE1 80 FFzE1 BF 00zE1 BF 7FzE1 BF C0zE1 BF FFzEC 00zEC 7FzEC C0zEC FFzEC 80 00zEC 80 7FzEC 80 C0zEC 80 FFzEC BF 00zEC BF 7FzEC BF C0zEC BF FFzED 00zED 7FzED A0zED BFzED C0zED FFzED 80 00zED 80 7FzED 80 C0zED 80 FFzED 9F 00zED 9F 7FzED 9F C0zED 9F FFzEE 00zEE 7FzEE C0zEE FFzEE 80 00zEE 80 7FzEE 80 C0zEE 80 FFzEE BF 00zEE BF 7FzEE BF C0zEE BF FFzEF 00zEF 7FzEF C0zEF FFzEF 80 00zEF 80 7FzEF 80 C0zEF 80 FFzEF BF 00zEF BF 7FzEF BF C0zEF BF FFzinvalid continuation byteN)r�r�r�)rr�r�r�r�r�rrr	�test_invalid_cb_for_3bytes_seqzsL
z*UnicodeTest.test_invalid_cb_for_3bytes_seqcuCs�d}|d}d|dfd|dfd|fd|fd	|fd
|fd|dfd|dfd
|fd|fd|dfd|dfd|fd|fd|dfd|dfd|fd|fd|dfd|dfd|fd|fd|dfd|dfd|fd|fd|dfd |dfd!|fd"|fd#|dfd$|dfd%|fd&|fd'|dfd(|dfd)|fd*|fd+|dfd,|dfd-|fd.|fd/|dfd0|dfd1|fd2|fd3|dfd4|dfd5|fd6|fd7|dfd8|dfd9|fd:|fd;|dfd<|dfd=|fd>|fd?|dfd@|dfdA|fdB|fdC|dfdD|dfdE|fdF|fdG|dfdH|dfdI|fdJ|fdK|dfdL|dfdM|fdN|fdO|dfdP|dfdQ|fdR|fdS|dfdT|dfdU|fdV|fdW|dfdX|dfdY|fdZ|fd[|dfd\|dfd]|fd^|fd_|fd`|fda|dfdb|dfdc|fdd|fde|dfdf|dfdg|fdh|fdi|dfdj|dfdk|fdl|fdm|dfdn|dfdo|fdp|fdq|dfdr|dfds|fdt|fdu|dfdv|dfdw|fdx|fgt}x&|D]\}}|�t�|�|dy��q�WdzS){at
        Test that an 'invalid continuation byte' error is raised when the
        continuation byte(s) of a 4-bytes sequence are invalid.  When
        errors='replace',the start byte and all the following valid
        continuation bytes are replaced with a single U+FFFD, and all the bytes
        starting from the first invalid continuation bytes (included) are
        handled separately.
        E.g. in the sequence <E1 80 41>, E1 is the start byte of a 3-bytes
        sequence, 80 is a valid continuation byte, but 41 is not a valid cb
        because it's the ASCII letter 'A'.
        Note: when the start byte is E0 or ED, the valid ranges for the first
        continuation byte are limited to A0..BF and 80..9F respectively.
        However, when the start byte is ED, Python 2 considers all the bytes
        in range 80..BF valid.  This is fixed in Python 3.
        u�rRzF0 00r�zF0 7Fr�zF0 80zF0 8FzF0 C0zF0 FFzF0 90 00zF0 90 7FzF0 90 C0zF0 90 FFzF0 BF 00zF0 BF 7FzF0 BF C0zF0 BF FFzF0 90 80 00zF0 90 80 7FzF0 90 80 C0zF0 90 80 FFzF0 90 BF 00zF0 90 BF 7FzF0 90 BF C0zF0 90 BF FFzF0 BF 80 00zF0 BF 80 7FzF0 BF 80 C0zF0 BF 80 FFzF0 BF BF 00zF0 BF BF 7FzF0 BF BF C0zF0 BF BF FFzF1 00zF1 7FzF1 C0zF1 FFzF1 80 00zF1 80 7FzF1 80 C0zF1 80 FFzF1 BF 00zF1 BF 7FzF1 BF C0zF1 BF FFzF1 80 80 00zF1 80 80 7FzF1 80 80 C0zF1 80 80 FFzF1 80 BF 00zF1 80 BF 7FzF1 80 BF C0zF1 80 BF FFzF1 BF 80 00zF1 BF 80 7FzF1 BF 80 C0zF1 BF 80 FFzF1 BF BF 00zF1 BF BF 7FzF1 BF BF C0zF1 BF BF FFzF3 00zF3 7FzF3 C0zF3 FFzF3 80 00zF3 80 7FzF3 80 C0zF3 80 FFzF3 BF 00zF3 BF 7FzF3 BF C0zF3 BF FFzF3 80 80 00zF3 80 80 7FzF3 80 80 C0zF3 80 80 FFzF3 80 BF 00zF3 80 BF 7FzF3 80 BF C0zF3 80 BF FFzF3 BF 80 00zF3 BF 80 7FzF3 BF 80 C0zF3 BF 80 FFzF3 BF BF 00zF3 BF BF 7FzF3 BF BF C0zF3 BF BF FFzF4 00zF4 7FzF4 90zF4 BFzF4 C0zF4 FFzF4 80 00zF4 80 7FzF4 80 C0zF4 80 FFzF4 8F 00zF4 8F 7FzF4 8F C0zF4 8F FFzF4 80 80 00zF4 80 80 7FzF4 80 80 C0zF4 80 80 FFzF4 80 BF 00zF4 80 BF 7FzF4 80 BF C0zF4 80 BF FFzF4 8F 80 00zF4 8F 80 7FzF4 8F 80 C0zF4 8F 80 FFzF4 8F BF 00zF4 8F BF 7FzF4 8F BF C0zF4 8F BF FFzinvalid continuation byteN)r�r�r�)rr�r�r�r�r�rrr	�test_invalid_cb_for_4bytes_seq�sxz*UnicodeTest.test_invalid_cb_for_4bytes_seqcCs|�d�d�d�dS)Nzwww.python.org.Zidnaswww.python.org.)rr)rrrr	�test_codecs_idnaszUnicodeTest.test_codecs_idnacCs�|�tdjd�|�tdjdd�|�d�dd�d�|�d�dd�d�|�d�dd�djddd��|�d�dd�djddd	��|�ttd
d�|�ttd
dd�|�td
dd�d�|�td
dd�d�|�td
dd�d�|�d�dd�d�|�tdjd�|�tdjd�|�ttdd�|�tdjd�|�tdjd�|�tdjddd�|�ttd�|�ttd�|�tt	d�|�tt	d�|�tt
d�|�tt
d�dS)NuAndr‚ xr<rr�sAndr xr�sAndr? x)r)rrsAndr� xzAndr xu	Andr� xs� xu� xs	\N{foo}xxzunicode-escapeZxx�\shelloz
test.unicode1z
test.unicode2r^ru�u�)r(�UnicodeErrorrrrrrArkr�rJ�complex)rrrr	�test_codecs_errorss4zUnicodeTest.test_codecs_errorscCs|�d�d�d�|�d�d�d�|�d�d�d�|�d�d�d�|�d�d�d�|�d�d�d	�|�d�d
�d�|�d��d�x^td
�D]R}t|�}xDdD]<}t���*t�dt�|�t|�|�|�|�WdQRXq�Wq�Wx@td�D]4}t|�}x&dD]}|�t|�|�|�|��q
Wq�WxBtd�D]6}t|�}x&dD]}|�t|�|�|�|��qLW�q:Wt���>t�dt�d}x&dD]}|�t|�|�|�|��q�WWdQRXd�	t
tttdd��ttdd����}x&dD]}|�t|�|�|�|��q�WdS)Nr^r<shellozutf-7zutf-8z	utf-16-les
helloz	utf-16-bes
hellozlatin-1u☃s☃i)zutf-7zutf-8zutf-16z	utf-16-lez	utf-16-be�raw_unicode_escape�unicode_escape�unicode_internalr�r7)zlatin-1r�)r<u𐀁𠀂𰀃񀀄񐀅)zutf-8zutf-16z	utf-16-lez	utf-16-ber�r�r�r6ri�i�i)zutf-8)rrr@r?r��catch_warningsr��DeprecationWarningrr=r>�list)rrp�urrrr	�test_codecs0s>

*
"
$

(
zUnicodeTest.test_codecscCsjttd��}x$dD]}|�t||��|�|�qWttdd��}x$dD]}|�t||��|�|�qFWdS)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�cp1258Zcp856�cp857�cp864�cp869Zcp874�	mac_greek�mac_iceland�	mac_roman�mac_turkishZcp1006�	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@rrr)rr�rrrr	�test_codecs_charmapgszUnicodeTest.test_codecs_charmapcCs@|�dd�|�dd�|�dd�|�dd�|�dd�dS)Nrrg)r)rrrr	�test_concatenation�s
zUnicodeTest.test_concatenationcCs�Gdd�d�}|�}td|d�tdd|d�tdd|d�tdd|d�td|d�tdd|d�tdd|d�td	|d�td	|d�dS)
Nc@seZdZdd�ZdS)z,UnicodeTest.test_printing.<locals>.BitBucketcSsdS)Nr)rrrrr	�write�sz2UnicodeTest.test_printing.<locals>.BitBucket.writeN)rrrr�rrrr	�	BitBucket�sr�r.)�filer\zabc
r')�endr�zdef
)�print)rr��outrrr	�
test_printing�szUnicodeTest.test_printingc
Cs�d}|�d��d�}|�||�d}|�d��d�}|�||�d}|�d��d�}|�||�yd�d�Wn>tk
r�}z |�|jd�|�|jd�Wdd}~XYnX|�d�dS)	Nu􀀀zraw-unicode-escapes
\U00100000s
\U00010000s
\U11111111rrSz%Should have raised UnicodeDecodeError)rrrrx�startr�Zfail)rrqr��errr	�	test_ucs4�s zUnicodeTest.test_ucs4cCs�Gdd�d�}Gdd�dt�}Gdd�dt�}|�t|��d�|�t|d��d�t|d��}|�|d	�|�t|�|�t|d��}|�|d	�|�t|�t�dS)
Nc@seZdZdd�ZdS)z0UnicodeTest.test_conversion.<locals>.ObjectToStrcSsdS)Nr�r)rrrr	r��sz8UnicodeTest.test_conversion.<locals>.ObjectToStr.__str__N)rrrr�rrrr	�ObjectToStr�src@seZdZdd�ZdS)z5UnicodeTest.test_conversion.<locals>.StrSubclassToStrcSsdS)Nr�r)rrrr	r��sz=UnicodeTest.test_conversion.<locals>.StrSubclassToStr.__str__N)rrrr�rrrr	�StrSubclassToStr�src@seZdZddd�Zdd�ZdS)z=UnicodeTest.test_conversion.<locals>.StrSubclassToStrSubclassr6cSst�|d|�S)NrR)r�__new__)�clsZcontentrrr	r�szEUnicodeTest.test_conversion.<locals>.StrSubclassToStrSubclass.__new__cSs|S)Nr)rrrr	r��szEUnicodeTest.test_conversion.<locals>.StrSubclassToStrSubclass.__str__N)r6)rrrrr�rrrr	�StrSubclassToStrSubclass�s
rr�rZfoofoo)rrr�r r)rrrrr�rrr	�test_conversion�szUnicodeTest.test_conversioncCsDGdd�d�}Gdd�d�}|�t|��d�|�t|��d�dS)Nc@seZdZdd�ZdS)z)UnicodeTest.test_unicode_repr.<locals>.s1cSsdS)Nz\nr)rrrr	r�sz2UnicodeTest.test_unicode_repr.<locals>.s1.__repr__N)rrrrrrrr	�s1�src@seZdZdd�ZdS)z)UnicodeTest.test_unicode_repr.<locals>.s2cSsdS)Nz\nr)rrrr	r�sz2UnicodeTest.test_unicode_repr.<locals>.s2.__repr__N)rrrrrrrr	�s2�srz\n)rrE)rrrrrr	�test_unicode_repr�szUnicodeTest.test_unicode_reprcCs(|�td�dd�|�td�d�dS)Nu𐀀z'%c')iu𔀀z'\U00014000')rrE)rrrr	�test_printable_repr�szUnicodeTest.test_printable_repr�Pr]z only applies to 32-bit platformscCs|�tdjtj�dS)Nzt	t	)r(r��
expandtabsr9r�)rrrr	�$test_expandtabs_overflows_gracefully�sz0UnicodeTest.test_expandtabs_overflows_gracefullycCsd}|�|��|�dS)Nr.)r�r)rr�rrr	�test_expandtabs_optimization�sz(UnicodeTest.test_expandtabs_optimizationcs�t�d�dkrd}d}nd}d}xtdD]l�t��}|dkrDd	}|}n|d
krVd}|}nd}|}tj||���fd
d�}|�t|�|�t|�q&WdS)Nrri�0�H��$)rNruu€u􏿿r7rPirRr]cs��S)Nrr)r��maxlenrr	�<lambda>	r�z0UnicodeTest.test_raiseMemError.<locals>.<lambda>)�struct�calcsizerwr9r�r(r�)rZascii_struct_sizeZcompact_struct_size�codeZ	char_sizeZstruct_sizeZallocr)r�rr	�test_raiseMemError�s&
zUnicodeTest.test_raiseMemErrorcCs>Gdd�dt�}|d�}|�d|d�|�d�|�d�dS)Nc@seZdZdd�ZdS)z+UnicodeTest.test_format_subclass.<locals>.ScSsdS)Nz__str__ overriddenr)rrrr	r�	sz3UnicodeTest.test_format_subclass.<locals>.S.__str__N)rrrr�rrrr	r�	sr��xxxz%sz__str__ overriddenz{})rrr�)rr�r�rrr	�test_format_subclass	sz UnicodeTest.test_format_subclasscCsXGdd�dt�}|�|d�|d�d�Gdd�dt�}|d�}|d7}|�|d�dS)Nc@seZdZdd�ZdS)z(UnicodeTest.test_subclass_add.<locals>.ScSsdS)Nr�r)rrsrrr	�__add__&	sz0UnicodeTest.test_subclass_add.<locals>.S.__add__N)rrrrrrrr	r�%	sr�r:rr�c@seZdZdd�ZdS)z(UnicodeTest.test_subclass_add.<locals>.ScSsdS)Nr�r)rrsrrr	�__iadd__*	sz1UnicodeTest.test_subclass_add.<locals>.S.__iadd__N)rrrrrrrr	r�)	sr�)rr)rr�r�rrr	�test_subclass_add$	szUnicodeTest.test_subclass_addcCs@d}|��}|�|d|�|�|d|�|�t|�d�dS)Nr.rrP)�__getnewargs__�assertIsNotrrp)rrr#rrr	�test_getnewargs0	s
zUnicodeTest.test_getnewargsc
Cs�x�tddd�D]v}d|d}t�dtf��R|�d�}|�|�d�|�|d7}|�d�}|�||�|�|�d�|�WdQRXqWdS)	NrPrXr!rNrOz*unicode_internal codec has been deprecatedr�rp)r@rr�r�rrrr+)r�lengthrr.rrrr	�test_resize7	s


zUnicodeTest.test_resizecCs�d}d|}d|}d|}d|}d|}d|}d|}d	|}	||||||||	f}
x�t�|
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�dS)NrSrNrrr�r&uĀu￿u􀀀u􏿿rR)�	itertools�combinationsrrrrr�)rrr<Zascii2�latin�latin2ZbmpZbmp2ZastralZastral2�stringsZtext1Ztext2ZequalZcopy1Zcopy2rrr	�test_compareH	svzUnicodeTest.test_comparecCs t�|tt�t�|tt�dS)N)rZcheck_free_after_iterating�iterr�reversed)rrrr	�test_free_after_iterating�	sz%UnicodeTest.test_free_after_iterating)mrrrrrxr%r,rDrFrKrVr`rdrjrmr{r~r�r�r�r��unittestZskipIfr9r�r�r�r�cpython_onlyr�r�r�r�r�r�r�Zrequires_resourcer�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�Z
skipUnlessr�r�rr,r5r7r8r9r>rNr[r\r`rcrdrjZrun_with_localernrurvryr~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr	r
rrr
rrrrr r"r(r+�
__classcell__rr)r�r	r2s�	**F;

		
'37W 	F	/%/Y
:O)77Jrc@s�eZdZdd�Zejdd��Zejdd��Zejdd��Zejd	d
��Z	ejdd��Z
ejd
d��Zejdd��Zejdd��Z
dS)�CAPITestc	s�t�d�ddlm}m�m}m}m}m}m	}m
}m}m}	m
}
m}d}t||����_��fdd����fdd�}
|
d	d
d���td�d
d�|
dd|d��|
dd|d����t���d|d��WdQRX|
dd|d�|d��|
dd�|
dd�|
dd�|
dd�|
d d!d"�|
d#d$d%�|
d&d'd(�d)��|
d*d+d,�|
d-d.d/�|
d0d1d,�|
d2d3d/�|
d4d5d/�|
d4d6d/�|
d4d7d/d�|
d&d8dd(�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�|
dRdNddO�|
dSdPddO�|
dTdQddO�|
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{��|
dd�d��|
d�d�d#d��|
d�d�dd��|
d�d�dd��|
dd�d"�|
d�d��|
d�d�|dW��|
d�d�d"�|
d�d��|
d�d�d��dS)�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_FromFormatcs$t�fdd�|D��}�|f|��S)Nc3s$|]}t|t�r�|�n|VqdS)N)�
isinstancer)r��arg)r2rr	�	<genexpr>�	szJCAPITest.test_from_format.<locals>.PyUnicode_FromFormat.<locals>.<genexpr>)re)r�r#Zcargs)�_PyUnicode_FromFormatr2rr	r=�	s

z7CAPITest.test_from_format.<locals>.PyUnicode_FromFormatcs�|f|��}��||�dS)N)r)Zexpectedr�r#r)r=rrr	�check_format�	sz/CAPITest.test_from_format.<locals>.check_formatuascii=unicodeés	ascii=%Uu	unicodeéz^^PyUnicode_FromFormatV\(\) expects an ASCII-encoded format string, got a non-ASCII byte: 0xe9$sunicode�=%sr<uꯍs%ciͫu􏿿i��iu𐀀􀀀s%c%cii�%�%s%%z%ss%%sz[%]s[%%]z%abcs%%%ssabcr.s%.3ssabcdefuabc[�s%.5suabc[€]�utf8z'\u20acABC's%Au€ABCz'\u20s%.5Au	€ABCDEFu'€ABC's%Ru'€As%.3Ru€ABs%.3Ss%.3Us%.3Vs%.5Vz
repr=  abcsrepr=%5Szrepr=abs	repr=%.2Sz
repr=   abs
repr=%5.2Sz
repr=   'abc'srepr=%8Rzrepr='abs	repr=%.3Rz
repr=  'abs
repr=%5.3Rsrepr=%8As	repr=%.3As
repr=%5.3Asrepr=%5ss	repr=%.2ss
repr=%5.2ssrepr=%5Us	repr=%.2Us
repr=%5.2Usrepr=%5Vs123s	repr=%.2Vs
repr=%5.2Vz
repr=  123zrepr=12z
repr=   12Z010s%03irSZ0010s%0.4iz-123s%ii����s%lis%llis%zis%ds%lds%llds%zdrvs%urs%lus%llus%zurRrirPs%prQr�s%010irXs%100is%.100i�Ps%100.80is%010us%100us%.100us%100.80us%010xi#s%100xs%.100xs%100.80xz%A:'abc\xe9\uabcd\U0010ffff's%%A:%Auabcéꯍ􏿿zrepr=abcsrepr=%Vsxyzurepr=人民s人民urepr=abc�sabc�s%1%sz%1abcs%1abcz%+is%+iz%.%ss%.%sr6r�s%s)r�
import_moduler0r1r2r3r4r5r6r7r8r9r:r;r<rZrestyperPrkr(r�rrr)rr1r3r4r5r6r7r8r9r:r;r<rrBZmin_longlongZmax_longlongZ
max_ulonglongr)r=rAr2rr	�test_from_format�	s\
8















zCAPITest.test_from_formatc	Cs:ddlm}t�d�ddlm}m}|dd�\}}|�|d�|�|d�|dd	�\}}|�|d	�|�|d�|dd
�\}}|�|d	�|�|d�|dd�\}}|�|d	�|�|d�|d
d�\}}|�|d�|�|d�td�}||�dk�rd	}d}nd}d}|||�\}}|�||�|�||d�dS)Nr)�unicode_aswidecharr0)�c_wcharr3rrRr�r.rLr]zabcrSzabcdefrr!zabcdefi��rPr�)	rbrIrrGr0rJr3rr?)	rrIrJr3�wcharr��nonbmp�buflen�ncharrrr	�test_aswidechar�
s6
zCAPITest.test_aswidecharcCs�ddlm}t�d�ddlm}m}|d�\}}|�|d�|�|d�|d�\}}|�|d	�|�|d
�td�}||�dkr�d}nd
}||�\}}|�||�|�||d�dS)Nr)�unicode_aswidecharstringr0)rJr3r.rLzabczabcdefr!zabcdefi��rRrPr�)	rbrPrrGr0rJr3rr?)rrPrJr3rKr�rLrNrrr	�test_aswidecharstring�
s 
zCAPITest.test_aswidecharstringcCsddlm}x�dD]�}t|�}|�|||d�|d�|�|||d�|d�|�|||dd�|d�|�|||dd�|d�|�t|||dd�|�t|||dd�d�||g�}|�||t|�d�|d�|�||t|�d�|d�qWdS)	Nr)�unicode_asucs4)r.u¡¢u你好ua😀u	a�b�cu��rPr�u￿u￿rR)rbrRrprr(�SystemErrorr=)rrRr��lrrr	�test_asucs4�
s
zCAPITest.test_asucs4c
Csxddlm}xbdD]Z}xTt|�D]H\}}|�||t|�dt|�d�|�|�||t|�dt|�d�|�q WqWd}|�||ddt|�d�d�|�||ddt|�d�d�|�||td�dt|�dd�d	�|�||td�dt|�dd�d	�|�||td�ddd�d�|�||td�t|�dd�d�|�||td�t|�dd�d�|�||td�t|�dd�d�dS)
Nr)�unicode_findchar)�¡u耀肀u��u🄀🇱rPrQz!>_<!ir�r])rbrVr�rrwrp)rrVrror�rrr	�
test_findchar�
s
 ($$ "zCAPITest.test_findcharc	Cs�ddlm}ddddg}x�t|�D]�\}}x*|d|�D]}|�t||d|dd�q8WxDtd�D]8}|�||d||d�|||d��dd�d|f�q`WxDtd�D]8}|�|||||d�|||d��dd�d|f�q�Wq"W|d}|�t	||d	|dd�|�t	||d
|dd�|�t	||d|d	d�|�t	||d|d
d�|�t||d|dd�|�t||d|dd
�|�t||dddd�dS)
Nr)�unicode_copycharactersZabcdeu
¡¢£¤¥u你好世界!u😀😁😂😃😄rr�r rQrPr�)
rbrYr�r(rSr@rr�rr()	rrYr'�idxZfrom_�toZ
from_startZto_startr�rrr	�test_copycharacters�
s6zCAPITest.test_copycharacterscCsbddlm}|�|d�d�|�|d�d�|�|d�d�|�t|d	d
�|�td|d	d�dS)
Nr)�unicode_encodedecimalrvs123u٣.١٤s3.14u
 3.14 s 3.14 u123€rz'^'decimal' codec can't encode characterr�)rbr]rr(�UnicodeEncodeErrorrPrk)rr]rrr	�test_encode_decimals



zCAPITest.test_encode_decimalcCsPddlm}|�|d�d�|�|d�d�|�|d�d�|�|d�d�dS)Nr)�unicode_transformdecimaltoasciirvu٣.١٤z3.14u
 3.14 u123€)rbr`r)rZtransform_decimalrrr	�test_transform_decimal)s



zCAPITest.test_transform_decimalcCs�ddlm}xndD]f}d}x\td�D]P}|t|�7}|�||�t|���|d�|�||�t|���|d�q$WqWdS)Nr)�getargs_s_hash)r�i� i
�r6rrP)rbrbr@r?rr)rrb�kr�rorrr	�test_pep393_utf8_caching_bug5s
 z%CAPITest.test_pep393_utf8_caching_bugN)rrrrHrr-rOrQrUrXr\r_rarerrrr	r/�	sp&*r/c@seZdZdd�Zdd�ZdS)�StringModuleTestcCs�dd�}|d�}|�|ddddg�|d�}|�|d	d
g�|d�}|�|dg�|d
�}|�|g�|d�}|�|dg�|�ttjd�dS)NcSstt�|��S)N)r��_string�formatter_parser)r�rrr	�parseHsz5StringModuleTest.test_formatter_parser.<locals>.parsez2prefix {2!s}xxx{0:^+10.3f}{obj.attr!s} {z[0]!s:10})zprefix r�r6r�)rr�z^+10.3fN)r6zobj.attrr6r�)r'zz[0]rr�zprefix {} suffix)zprefix r6r6N)z suffixNNNr)rNNNr6z{0})r6r�r6NrP)rr(rArgrh)rri�	formatterrrr	�test_formatter_parserGs(z&StringModuleTest.test_formatter_parsercCsvdd�}|�|d�dgg�|�|d�ddgg�|�|d�ddgg�|�|d�ddd	d
gg�|�ttjd�dS)NcSs"tt�|��}t|d�|d<|S)NrP)r�rg�formatter_field_name_split)r�itemsrrr	r}isz?StringModuleTest.test_formatter_field_name_split.<locals>.splitrtzobj.arg)Tr?zobj[key])Fr-zobj.arg[key1][key2])FZkey1)FZkey2rP)rr(rArgrl)rr}rrr	�test_formatter_field_name_spliths

z0StringModuleTest.test_formatter_field_name_splitN)rrrrkrnrrrr	rfFs!rf�__main__)�__doc__rg�codecsr#rQrr9r�r,r�r;rrr�registerrrrrUr�ZMixinStrUnicodeTestZTestCaserr/rfr�mainrrrr	�<module>sV

t23