
    <e                    v   d 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Zddl	Z	ddl
Z
ddlZddlmZ ddlmZmZ ddlmZ 	 ddlZn# e$ r dZY nw xY wd Zd Z G d d	e          Z G d
 dej        ej        ej        e
j                  Z G d de
j                  Zedk    r e
j                      dS dS )z Test script for the Unicode implementation.

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

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

    N)warnings_helper)supportstring_tests)assert_python_failurec                 V    dd}dd}dd}dd}| dk    r||d d fS | dk    r||d d fS d S )	Nstrictc                     dS N*    inputerrorss     (/usr/lib/python3.11/test/test_unicode.pydecode1z search_function.<locals>.decode1       r    c                     dS r
   r   r   s     r   encode1z search_function.<locals>.encode1    r   r   c                     dS N)r   r   r   r   s     r   encode2z search_function.<locals>.encode2"       xr   c                     dS r   r   r   s     r   decode2z search_function.<locals>.decode2$   r   r   test.unicode1test.unicode2)r   r   )encodingr   r   r   r   s        r   search_functionr      s                  $--	?	"	"$--tr   c                 N    |                                                                  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)texts    r   duplicate_stringr$   -   s     ;;==!!!r   c                       e Zd ZdS )StrSubclassN__name__
__module____qualname__r   r   r   r&   r&   7   s        Dr   r&   c                   8    e Zd ZeZd Zd Zd Zd Zd Z	d Z
d Zd Zd	 Zd
 Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Zd Z ej        ej        dk    d          d             Zd Ze j!        d             Z"d Z#d Z$d Z% fdZ& fdZ' fd Z( fd!Z) e j*        d"          d#             Z+ fd$Z, fd%Z- fd&Z.d' Z/ fd(Z0d) Z1d* Z2e j!        e j3         ej        e4d+u d,          d-                                     Z5d. Z6d/ Z7d0 Z8d1 Z9d2 Z:d3 Z; fd4Z<d5 Z=d6 Z> ej?        ej        d7k    d8          e j!        d9                         Z@d: ZAd; ZBd< ZCd= ZDd> ZEd? ZFd@ ZGdA ZHdB ZIdC ZJdD ZKdE ZLe j!         ej        e4d+u d,          dF                         ZMdG ZNdH ZO e jP        dIdJdK          dL             ZQdM ZRdN ZSdO ZTdP ZUdQ ZVdR ZWdS ZXdT ZYdU ZZdV Z[dW Z\dX Z]dY Z^dZ Z_d[ Z`d\ Zad] Zbd^ Zcd_ Zdd` Zeda Zfdb Zgdc Zh ej        ej        dk    p eijj        dd          dek    df          dg             Zke j!        dh             Zldi Zmdj Zndk Zodl Zpe j!        e j3         ej        e4d+u d,          dm                                     Zqdn Zrdo Zsdp Zt xZuS )qUnicodeTestc                     t          j        t                     |                     t           j        t                     d S N)codecsregisterr   
addCleanup
unregisterselfs    r   setUpzUnicodeTest.setUpA   s/    ((()?;;;;;r   c                    t          ||          } || }|                     ||           |                     t          |          t          |          u            ||u rb G d dt                    } ||          }t          ||          } || }|                     ||           |                     ||u           d S d S )Nc                       e Zd Zd ZdS ))UnicodeTest.checkequalnofix.<locals>.usubc                 <    dt                               |           z  S )Nzusub(%r))str__repr__r3   s    r   r;   z2UnicodeTest.checkequalnofix.<locals>.usub.__repr__O   s    %T(:(:::r   Nr(   r)   r*   r;   r   r   r   usubr8   N   s#        ; ; ; ; ;r   r=   )getattrassertEqual
assertTruetyper:   )r4   resultobject
methodnameargsmethod
realresultr=   s           r   checkequalnofixzUnicodeTest.checkequalnofixE   s    ,,VT]
V,,,Z((DLL8999 ; ; ; ; ;s ; ; ; T&\\FVZ00FJZ000OOF*455555  r   c                 V   |                      dd           |                      dd           |                     t          t          d           |                     t          t          d           |                     t          t          ddz             |                     dd           d S )	N   ÿ   ￿z'\Ufffffffe'z'\Uffffffff'z'\U%08x'   z\u0020 )r?   assertRaisesSyntaxErrorevalassertNotEqualr3   s    r   test_literalszUnicodeTest.test_literalsW   s    ***<000+t->???+t->???+t]X-EFFFIs+++++r   c           
      X   t           j                            d          s|                     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          }| 	                    t          t           |                       d S d S ) Njavaabc'abc'ab\c'ab\\c'ab\'ab\\'\c'\\c'\'\\'
'\n''\r'	'\t''\x08''"'\'"''"'""'"'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'    0  𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀𐀀￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿￿c                       e Zd Zd ZdS ))UnicodeTest.test_ascii.<locals>.WrongReprc                     dS Ns	   byte-reprr   r3   s    r   r;   z2UnicodeTest.test_ascii.<locals>.WrongRepr.__repr__       '<r   Nr<   r   r   r   	WrongReprrq      #        ( ( ( ( (r   ru   )sysplatform
startswithr?   asciijoinmapchrrangerN   	TypeErrorr4   
latin1reprtestreprru   s       r   
test_asciizUnicodeTest.test_ascii`   s\   |&&v.. '	=U5\\7333U7^^[999U6]]J777U5\\9555U4[[(333U4[['222U4[['222U4[['222U4[[)444U5\\<888U5\\<888U3ZZ333U3ZZ333  RWWSeCjj%9%9::;;HXz222U#FGG"#FGGI I I( ( ( ( ( ( ( ( i		<<<<<O'	= '	=r   c           
      X   t           j                            d          s|                     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          }| 	                    t          t           |                       d S d S ) NrT   rU   rV   rW   rX   rY   rZ   r[   r\   r]   r^   r_   r`   ra   rb   rc   rd   re   rf   rg   rh   ri   rj   rk   rl   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®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖ×ØÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿ'rm   rn   ro   c                       e Zd Zd ZdS )(UnicodeTest.test_repr.<locals>.WrongReprc                     dS rs   r   r3   s    r   r;   z1UnicodeTest.test_repr.<locals>.WrongRepr.__repr__   rt   r   Nr<   r   r   r   ru   r      rv   r   ru   )rw   rx   ry   r?   reprr{   r|   r}   r~   rN   r   r   s       r   	test_reprzUnicodeTest.test_repr   s\   |&&v.. '	<T%[['222T']]K888T&\\:666T%[[)444T$ZZ222T$ZZ111T$ZZ111T$ZZ111T$ZZ333T%[[,777T%[[,777T#YY	222T#YY	222  BGGCU3ZZ$8$899::HXz222T"EFF!"EFFH H H( ( ( ( ( ( ( ( iyy{{;;;;;O'	< '	<r   c                 B   d                                 }|                     t          |          d           |                     t          |          d           |                     t          |          d           |                     t          t          |           d S )N	   ᄑ∢㌳u   ᄑu   ∢u   ㌳)__iter__r?   nextrN   StopIteration)r4   its     r   test_iteratorszUnicodeTest.test_iterators   s    !**,,b8,,,b8,,,b8,,,-r22222r   c                    t          t          d                    t          t          d                    g}|D ]K}|                     |          5  |                     t          |           d d d            n# 1 swxY w Y   Ld S )NrU   u   🚀)cls)rA   itersubTestrN   r   )r4   casesr   s      r   test_iterators_invocationz%UnicodeTest.test_iterators_invocation   s    d5kk""Df$6$67 	2 	2C#&& 2 2!!)S1112 2 2 2 2 2 2 2 2 2 2 2 2 2 2	2 	2s   A;;A?	A?	c           
          g d}|D ]f}|                      |          5  |                     |d                    t          |                               d d d            n# 1 swxY w Y   gd S )NrU   u   🚀🚀🚀r   )stringrm   )r   r?   r{   r   )r4   r   cases      r   test_iterationzUnicodeTest.test_iteration   s    === 	< 	<DT** < <  rwwtDzz':':;;;< < < < < < < < < < < < < < <	< 	<s   7A""A&	)A&	c                     g d}|D ]o}|                      |          5  t          |          }t          |           |                     t          t
          |           d d d            n# 1 swxY w Y   pd S )Nr   r   )r   r   tuplerN   r   r   )r4   r   r   iterators       r   test_exhausted_iteratorz#UnicodeTest.test_exhausted_iterator   s    === 	A 	AD4(( A A::h!!-x@@@A A A A A A A A A A A A A A A	A 	As   A A++A/	2A/	c                    g d}|D ]}|                      |          5  t          t          j        dz             D ]}t	          |          }|                      |          5  d                    t          j        t          j        ||                              }|                     ||           d d d            n# 1 swxY w Y   	 d d d            n# 1 swxY w Y   d S )Nr   r      )protorm   )	r   r~   pickleHIGHEST_PROTOCOLr   r{   loadsdumpsr?   )r4   r   r   r   r   pickleds         r   test_pickle_iteratorz UnicodeTest.test_pickle_iterator   sf   === 	8 	8D4(( 8 8"6#:Q#>?? 8 8EdBE22 8 8"$''&,v|B7N7N*O*O"P"P((w7778 8 8 8 8 8 8 8 8 8 8 8 8 8 888 8 8 8 8 8 8 8 8 8 8 8 8 8 8	8 	8s7   AC#AC 	4C CCCCC	 C	c                 @   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   aaacountar   br   i   
   u   Ăaaaaaaaaaau   􀌄aaaaaaaaaau   􀌄ĂĂĂĂĂĂĂĂĂĂ   Ă
aaaaaaaaaa   􀌄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"   􀌄Ă_Ă_Ă_Ă_Ă_Ă_Ă_Ă_Ă_Ă_   Ă_   aĂ   a􀌄   Ă􀌄)r   
CommonTest
test_countrH   
checkequalr3   s    r   r   zUnicodeTest.test_count   s<   **4000Q555Q555Qw555Qw555Qw555Qwb999Qwc:::Qwa<<<Qwa===/#>>>3WcBBB8'8LLL8Wh7778Wl;;;='<@@@0'4@@@4gtDDD97INNN8Wi8888Wm<<<='3EFFFFFr   c                    t           j                            |            |                     dddd           |                     dddd           |                     dddd           |                     dddd           |                     dd	dd
           |                     dd	dd           |                     dd	dd           |                     dddd           |                     ddddd           |                     ddddd           |                     dddd           |                     ddddd           |                     dddddd           |                     dddd           |                     dddd           |                     ddddd           |                     dddddd           |                     ddddd           |                     dddddd           |                     ddddd           |                     dddd           |                     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Ăfindr   r      ȁ   Ġ   Ƞuh   aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa􀌄r      􀈄   􂀄r   abcdefghiabcrU   	   r   def      тестu   тr   e   тест тест   ес   r      echellor      ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂar     􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄a  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄Ădaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂ   ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂa_r     􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄a_  􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄Ă_r   r   r   r   )r   r   	test_findr   rH   rN   r   r   r3   s    r   r   zUnicodeTest.test_find   s   ))$///168DDD0&(CCC0&(CCC0&(CCC5v|LLL4flKKK4flKKKQ???QBBBRBBB 	:vt444:vtQ777Ja;;;J444.???.BBB.1EEE.BBB/AFFF/CCC/>>>)W\222)W\2666163???5vsCCC:FHMMMIvx888Iv|<<<NFLAAA2FDAAA6EEE;VYOOOIvy999Iv}===NF4FGGGGGr   c                    t           j                            |            |                     dddd           |                     dddd           |                     dddd           |                     dddd           |                     dd	dd
           |                     dd	dd           |                     dd	dd           |                     dddd           |                     dddd           |                     dddd           |                     dddd           |                     ddddd           |                     ddddd           |                     dddd           |                     dddd           |                     ddddd           |                     dddddd           |                     ddddd           |                     dddddd           |                     ddddd           |                     dddd           |                     dddd           |                     dddd           |                     dd dd           |                     dd!dd           |                     dd!dd
           |                     dd"dd
           |                     d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rfindr   r   r   r   r   uh   􀌄aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar   r   r   r   r   rU      rm   r   r   u   еr   r   r   r   r   r   r   r      aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂr     a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄  Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄r   r      _aĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂ_a  _a􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄  _Ă􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄􀌄   _Ă   Ăa   􀌄a   􀌄Ă)r   r   
test_rfindr   rH   r3   s    r   r   zUnicodeTest.test_rfind!  sd   **4000/'8DDD07HEEE07HEEE07HEEE3WlKKK4g|LLL4g|LLLQ.'5AAAR.'2>>>R2>>>:w555:wa888Jq999J555.@@@.CCC.AFFF.CCC/&!QGGG/&!DDD/$???/#>>>3WcBBB8'8LLLIw999Iw===NG\BBB0'4@@@4gtDDD97INNNIw	:::Iw>>>NG5GHHHHHr   c                    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   r   indexrm   r   r   rU   r   r   hibabcdefghiab	abcdefghighi   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   
test_indexrH   rN   
ValueErrorr   r   r3   s    r   r   zUnicodeTest.test_indexJ  s4   **4000Q"===Q%@@@Q%@@@Q%CCC*n&:EBBB*m&9E1EEE*k&7%CCC*k&7%DDD17C@@@5wDDD:GXNNN*y&7BBB*y&7FFF*~&<lKKK2GTBBB6FFF;WiPPP*y&7CCC*y&7GGG*~&<>PQQQQQr   c                    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 )!Nr   r   rindexrm   r   r   r   rU   r   r   r   	defghiabcr   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   )r   r   test_rindexrH   rN   r   r   r   r3   s    r   r   zUnicodeTest.test_rindexb  sY   ++D111RB???QEBBBQEBBBQE1bIII*n&;eDDD*k&85!DDD*k&85!RHHH*k&85!QGGG*k&85!RHHH/3???3XsCCC8(HMMM*y&8(CCC*y&8,GGG*~&=|LLL0(DAAA4hEEE98YOOO*y&8)DDD*y&8-HHH*~&=?QRRRRRr   c                    |                      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*}d+D ]D}t                              ||i          }d,|z  }|                     t          |j        |           E|                     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 )3Nbbbcabababc	translater   iiicr   iiiixcxrm   xyyxxzxzyyz<i>r   r   z
<i><i><i>crU   xyzdxyzzyabdcdcbddddz[a]Xz[X][]XXXz[XXX]   éu   [é]axb123x123u   xéu   <é>u   [<é>]z[123]u   [aé]u   <€>u	   [<€>é]rL   u
   aé€􏿿z[%s]defgr   r   xy)r   r   )
rH   ord	type2test	maketransr?   r   r:   rN   r   r   )r4   tblinvalid_charbeforemappingr#   s         r   test_maketrans_translatez$UnicodeTest.test_maketrans_translate|  s   VY!#hh-	/ 	/ 	/VY!#hhc#hhCA	C 	C 	CVY!#hhc#hhC#c((CP	R 	R 	RS)[!#hhc#hh;	= 	= 	=VUK!#hh-	/ 	/ 	/ 	Y	;!5\	+ 	+ 	+n&&T'>'>??\9k3GGGn&&ueS99Wm[#FFF 	sC)@)@AA	  	  	 Sz)B)BCC	  	  	 T{)C)CDD	 	 	U|)D)DEE 	" 	" 	"V})E)EFF!	# 	# 	#T7N7N)O)OPP	! 	! 	!T7O7O)P)PQQ 	" 	" 	" 	X)G)GHH#	% 	% 	%++CMM63-,H,HII	  	  	 ++CMM64.,I,IJJ	 	 	++CMM65/,J,JKK 	" 	" 	",,S]]C;L-M-MNN)	+ 	+ 	+ "- 	C 	CFmmV\$:;;GF?Dj$.'BBBB 	)T^%=>>>*dn&>vNNN)T^%=q%HHH)T^%=uaHHH)T^%=ueQOOO*dn&>q	JJJ)T^%=ayIII)W%6777)Y%8%GGGGGr   c           	         t           j                            |            dD ]\  }}|dz  }|dz  }dD ]}|                     ||z   g||z   d|           |                     ||g||z   |z   d|           |                     ||z   g||z   d|dz             |                     ||g||dz  z   |z   d|dz             d S )Nba   āĀ   𐌁𐌀r   r   r      𐌂splitr   )r   r   
test_splitr   r4   leftrightdelims       r   r"  zUnicodeTest.test_split  s,   **4000 J 	M 	MKD%AIDQJE6 M M $ugu> > >u $uu 4guF F F $uguqyB B Bu $uqy 05 8'5!8M M M MM	M 	Mr   c           	         t           j                            |            dD ]\  }}|dz  }|dz  }dD ]}|                     ||z   g||z   d|           |                     ||g||z   |z   d|           |                     ||z   g||z   d|dz             |                     ||g||dz  z   |z   d|dz             |                     ||z   g||z   dd            d S )N)r  u   юёr  r  r   )r   u   ыr   r   rsplitr   )r   r   test_rsplitr   r#  s       r   r)  zUnicodeTest.test_rsplit  sO   ++D111Q 	; 	;KD%AIDQJE< N N $uh? ? ?u $uu 4hG G G $uh	C C Cu $uqy 05 8(E1HN N N N OOTE\N!E\8T; ; ; ;	; 	;r   c           	         t           j                            |            |                     dddd           dD ]\  }}|dz  }|dz  }dD ]}|                     ||z   ddf||z   d|           |                     |||f||z   |z   d|           |                     ||z   ddf||z   d|d	z             |                     ||d	z  |f||d	z  z   |z   d|d	z             d S )
N)ABCDEFGHrm   rm   r+  	partition   䈀r  r   r  rm   r   )r   MixinStrUnicodeUserStringTesttest_partitionr   r#  s       r   r/  zUnicodeTest.test_partition  sY   2AA$GGG,j+xPPPI 	R 	RKD%AIDQJE6 R Rr2 6 $uk5B B Bue 4 $uu 4k5J J Jr2 6 $uk519F F Fuqy% 8 $uqy 05 8+uqyR R R RR	R 	Rr   c           	         t           j                            |            |                     dddd           dD ]\  }}|dz  }|dz  }dD ]}|                     dd||z   f||z   d|           |                     |||f||z   |z   d|           |                     dd||z   f||z   d|d	z             |                     ||d	z  |f||d	z  z   |z   d|d	z             d S )
N)rm   rm   r+  r+  
rpartitionr-  r  r   r  rm   r   )r   r.  test_rpartitionr   r#  s       r   r2  zUnicodeTest.test_rpartition  sZ   2BB4HHH,j,QQQI 	S 	SKD%AIDQJE6 S SR 6 $ulEC C Cue 4 $uu 4lEK K KR 6 $ulEAIG G Guqy% 8 $uqy 05 8,PQ	S S S SS	S 	Sr   c           
      *   t           j                            |             G d d          }|                     dddg d           |                     dddd           |                     d	ddt          j        d
                     |                     dddg d           |                     dddg d           |                     dddd           |                     d	ddt          j        d
                     |                     t          dddd |d          g           |                     t          dddddt                      g           |                     t          ddg d           |                     t          ddg d           d S )Nc                       e Zd Zd Zd ZdS )(UnicodeTest.test_join.<locals>.MyWrapperc                     || _         d S r.   sval)r4   r8  s     r   __init__z1UnicodeTest.test_join.<locals>.MyWrapper.__init__  s    $diiir   c                     | j         S r.   r7  r3   s    r   __str__z0UnicodeTest.test_join.<locals>.MyWrapper.__str__  s	    di/r   Nr(   r)   r*   r9  r;  r   r   r   	MyWrapperr5    s"        666/////r   r=  za b c drM   r{   )r   r   r   r  abcdrm   zw x y zwxyz12foo3)r   r   r   )r@  rA  r   )r   r.  	test_joinrH   Sequencecheckraisesr   bytes)r4   r=  s     r   rD  zUnicodeTest.test_join	  s   2<<TBBB	0 	0 	0 	0 	0 	0 	0 	0
 	YV5I5I5IJJJVR1EFFFYV\5J65R5RSSSYV5I5I5IJJJYV5I5I5IJJJVR1EFFFYV\5J65R5RSSSC#sIIe<L<L1MNNNC#sC1IJJJC;;;C?????r   l        z*needs too much memory on a 64-bit platformc                     t          t          j        dz            dz   }d|z  f|z  }|                     t          dj        |           d S )Ng      ?r   Arm   )intrw   maxsizerN   OverflowErrorr{   )r4   sizeseqs      r   test_join_overflowzUnicodeTest.test_join_overflow  sM     3;#$$q(Tzmd"-#66666r   c           
         t           j                            |            |                     dddddd           |                     t
          dj        dd           d	D ]\  }}|d
z  }|d
z  }dD ]}dD ]}|                     ||z   ||z   d||           |                     ||z   |z   ||z   |z   d||           |                     ||z   ||z   d|dz  |           |                     ||z   |z   ||dz  z   |z   d|dz  |           d S )Nzone@two!three!zone!two!three!replace!@r   rr   r  r   r  )r  u   ău   𐌃r   )r   r   test_replacerH   rN   r   rQ  r   )r4   r$  r%  r&  repls        r   rU  zUnicodeTest.test_replace$  s   ,,T222 	-/?CQTVWXXX)Y%6R@@@I 	@ 	@KD%AIDQJE6 @ @9 
@ 
@DOOD5L$(5L)UDJ J JOOD4K%$7$(5L5$8$-ud< < < OOD5L$(5L)UQYN N NOOD4K%$7$(519$4u$<$-uqy$@ @ @ @
@@	@ 	@r   c                 b    d}d}|                      |                    ||          |           d S )NrU   zabc def)assertIsrQ  )r4   patternr#   s      r   test_replace_idzUnicodeTest.test_replace_id;  s4    dll7G44d;;;;;r   c                 f   d}d}|                      t          |          t          |                     |                     t          |          t          |                     |                     t          |          t          |dz                       |                     t          |          t          |dz                       |                      t          |          t          |dz                       |                      t          |          t          d|z                       |                     t          |          t          |dz                        G d dt                    } |d	          }|                      t          |          t          |                     |                     t          |          t          |dz                       |                     t          |          t          |dz                       |                     t          |          t          |dz                       |                     t          |          t          d|z                       |                     t          |          t          |dz                       d S )
Nz123abc1@z456zyx-+r   r   r   c                       e Zd ZdS )5UnicodeTest.test_repeat_id_preserving.<locals>.SubStrNr'   r   r   r   SubStrr^  L          Dr   r_  zqwerty())r?   idrQ   r:   )r4   r   r   r_  ss        r   test_repeat_id_preservingz%UnicodeTest.test_repeat_id_preservingA  s/   A1&&&BqEE2a55)))BqEE2a"f::...BqEE2a!e99---A1q5		***A1q5		***BqEE2a!e99---	 	 	 	 	S 	 	 	 F:A1&&&BqEE2a"f::...BqEE2a!e99---BqEE2a!e99---BqEE2a!e99---BqEE2a!e99-----r   c                    t          j                    5  t          j        dt                     |                     ddk    d           |                     ddk    d           |                     dt          d          k    d           |                     dt          d          k    d           d d d            d S # 1 swxY w Y   d S )NignorerU      abcFT)r   check_warningswarningssimplefilterBytesWarningr?   	bytearrayr3   s    r   test_bytes_comparisonz!UnicodeTest.test_bytes_comparisonW  s   +-- 	? 	?!(L999Uf_e444Uf_d333Ui&7&77???Ui&7&77>>>	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	? 	?s   BB>>CCc                                            dd                                ddk                                    ddk                	                      dd	k                d S )
NrU   r>  r   r      €u   c                 :                         | |k                d S r.   )r@   )rb  s2r4   s     r   
test_lecmpz/UnicodeTest.test_comparison.<locals>.test_lecmpo  s    B'''''r   c                    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   u   u   u   u   u   u   u   u      u   ｡r   )rb  rp  
test_fixuprq  s     r   rt  z/UnicodeTest.test_comparison.<locals>.test_fixupr  s   #
1b!!!#
1b!!!#
1b!!!#
1b!!!#
1b!!!#
1b!!!#
1b!!!#
1b!!!#
1b!!!#
1b!!!#
1b!!!#
1b!!!#
1b!!!#
1b!!!#
1b!!!#
1b!!!
8$$$
8$$$$$r   u   )r?   r@   )r4   rt  rq  s   `@@r   test_comparisonzUnicodeTest.test_comparison_  sl    &&&''''''0	%f 	788888r   c                    t                                                       |                     ddd           |                     d                                           |                     d                                           |                     d                                           |                     d                                           |                     d                                           |                     d	                                           |                     d
                                           |                     d                                           d S )NF   ῼislower   Ⅷ   ⅷ   𐐁   𐐧   𐐩   𐑎   🐍   👯)supertest_islowerrH   assertFalserx  r@   r4   	__class__s    r   r  zUnicodeTest.test_islower  s1   UHi888))++,,,((**+++--//000--//000,,..///,,..///--//000--//00000r   c                 $   t                                                       t          j                            d          s|                     ddd           |                     d                                           |                     d                                           |                     d                                           |                     d                                           |                     d	                                           |                     d
                                           |                     d                                           |                     d                                           d S )NrT   Frw  isupperry  rz  r{  r|  r}  r~  r  r  )	r  test_isupperrw   rx   ry   rH   r@   r  r  r  s    r   r  zUnicodeTest.test_isupper  sI   |&&v.. 	=  )<<<((**+++))++,,,,,..///,,..///--//000--//000--//000--//00000r   c                    t                                                       |                     ddd           |                     ddd           |                     d                                           |                     d                                           dD ]=}|                     |                                d                    |                     >d S )	NTrw  istitleu   Greek ῼitlecases ...u   𐐁𐐩u   𐐧𐑎)r}  r~  r  r  z{!a} is not title)r  test_istitlerH   r@   r  r  formatr4   chr  s     r   r  zUnicodeTest.test_istitle  s    T8Y777T#>	JJJ 	.6688999.6688999J 	K 	KBRZZ\\+>+E+Eb+I+IJJJJ	K 	Kr   c                 R   t                                                       |                     ddd           |                     ddd           |                     ddd           dD ]=}|                     |                                d                    |                     >d S )	NTu    isspaceu    Fu   —r{  r|  r}  r~  r  r  z{!a} is not space.)r  test_isspacerH   r  r  r  r  s     r   r  zUnicodeTest.test_isspace  s    T8Y777T8Y777UHi888/ 	L 	LBRZZ\\+?+F+Fr+J+JKKKK	L 	Lr   cpuc                    t          t          j        dz             D ]i}t          |          }t	          j        |          }t	          j        |          }|                     |                                |dv p|dk               jd S )Nr   )WSBSZs)	r~   rw   
maxunicoder}   unicodedatabidirectionalcategoryr?   r  )r4   	codepointcharr  r  s        r   test_isspace_invariantz"UnicodeTest.test_isspace_invariant  s    s~122 	4 	4Iy>>D'5d;;M"+D11HT\\^^+/?? 2!)T!14 4 4 4		4 	4r   c                     t                                                       dD ]=}|                     |                                d                    |                     >d S )N)r{  r|  r}  r~     𝟶   𑁦   𐒠   🄇z{!a} is alnum.)r  test_isalnumr@   isalnumr  r  s     r   r  zUnicodeTest.test_isalnum  sg    K 	G 	GBOOBJJLL*:*A*A"*E*EFFFF	G 	Gr   c                 J   t                                                       |                     ddd           |                     d                                           |                     d                                           |                     d                                           |                     d                                           |                     d                                           |                     d	                                           d S )
NTrw  isalphar{  r|  r}  r~  r  r  )r  test_isalpharH   r@   r  r  r  s    r   r  zUnicodeTest.test_isalpha  s    T8Y777,,..///,,..///,,..///,,..///--//000--//00000r   c                     t                                                       |                     d                                           |                     d                                           d S )Nrn     􏿿)r  test_isasciir  isasciir  s    r   r  zUnicodeTest.test_isascii  s_    ))++,,,--//00000r   c                    |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      dd	d           |                      dd
d           |                      ddd           |                     t          ddd           dD ]=}|                     |                                d                    |                     >dD ]=}|                     |                                d                    |                     >d S )NFrm   	isdecimalr   T0   ①   ¼   ٠
01234567890123456789arU   r   )r{  r|  r}  r~  r  r     𑁥r  z{!a} is not decimal.)r  r  r  z{!a} is decimal.)rH   rF  r   r  r  r  r@   r4   r  s     r   test_isdecimalzUnicodeTest.test_isdecimal  sk   UB444UC555T3444UHk:::UFK888T8[999T<===UM;???E;;;;K 	P 	PBR\\^^-C-J-J2-N-NOOOO< 	K 	KBOOBLLNN,>,E,Eb,I,IJJJJ	K 	Kr   c                    t                                                       |                     ddd           |                     ddd           |                     ddd           dD ]=}|                     |                                d                    |                     >d	D ]=}|                     |                                d
                    |                     >d S )NTr  isdigitFr  r  )r{  r|  r}  r~  r  r  r  z{!a} is not a digit.)r  r  r  r  z{!a} is a digit.)r  test_isdigitrH   r  r  r  r@   r  s     r   r  zUnicodeTest.test_isdigit  s    T8Y777UFI666T8Y777= 	N 	NBRZZ\\+A+H+H+L+LMMMMJ 	I 	IBOOBJJLL*<*C*CB*G*GHHHH	I 	Ir   c                    |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      ddd           |                      dd	d           |                      dd
d           |                      ddd           |                     t          dj        d           dD ]=}|                     |                                d                    |                     >dD ]=}|                     |                                d                    |                     >d S )NFrm   	isnumericr   Tr  r  r  r  r  r  rU   r   r  z{!a} is not numeric.)r  r  r  r  r  z{!a} is numeric.)rH   rN   r   r  r  r  r@   r  s     r   test_isnumericzUnicodeTest.test_isnumeric  sl   UB444UC555T3444T8[999T6;777T8[999T<===UM;???)U_b999/ 	P 	PBR\\^^-C-J-J2-N-NOOOO/ 	K 	KBOOBLLNN,>,E,Eb,I,IJJJJ	K 	Kr   c                    |                      d                                           |                      d                                           |                      d                                           |                      d                                           |                      d                                           |                      d                                           |                      d                                           |                      d                                           |                     d	                                           |                     d
                                           |                     d                                           |                     d                                           d S )Nr   Z_b0bcb_   µu   𝔘𝔫𝔦𝔠𝔬𝔡𝔢rM   [   ©r  )r@   isidentifierr  r3   s    r   test_isidentifierzUnicodeTest.test_isidentifier!  sy   ((**+++((**+++((**+++))++,,,))++,,,))++,,,))++,,,6CCEEFFF))++,,,))++,,,**,,---))++,,,,,r   Nzneed _testcapi modulec                 V   d}|                      |                                           t          j                    5  t	          j        dt                     |                      t          j        |                                                     d d d            d S # 1 swxY w Y   d S )Nu   𝖀𝖓𝖎𝖈𝖔𝖉𝖊re  )	r@   r  r   rg  rh  ri  DeprecationWarning	_testcapiunicode_legacy_string)r4   us     r   test_isidentifier_legacyz$UnicodeTest.test_isidentifier_legacy0  s     +(()))+-- 	O 	O!(,>???OOI;A>>KKMMNNN	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	O 	Os   ABB"%B"c                    |                      d                                           |                      d                                           |                      d                                           |                     d                                           |                      d                                           |                     d                                           |                     d                                           |                      d                                           |                     d	                                           d S )
Nrm   rM   abcdefgzabcdefg
   ʹ   ͸   r  u   󠀠)r@   isprintabler  r3   s    r   test_isprintablezUnicodeTest.test_isprintable:  s   (()))))***	--//0000022333,,..///--//000--//0000022333113344444r   c           	         dD ]w}|                      |                                           |                     |                                           |                     |                                           xdD ]w}|                     |                                           |                      |                                           |                      |                                           xdD ]A}t          t          |          }dD ]'}|                      ||          |d|d           (BdD ]A}t          t          |          }dD ]'}|                      ||          |d|d           (Bd S )	N)   ab   ab	   aba	   aba)u   ABu   ABu	   ABAu	   ABA)rx  r  r  )r           .z() is False)r  r  r  r  r  r  r  r  )r  r  r  r  r  r  r  r  )r@   rx  r  r  r  r>   r:   )r4   rb  	meth_namemeths       r   test_surrogateszUnicodeTest.test_surrogatesI  s   8 	* 	*AOOAIIKK(((QYY[[)))QYY[[))))8 	) 	)AQYY[[)))OOAIIKK(((OOAIIKK((((: 	O 	OI3	**DI O O  a999*MNNNNO9 	O 	OI 3	**D< O O   a999*MNNNNO		O 	Or   c                    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 )Nr|     𐑏   𐐧𐐧   𐑏𐑏   𐐧𐑏
   X𐐧x𐑏u
   x𐑏x𐑏   ﬁ   İ   i̇   Σ   σ   ͅΣu   ͅσ   AͅΣu   aͅς   AͅΣau   aͅσa   AΣͅu   aςͅ   Σͅ u   σͅ    򏿾rz  )r   r   
test_lowerr?   lowerr3   s    r   r  zUnicodeTest.test_lowerd  s-   **4000++--|<<</5577/	1 	1 	1/5577/	1 	1 	1177991	3 	3 	3...))>:::))8444--//@@@..00/BBB)//113CDDD..00/BBB..00/BBB..00/BBB++--|<<<))844444r   c                 6   |                      d                                d           |                      d                                d           |                      d                                d           |                      d                                d           |                      d                                d           |                      d	                                d
           |                      d                                d           d S )Nr   hELlo   ßssr  fir  r  r  u   aισr  u   μ)r?   casefoldr3   s    r   test_casefoldzUnicodeTest.test_casefoldz  s    ))++W555))++W555$///))4000**,,h7771133_EEE**,,h77777r   c                    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 )Nr  r|  r  r  r  r  u
   X𐐧X𐐧r  FIr  r  r  SS   ῒ   Ϊ̀r  rz  ry  )r   r   
test_upperr?   upperr3   s    r   r  zUnicodeTest.test_upper  s   **4000++--|<<</5577/	1 	1 	1/5577/	1 	1 	1177991	3 	3 	3---))8444))8444t,,,))+?@@@++--|<<<))844444r   c                    t           j                            |            |                     d                                d           |                     d                                d           |                     d                                d           |                     d                                d           |                     d                                d           |                     d                                d	           d
}|                     d                                |           |                     d                                d           |                     d                                d           d S )Nr  r|  r  r     𐑏𐐧r  u
   X𐑏x𐑏u   hİu   Hi̇u	   Ϊ̀i̇u   ῒİu   ﬁnnishFinnishr  u   Aͅς)r   r   test_capitalizer?   
capitalize)r4   exps     r   r  zUnicodeTest.test_capitalize  sv   //5550022LAAA/::<</	1 	1 	1/::<</	1 	1 	1/::<</	1 	1 	11<<>>1	3 	3 	3--//AAA.2244c:::..00)<<<3355GGGGGr   c                    t                                                       |                     d                                d           |                     d                                d           |                     d                                d           |                     d                                d           |                     d                                d           |                     d                                d	           |                     d
                                d           |                     d                                d           |                     d                                d           d S )Nr  r|  r  r  u   𐑏𐑏 𐑏𐑏u   𐐧𐑏 𐐧𐑏u   𐑏𐐧 𐑏𐐧u   X𐐧x𐑏 X𐐧x𐑏u   X𐑏x𐑏 X𐑏x𐑏u   ﬁNNISHr  u	   AΣ ᾡxyu	   Aς ᾩxyu   AΣAu   Aσa)r  
test_titler?   titler  s    r   r  zUnicodeTest.test_title  s   ++--|<<</5577/	1 	1 	1DJJLLD	F 	F 	FDJJLLD	F 	F 	FDJJLLD	F 	F 	FHNNPPH	J 	J 	J))++Y777+11335GHHH))++Z88888r   c                    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 )Nr  r|  r  r  r  r  r  u
   x𐑏X𐐧r  r  r  r  r  r  r  u   Ισr  u   aΙςr  u   aΙσAr  u   aςΙr  u   σΙ r  r  r   r  )r   r   test_swapcaser?   swapcaser3   s    r   r  zUnicodeTest.test_swapcase  s   --d333..00,???..00,???/88::/	1 	1 	1/88::/	1 	1 	1/88::/	1 	1 	11::<<1	3 	3 	3))4000**,,n===**,,h7770022NCCC1133_EEE)22446FGGG1133_EEE1133_EEE1133_EEE**,,h777$///**,,.BCCCCCr   c                 @   t           j                            |            |                     d                    dd          d           |                     d                    dd          d           |                     d                    dd          d           d S )	Nr   r   r  u   x􏿿r   u	   􏿿x􏿿r   u   􏿿x􏿿􏿿)r   r   test_centerr?   centerr3   s    r   r  zUnicodeTest.test_center  s    ++D111A|44&	( 	( 	(A|440	2 	2 	2A|44:	< 	< 	< 	< 	<r   izrequires 32-bit systemc                     d}	 d|z  }n+# t           $ r |                     d|dz  z             Y nw xY w	 |                     t          |j                   ~d S # ~w xY w)NiVUU   üz$no enough memory (%.0f MiB required)i   )MemoryErrorskipTestrN   rL  r  )r4   rM  rb  s      r   test_case_operation_overflowz(UnicodeTest.test_case_operation_overflow  s     	StAA 	S 	S 	SMM@D5LQRRRRR	S	mQW555EEEEs   
 %22 A Ac                    |                      dd           |                      dd           |                      dd           |                      dd           |                     dd           |                      dd           |                      dd           |                      dd           |                      dd           |                      dd           |                     dd	           |                     dd
           |                     dd           |                      dd           |                      dd           |                      dd           |                      dd           |                      dd           |                      dd           |                     dd           |                      dd           |                      dd           |                      dd           |                      dd           |                     dd           |                     dd           |                     t          dj                   dD ]s}|dz  }dD ]i}|                     ||           |                      |||z              |                     |dz  |           |                      |dz  ||dz  z              jtd S )Nr   abdbbdabbdababdbabdb)r   r   N)r   Nr   )r   r   y)r   r   Nr>  abcxxxxabrU   )r   Nr   rm    z abczabc asdfasd)r      Āu   𐌀r   r  r   )assertInassertNotInrN   r   __contains__)r4   fillr&  s      r   test_containszUnicodeTest.test_contains  s   c6"""c6"""c7###c6"""e$$$c6"""c<(((c<(((c<(((c<(((k***l++++++dF###dE"""dM***b%   b"b%   u%%%dG$$$dG$$$c7###ff%%%'''$$$)U%78881 	; 	;DAID6 ; ;  ---eTE\222  D111eai	)9::::	;	; 	;r   c                 z   d                                  d                                 d                                 d                                 d                                 d                                 d                    dd           d                    dd           d                    dd           d S )Nu   𐀀􀀀   􀀀r      𐀀)	r  r  r  r  r  r  r  ljustrjustr3   s    r   test_issue18183zUnicodeTest.test_issue18183  s    $$&&&'')))$$&&&))+++$$&&&'')))A|,,,1l+++1l+++++r   c                 >   |                      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            G d d          } G d d          } G d d           } G d! d"          } G d# d$          } G d% d&|j                  } G d' d(t
                    }	 G d) d*          }
 G 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[                     |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                    dq          d           |                      d                    dq          dq           |                      d                    dq          d           |                      d                    dq          d           |                      d                    dq          d           |                      d                    dq          d           |                      d                    d          ddXdz  z              |                      d                    d          dXdz             |                      d                    d          dXdz             |                      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dѬҦ                    dӦ           |                      d.                     |	d`                    d^           |                      d/                    d          d           |                      dԠ                    dd֦          dצ           |                      dؠ                    dd֦          dצ           |                      d٠                    dd֬ڦ          dצ           |                      d۠                    dd`d֬ܦ          dݦ           |                      d۠                    ddd߬ܦ          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           |                     t          dj        dY           |                     t          dj        dY           |                     t          dj        d           |                     t          dj        d           |                     t          dj                   |                     t          dj                   |                     t          dj                   |                     t          dFj                   d}|                     t          dB|z   dDz   j                   |                     t          d|z   dz   j        dg           |                     t          dj        d           |                     t          dj        d           |                     t          dj        d           |                     t          dj        d           |                     t          dj        d           |                     t          dj        d           |                     t          dj        d           |                     t          dj        d           |                     t          dj        d           |                     t          dj        d           |                     t          dj        d           |                     t          dj        d           |                     t          d j        d g           |                     t          dj        d g           |                     t          dj        dd           |                     t          dj        d-dd           |                     t          dj        dd7ddYdd֐d	d

  
         d}|                     t          |dj        d           |                     t          |t          dd           d}|                     t          |dj        d           |                     t          dj        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 ()  Nrm   r   r   a{{a{a}}a}{{b{b}}b}ba{{ba{br   zMy name is {0}FredzMy name is FredzMy name is {0[name]})namezMy name is {0} :-{{}}zMy name is Fred :-{}i  r      zThe year is {0.year}zThe year is 2007c                       e Zd ZddZd ZdS )"UnicodeTest.test_format.<locals>.Cr   c                     || _         d S r.   _xr4   r   s     r   r9  z+UnicodeTest.test_format.<locals>.C.__init__1      r   c                     |S r.   r   r4   specs     r   
__format__z-UnicodeTest.test_format.<locals>.C.__format__3      r   Nr   r(   r)   r*   r9  rH  r   r   r   Cr?  0  7               r   rL  c                       e Zd Zd Zd ZdS )"UnicodeTest.test_format.<locals>.Dc                     || _         d S r.   r   rC  s     r   r9  z+UnicodeTest.test_format.<locals>.D.__init__7      r   c                 *    t          | j                  S r.   )r:   r   rF  s     r   rH  z-UnicodeTest.test_format.<locals>.D.__format__9  s    46{{"r   NrK  r   r   r   DrO  6  s2          # # # # #r   rT  c                       e Zd Zd Zd ZdS )"UnicodeTest.test_format.<locals>.Ec                     || _         d S r.   rQ  rC  s     r   r9  z+UnicodeTest.test_format.<locals>.E.__init__>  rR  r   c                     d| j         z   dz   S )NzE()rQ  r3   s    r   r;  z*UnicodeTest.test_format.<locals>.E.__str__@      df}s**r   Nr<  r   r   r   ErV  =  2          + + + + +r   r[  c                       e Zd Zd Zd ZdS )"UnicodeTest.test_format.<locals>.Fc                     || _         d S r.   rQ  rC  s     r   r9  z+UnicodeTest.test_format.<locals>.F.__init__E  rR  r   c                     d| j         z   dz   S )NzF(rY  rQ  r3   s    r   r;   z+UnicodeTest.test_format.<locals>.F.__repr__G  rZ  r   N)r(   r)   r*   r9  r;   r   r   r   Fr^  D  r\  r   ra  c                        e Zd Zd Zd Zd ZdS )"UnicodeTest.test_format.<locals>.Gc                     || _         d S r.   rQ  rC  s     r   r9  z+UnicodeTest.test_format.<locals>.G.__init__L  rR  r   c                     d| j         z   S )Nz
string is rQ  r3   s    r   r;  z*UnicodeTest.test_format.<locals>.G.__str__N  s    #df,,r   c                 ^    |dk    rd| j         z   dz   S t                              | |          S )Nr  zG(rY  )r   rC   rH  r4   format_specs     r   rH  z-UnicodeTest.test_format.<locals>.G.__format__P  s4    #%%$&=3..(({;;;r   N)r(   r)   r*   r9  r;  rH  r   r   r   Grc  K  sA          - - -< < < < <r   ri  c                       e Zd Zd ZdS )"UnicodeTest.test_format.<locals>.Ic                 ,    |                      |          S r.   )strftimerg  s     r   rH  z-UnicodeTest.test_format.<locals>.I.__format__V  s    }}[111r   Nr(   r)   r*   rH  r   r   r   Irk  U  s#        2 2 2 2 2r   ro  c                       e Zd Zd ZdS )"UnicodeTest.test_format.<locals>.Jc                 >    t                               | dz  |          S Nr   )rJ  rH  rg  s     r   rH  z-UnicodeTest.test_format.<locals>.J.__format__Z  s    ~~dQh<<<r   Nrn  r   r   r   Jrq  Y  s#        = = = = =r   rt  c                       e Zd Zd Zd ZdZdS )"UnicodeTest.test_format.<locals>.Mc                     || _         d S r.   rQ  rC  s     r   r9  z+UnicodeTest.test_format.<locals>.M.__init__^  rR  r   c                     d| j         z   dz   S )NzM(rY  rQ  r3   s    r   r;   z+UnicodeTest.test_format.<locals>.M.__repr__`  rZ  r   N)r(   r)   r*   r9  r;   r;  r   r   r   Mrv  ]  s1          + + +GGGr   ry  c                       e Zd Zd Zd ZdZdS )"UnicodeTest.test_format.<locals>.Nc                     || _         d S r.   rQ  rC  s     r   r9  z+UnicodeTest.test_format.<locals>.N.__init__e  rR  r   c                     d| j         z   dz   S )NzN(rY  rQ  r3   s    r   r;   z+UnicodeTest.test_format.<locals>.N.__repr__g  rZ  r   N)r(   r)   r*   r9  r;   rH  r   r   r   Nr{  d  s1          + + +JJJr   r~  rU   {0}z{0:}zX{0}Xabcz{0}XabcXzX{0}YXabcYz{1}r   zX{1}z{1}XzX{1}Yiz-15z{0}{1}z-15abcz{0}X{1}z-15Xabcz{{{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-barbazz{0[foo bar]}zfoo barz{0[ ]}rM   r   rC  {foo._x}   )rB  20z{1}{0}r   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}rB   z{0:x<5s}z{0:x<6s}z{0:x<7s}resultxz{0:x<8s}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:8s}zresult  z{0:0s}z{0:08s}result00z{0:<08s}z{0:>08s}00resultz{0:^08s}0result0z	{0:10000}i'  i'  z{0:10000000}i z{0: <6s}rB  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     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}Helloz{0!s:}z{0!s:15}zHello          z	{0!s:15s}z{0!r}z'Hello'z{0!r:}zF(Hello)r  z'\u0378'r  u   'ʹ'u   F(ʹ)z{0!a}z'\u0374'z{0!a:}z	F(\u0374)r
  z[1]z{0:d}datazG(data)zstring is dataz{0:^10}z{0:>15s}z{0:date: %Y-%m-%d}   )yearmonthdayzdate: 2007-08-27z{0:.{1}}hello world   r   z	{0:.{1}s}z{0:.{precision}s})	precisionz{0:{width}.{precision}s})widthr  z
hello     105{a}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},23098475029384702983476098230754973209482573z{[z]}z{0:x}              ?      ?z{0:X}z{0:o}z{0:u}z{0:i}z{0[0]x}z
{0[0](10)}z{0[{1}]}r  r   z{0:{1:{2}}}rb  z{0:{1:{2:{3:{4:{5:{6}}}}}}}r   r   r   z+Sign not allowed in string format specifierz{0:-s}-z,Space not allowed in string format specifierz{: }z{0:=s}#z#20z
{0:s}{1:s}ABCu   АБВu	   ABCАБВz{[{}]}z{[{]}z{[}]}z{[[]}r  z{[!]}rR  z{a{}b}r   z{a{b}z{[}z0x{:0{:d}X}   0x0000000000000000{!r}zM(data)z{!s}zN(data))r?   r  datetimedictdaterJ  rN   r   r   
IndexErrorKeyErrorassertRaisesRegex)r4   r  r  rL  rT  r[  ra  ri  ro  rt  ry  r~  bigsign_msg	space_msgmns                    r   test_formatzUnicodeTest.test_format  s   b)))s+++---............%000 	)0088:KLLL/66t7H7H7HII*	, 	, 	,077??/	1 	1 	1 MM$2&&/66q99+	- 	- 	-	 	 	 	 	 	 	 		# 	# 	# 	# 	# 	# 	# 	#	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+	+ 	+ 	+ 	+ 	+ 	+ 	+ 	+	< 	< 	< 	< 	< 	< 	< 	<	2 	2 	2 	2 	2 	2 	2 	2	= 	= 	= 	= 	= 	= 	= 	=	 	 	 	 	 	 	 		 	 	 	 	 	 	 	 	b)))///e,,e444u--u555u--v666u--v666..888a//777q%00&999q%00&9995117;;;c**E222e44h???))#u55yAAA,,,,,,$///))5111))#..888++--w777$///))5111 	..	%/@AA5III..	%/@AA5III#a113777**qquu*55t<<<2"66???**11QQuXX;;77???%88%@@@%88%@@@++UUG,<==uEEE--uqqxxj.ABBEJJJ 	))%00%888))$//666))(33U;;;))(33R888**5115999**5115999**5114888**5115999**844h???**844h???**844h???**844i@@@**844jAAA**844i@@@))(33Y???))(33Y???))(33Z@@@))(33Z@@@))(33[AAA**844lCCC22J???22H===))(33Z@@@**844jAAA**844jAAA**844jAAA++C00#d
2BCCC++B//u===..r22C(NCCC 	--e446GHHH--e446GHHH--e446GHHH))%00(;;;,,Q//1HIII,,Q//1HIII,,Q//1HIII++X666,,T22NCCC,,T22NCCC,,T22NCCC..999--f557WXXX--f557WXXX--f557WXXX))&11>BBB 	))!!##..666 	00':::117;;;**7335FGGG++G446GHHH00)<<<119==='

33Z@@@11;???11:>>>(44kBBB00)<<<11;???11;???119==='

33Z@@@(44lCCC 	b))4000b))4000qc**E222&		22I>>>&		224DEEE)Y%5qqyyAAA)Z%6&		BBB)Z%6&		BBB-44QQD=>;=6? 6? 6? @ @ ,	- 	- 	- 	aaee,,d333 	s++S111 	**=!<<gFFF++M1==wGGG,33MQ3OOQXYYY3::=PR^_:``bnooo3::=PT`c:ddfrsss 	*cj111*cj111*dk222*dk222*dk222*dk222*el333*elE:::(el333*dk222*j&7888*dk222*fm444*fmQ777*fm444*fmR888(fm444*hoq999*j&7;;;*gna888*k&8!<<<(fm444*k&8!<<<*fmQ777(gn!<<<*gna888*fmQ777*hoq999*el333*el333*fm444*dk222<*sSy3&>???*tczD'8&@1#FFF 	*gnb999*gnc:::*gnb999*gnc:::*gnb999*gnc:::*gnb999*gnc:::*gnb999*gnc:::*gnb999*gnc::: 	*i&6???*l&9D6BBB 	)Z%6	1EEE 	*m&:E3KKK*&C&JQ1aAq	2 	2 	2 Az8X_bIIIz8VREEEB	z9fmRHHH*hor::: 	*fb#666*fb%888 	,,U4HII0	2 	2 	2))*ABB	  	  	 ))*ABB	 	 	 	$33S999$66<<<s44c:::s44c:::s44c:::s44c:::*hor:::*gnb999*elB777--c"557KLLL AfIIq))9555)V]A666)T[!444AfIIq))9555q))9555)T[!44444r   c                 N   |                      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t                    }|                      d                     |                      d           |                      d                     |d                    d            G d d          }|                      d                     |                      d            G 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(          }|                     t          dj        i            |                     t          dj        g            |                     t          dj         |                       d S ))Nrm   r   r   r1  r2  r3  r4  r5  r6  r7  r8  r9  r:  c                       e Zd Zd ZdS ),UnicodeTest.test_format_map.<locals>.Mappingc                     |S r.   r   r4   keys     r   __missing__z8UnicodeTest.test_format_map.<locals>.Mapping.__missing__m  s    
r   N)r(   r)   r*   r  r   r   r   Mappingr  l  #            r   r  z{hello}r   z{a} {world})r   r  c                       e Zd Zd Zd ZdS )4UnicodeTest.test_format_map.<locals>.InternalMappingc                     ddi| _         d S )Nr   r   r  r3   s    r   r9  z=UnicodeTest.test_format_map.<locals>.InternalMapping.__init__s  s     #W~r   c                     | j         |         S r.   r  r  s     r   __getitem__z@UnicodeTest.test_format_map.<locals>.InternalMapping.__getitem__u  s    |C((r   N)r(   r)   r*   r9  r  r   r   r   InternalMappingr  r  s2        . . .) ) ) ) )r   r  z{a}c                       e Zd ZddZd ZdS )&UnicodeTest.test_format_map.<locals>.Cr   c                     || _         d S r.   rA  rC  s     r   r9  z/UnicodeTest.test_format_map.<locals>.C.__init__{  rD  r   c                     |S r.   r   rF  s     r   rH  z1UnicodeTest.test_format_map.<locals>.C.__format__}  rI  r   NrJ  rK  r   r   r   rL  r  z  rM  r   rL  r  rB  r  r  r  r  r  r  r  r   z{a} {}r   r  c                       e Zd Zd ZdS )/UnicodeTest.test_format_map.<locals>.BadMappingc                     ddz  S )Nr   r   r   r  s     r   r  z;UnicodeTest.test_format_map.<locals>.BadMapping.__getitem__  s    s
r   N)r(   r)   r*   r  r   r   r   
BadMappingr    r  r   r  )r?   
format_mapr  rN   r   r   r  ZeroDivisionError)r4   r  r  rL  r  s        r   test_format_mapzUnicodeTest.test_format_mapa  s   r**B///++S111,,d333))"--t444))"--t444))"--t444))"--t444**2..666	 	 	 	 	d 	 	 	 	--ggii88'BBB11''G2D2D2DEE}UUU	) 	) 	) 	) 	) 	) 	) 	)
 	))//*;*;<<gFFF	 	 	 	 	 	 	 	
 	..qquu~>>EEE 	)R]333)S^444*cnb999*cnb999*dor:::*dor:::*dor:::*dor::: 	*doayAAA*dos;;;*h&9!1;M;MNNN	 	 	 	 	 	 	 	 	(E$4b999)U%5r:::+U-=zz||LLLLLr   c                     d                     t          j        dz             }|                     t                    5  t          d|          }d d d            d S # 1 swxY w Y   d S )Nz.{}fr   Q@r  rw   rK  rN   r   r4   format_stringrB   s      r   test_format_huge_precisionz&UnicodeTest.test_format_huge_precision  s    ckAo66z** 	1 	1D-00F	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1   AA"Ac                     d                     t          j        dz             }|                     t                    5  t          d|          }d d d            d S # 1 swxY w Y   d S )Nz{}fr   r  r  r  s      r   test_format_huge_widthz"UnicodeTest.test_format_huge_width  s    S[1_55z** 	1 	1D-00F	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1 	1r  c                     d                     t          j        dz             }|                     t                    5  |                     d          }d d d            d S # 1 swxY w Y   d S )Nz
{{{}:.6f}}r   r  r  r  s      r   test_format_huge_item_numberz(UnicodeTest.test_format_huge_item_number  s    $++CK!O<<z** 	0 	0"))$//F	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0 	0s   A  A$'A$c                     G 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#                    dd$%          d&           |                      d'                    dd$%          d(           |                      d)                    dd*d+d,          d-           |                      d.                    dddd+/          d0           d S )1Nc                       e Zd ZddZd ZdS )1UnicodeTest.test_format_auto_numbering.<locals>.Cr   c                     || _         d S r.   rA  rC  s     r   r9  z:UnicodeTest.test_format_auto_numbering.<locals>.C.__init__  rD  r   c                     |S r.   r   rF  s     r   rH  z<UnicodeTest.test_format_auto_numbering.<locals>.C.__format__  rI  r   NrJ  rK  r   r   r   rL  r    rM  r   rL  r  r   r  z{:5}rb  zs    r  z's'z{._x}z{[1]}r   r   rA  z{[a]}r   r  4za{}b{}cr   a0b1cza{:{}}br   z^10za    x     bza{:{}x}br  r  a0x14bz{}{1}z{1}{}z{:{1}}z{0:{}}z{f}{}test)ftest4z{}{f}4testz{:{f}}{g}{}r   g)r  r  z 1g3z{f:{}}{}{g})r  r  z 14g)r?   r  rN   r   )r4   rL  s     r   test_format_auto_numberingz&UnicodeTest.test_format_auto_numbering  s   	 	 	 	 	 	 	 	 	R$///s++W555s++U333"..555A//555QA77===))!Q//999))#u55~FFF**2s33X>>> 	*gna;;;*gna;;;*hoq!<<<*hoq!<<< 	V44g>>>V44g>>>--acQ-??HHH--aa3-??HHHHHr   c                    t           j                            |            |                     ddz  d           |                     ddz  d           |                     ddz  d           |                     dd	z  d
           |                     ddz  d           |                     ddz  d           t          j                            d          sK|                     ddz  d           |                     ddz  d           |                     ddz  d           |                     ddddz  d           |                     ddddz  d           |                     dd z  d!           |                     dd"z  d#           |                     t          dj	        d$           |                     dd#z  d#           |                     t          dj	        d%           |                     t          d&j	        d'           |                     t          d(j	        d%           |                     d)d*diz  d+           |                     d)d*diz  d+           |                     d)d*diz  d+           |                     d)d*diz  d+           |                     d)dd,d-z  d+           |                     d)dd,d-z  d+           |                     d.d/z  d0           |                     d1d/z  d2           |                     d3dz  d+           |                     d4d5z  d6           |                     d4d7z  d8           |                     d9d:z  d;           |                     d9d<z  d6           |                     d=d>z  d?           |                     d@dAz  dB           |                     ddCz  dC            G dD dE          }|                     dF |            z  d!           t          dG          }t          dH          }|                     dI|z  dG           |                     dJ|z  dK           |                     dI|z  dH           |                     dJ|z  dL           |                     dMdNz  dC           |                     dOdNz  dP            G dQ dR          } G dS dT          } |dU          } |dV          }|                     dWdXz  dY           |                     dZd[z  d\           |                     d]d^z  d_           |                     ddVz  d`           |                     dW|z  da           |                     dZ|z  db           |                     d]|z  dc           |                     d|z  d`           |                     t          ddt          j        dWde           |                     t          dft          j        dZdg           |                     t          dht          j        d]di           |                     t          djt          j        dW|           |                     t          dkt          j        dWdl           |                     t          dmt          j        dZdn           |                     t          dot          j        d]dp           |                     t          dqt          j        drdl           |                     t          dst          j        d(dn           |                     t          dtt          j        dudp           |                     t          dvt          j        d|            G dw dx          } |            }	|                     t           dyt          j        du|	           |                     t           dyt          j        d(|	           |                     t           dyt          j        dr|	           |                     t           dzt          j        dW|	           |                     t           dzt          j        dZ|	           |                     t           dzt          j        d]|	           d S ){Nz%s, %s)rU   rU   abc, abcz%s, %s, %i, %f, %5.2f)rU   rU   r   r   r   zabc, abc, 1, 2.000000,  3.00)rU   rU   r   r   zabc, abc, 1, -2.000000,  3.00)rU   rU   r   r  g      @zabc, abc, -1, -2.000000,  3.50)rU   rU   r   r  g(\@zabc, abc, -1, -2.000000,  3.57)rU   rU   r   r  g(\\@z abc, abc, -1, -2.000000, 1003.57rT   z%r, %r)rf  rU   zb'abc', 'abc'z%r)   ሴu   'ሴ'z%az'\u1234'z%(x)s, %(y)srU   r   )r   r  zabc, defu   %(x)s, %(ü)s)r   r  z%ci4  r  i u   𡒃)rL   aau   %.1ဲfgUUUUUU?z%i...%(foo)s...rB  	...abc...r  rB  r   z...%s...%s...%s...%s...)r   r   r   rU   z...1...2...3...abc...z"...%%...%%s...%s...%s...%s...%s...z...%...%s...1...2...3...abc...z...%s...z%*s)r  rU   z  abc)rU   zabc  z%*.*s)r  r   rU   z   ab)r  r   rU   z%i %*.*s)r   r  r   rU   z10   abcz
%i%s %*.*s)r   r   r  r   rU   z	103   abcr   c                       e Zd Zd ZdS ),UnicodeTest.test_formatting.<locals>.Wrapperc                     dS )Nr  r   r3   s    r   r;  z4UnicodeTest.test_formatting.<locals>.Wrapper.__str__  s    xr   Nr(   r)   r*   r;  r   r   r   Wrapperr    s#                 r   r  %snaninfz%fz%FNANINFz%.1su   aé€z%.2su   aéc                        e Zd Zd Zd Zd ZdS ).UnicodeTest.test_formatting.<locals>.PseudoIntc                 .    t          |          | _        d S r.   rJ  valuer4   r  s     r   r9  z7UnicodeTest.test_formatting.<locals>.PseudoInt.__init__  s     ZZ


r   c                     | j         S r.   r  r3   s    r   __int__z6UnicodeTest.test_formatting.<locals>.PseudoInt.__int__  
    z!r   c                     | j         S r.   r  r3   s    r   	__index__z8UnicodeTest.test_formatting.<locals>.PseudoInt.__index__  r  r   N)r(   r)   r*   r9  r  r	  r   r   r   	PseudoIntr     sA        ( ( (" " "" " " " "r   r
  c                       e Zd Zd Zd ZdS )0UnicodeTest.test_formatting.<locals>.PseudoFloatc                 .    t          |          | _        d S r.   )floatr  r  s     r   r9  z9UnicodeTest.test_formatting.<locals>.PseudoFloat.__init__  s    "5\\


r   c                 *    t          | j                  S r.   r  r3   s    r   r  z8UnicodeTest.test_formatting.<locals>.PseudoFloat.__int__
  s    4:&r   N)r(   r)   r*   r9  r  r   r   r   PseudoFloatr    s2        * * *' ' ' ' 'r   r  go!	@m   z%xr   2az%X   ra  z%or   11r  6d6D155z,%x format: an integer is required, not floatr  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 PseudoFloatz.%x format: an integer is required, not complexy              @z.%X format: an integer is required, not complexy               @z.%o format: an integer is required, not complexr  z1%u format: a real number is required, not complexz%uz1%i format: a real number is required, not complexz1%d format: a real number is required, not complexz%dz%c requires int or charc                       e Zd Zd Zd ZdS )2UnicodeTest.test_formatting.<locals>.RaisingNumberc                      t          d          )NrJ  RuntimeErrorr3   s    r   r  z:UnicodeTest.test_formatting.<locals>.RaisingNumber.__int__#  s    "5)))r   c                      t          d          )Nr   r  r3   s    r   r	  z<UnicodeTest.test_formatting.<locals>.RaisingNumber.__index__%  s    "7+++r   N)r(   r)   r*   r  r	  r   r   r   RaisingNumberr  "  s2        * * *, , , , ,r   r  rJ  r   )r   r.  test_formattingr?   rw   rx   ry   rN   rL  __mod__r   r   r  r  operatormodr  )
r4   r  r  r  r
  r  piletter_mr  rns
             r   r  zUnicodeTest.test_formatting  s   2BB4HHHN2J???03JJLjkkk03KKMlmmm03NNPpqqq03OOQqrrr03RRTvwww|&&v.. 	>X7IIITK/<<<TK/===u%*@*@@*MMM*%-F-FF
SSS111666-{CCC,l;;;)T\4888*l&:UDDD)T\4888 	E%=8+FFFE%=8+FFFE%=8+FFFE%=8+FFF%c+B+BB[QQQ%c+B+BBKPPP2]BD[\\\=MOopppe+[999+W555,g666</999</999&66
CCC(=={KKKS)))	  	  	  	  	  	  	  	  			)8444 EllEllU+++U+++U+++U+++ 	-/555-/999	" 	" 	" 	" 	" 	" 	" 	"	' 	' 	' 	' 	' 	' 	' 	'
 [  9S>>D)))C(((4(((S)))$///$///%000#...y*XZbZfhlnrsssy*XZbZfhlnrsssy*XZbZfhlnrsssy*^`h`lnrtvwwwy*Z\d\hjnprsssy*Z\d\hjnprsssy*Z\d\hjnprsssy*]_g_kmqsuvvvy*]_g_kmqsuvvvy*]_g_kmqsuvvvy*CX\SWY[\\\	, 	, 	, 	, 	, 	, 	, 	, ]__|UHL$KKK|UHL$KKK|UHL$KKK|WhlD"MMM|WhlD"MMM|WhlD"MMMMMr   c           
      *   dd l } G d dt          |j                  } G d d|j                  } G d d|j                  }|                     |j        d|j        d	           |                     d
|j        |j        |j        |j        |j        |j        |j        fz  d           |                     dd|j        iz  d           |                     dd|j        iz  d           |                     dd|j        iz  d           |                     dd|j        iz  d           |                     dd|j        iz  d           |                     d|j        |j        dz  d           |                     d|j        ddz  d           d S )Nr   c                       e Zd ZdZdS )4UnicodeTest.test_formatting_with_enum.<locals>.FloatgJM!	@N)r(   r)   r*   PIr   r   r   Floatr(  3  s        BBBr   r*  c                       e Zd ZdZdS )2UnicodeTest.test_formatting_with_enum.<locals>.Intr  N)r(   r)   r*   IDESr   r   r   Intr,  6  s        DDDr   r.  c                       e Zd ZdZdS )2UnicodeTest.test_formatting_with_enum.<locals>.StrrU   N)r(   r)   r*   r  r   r   r   Strr0  9  s        CCCr   r1  z, r  z%s, %s, %d, %i, %u, %f, %5.2fz%abc, abc, 15, 15, 15, 3.141593,  3.14r  rB  r  z...%(foo)r...z...<Int.IDES: 15>...z...15...z...%(foo)i...z...%(foo)d...z...%(foo)u...r  z...%(foo)f...r  z...3.141593...)	enumr  EnumIntEnumStrEnumr?   r  r-  r)  )r4   r2  r*  r.  r1  s        r   test_formatting_with_enumz%UnicodeTest.test_formatting_with_enum0  s>   	 	 	 	 	E49 	 	 		 	 	 	 	$, 	 	 		 	 	 	 	$, 	 	 	 	SWWWcgg6#	% 	% 	%8#'38SX58-- A		B 	B 	B 	E#'?:$	& 	& 	&E#(+;;/	1 	1 	1E#(+;;#	% 	% 	%E#(+;;#	% 	% 	%E#(+;;#	% 	% 	%#(%(+K+KK#	% 	% 	%%(+E+EE)	+ 	+ 	+ 	+ 	+r   c                     d                     t          j        dz             }|                     t                    5  |dz  }d d d            d S # 1 swxY w Y   d S Nz%.{}fr   r  r  r  s      r   test_formatting_huge_precisionz*UnicodeTest.test_formatting_huge_precisionU  s    s{Q77z** 	* 	*"T)F	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*   AAAc                 p     G d dt                     }|                     d |d          z  d           d S )Nc                       e Zd Zd ZdS )BUnicodeTest.test_issue28598_strsubclass_rhs.<locals>.SubclassedStrc                 ,    d                     |          S )Nz'Success, self.__rmod__({!r}) was calledr  )r4   others     r   __rmod__zKUnicodeTest.test_issue28598_strsubclass_rhs.<locals>.SubclassedStr.__rmod__^  s    @GGNNNr   N)r(   r)   r*   rA  r   r   r   SubclassedStrr=  ]  s(        O O O O Or   rB  z	lhs %% %rrhsz.Success, self.__rmod__('lhs %% %r') was calledr:   r?   )r4   rB  s     r   test_issue28598_strsubclass_rhsz+UnicodeTest.test_issue28598_strsubclass_rhsZ  sq    	O 	O 	O 	O 	OC 	O 	O 	O 	}}U';';;I	K 	K 	K 	K 	Kr   c                     d                     t          j        dz             }|                     t                    5  |dz  }d d d            d S # 1 swxY w Y   d S r8  )r  r  INT_MAXrN   r   r  s      r   'test_formatting_huge_precision_c_limitsz3UnicodeTest.test_formatting_huge_precision_c_limitsc  s      y'81'<==z** 	* 	*"T)F	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*r:  c                     d                     t          j        dz             }|                     t                    5  |dz  }d d d            d S # 1 swxY w Y   d S )Nz%{}fr   r  r  r  s      r   test_formatting_huge_widthz&UnicodeTest.test_formatting_huge_widthj  s    ckAo66z** 	* 	*"T)F	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	* 	*r:  c                 $   dj         dj        fD ]}|                     t                    5 } |dg           d d d            n# 1 swxY w Y   t	          |j                  }|                     d|           |                     d|           d S )NrB  r  r:   r   )ry   endswithrN   r   r:   	exceptionr%  )r4   r  cmexcs       r   test_startswith_endswith_errorsz+UnicodeTest.test_startswith_endswith_errorso  s    %u~6 	( 	(D""9-- cU              bl##CMM%%%%MM'3''''	( 	(s   AA	A	LC_ALLde_DEfr_FRc                 8    |                      dddz             d S )Nz1.0z%.1fr  r?   r3   s    r   test_format_floatzUnicodeTest.test_format_floatw  s$     	-----r   c           	      ^   |                      t          d          d           dD ]}t          |          }|                      t          |          |           |                      t          |          t          |                     |dk    rR|                      |                    d          d           |                      |                    d          d           |                      t          d          d            G d d          }|                      t           |d	                    d	            |d
          }|                      t          |          d
           |                      t          |          d
           dD ]?}|                      t          |          t          t          |                               @t
          j                            d          s#|                     t          t          ddd           |                      t          ddd          d           t
          j                            d          s2|                      t          t          d          dd          d           |                     t          t          ddd           d S )Nzunicode remains unicode)rz   r  rn  r  rz   s   asciiutf-8z strings are converted to unicodec                       e Zd Zd Zd ZdS )2UnicodeTest.test_constructor.<locals>.StringCompatc                     || _         d S r.   rQ  rC  s     r   r9  z;UnicodeTest.test_constructor.<locals>.StringCompat.__init__  rR  r   c                     | j         S r.   rQ  r3   s    r   r;  z:UnicodeTest.test_constructor.<locals>.StringCompat.__str__  s	    vr   Nr<  r   r   r   StringCompatrZ    s2              r   r]  z)__str__ compatible objects are recognizedz#unicode(obj) is compatible to str())r  g^@r  rT   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!   rw   rx   ry   rN   r   
memoryview)r4   r#   subclassr]  oobjs         r   test_constructorzUnicodeTest.test_constructor|  s    	)**%	
 	
 	

 > 	E 	ED"4((HS]]D111S]]CII666w  !9!98DDD  !9!98DDD233.	
 	
 	

	 	 	 	 	 	 	 	 	HIIJJ7	
 	
 	
 L>??Q!FGGGQ!FGGG% 	6 	6CSXXs3s88}}5555
 |&&v.. 	3   	17HEE,	
 	
 	

 |&&v.. 	JKK 
 ;   	)S"b"55555r   c                 ,   |                      t          d          d           |                      t          dd          d           |                      t          dd          d           |                      t          dd          d           d	S )
z>Pass various keyword argument combinations to the constructor.rB  )rC   s   foorX  )rC   r   r   r   )rC   r   N)r?   r:   r3   s    r   test_constructor_keyword_argsz)UnicodeTest.test_constructor_keyword_args  s     	E***E222FW===uEEEVH555u===F8<<<eDDDDDr   c                 L   |                      t                      d           |                      t          d          d           d                    d          }|                      t          |d          d           |                     t          t          |d           dS )	z(Check the constructor argument defaults.rm   r   re     ¢rX  rz   )r   N)r?   r:   r!   rN   UnicodeDecodeError)r4   	utf8_cents     r   test_constructor_defaultsz%UnicodeTest.test_constructor_defaults  s     	###H---r222KK((	Yx888$???,c9wOOOOOr   c                    g d}|D ].\  }}|                      |                    d          |           /|                      d                    d          d           |                      d                    d          d           |                      d                    d          d           |                      d	                    d          d
           |                      d                    d          d           |                      d                    d          d           |                      d                    d          d           |                      d
                    d          d	           |                      d                    d          d           |                      d                    d          d           |                      d                    dd          d           d}d}|D ]z}|                      |                    d          |                    d                     |                      |                    d                              d          |           {|D ]>}|                      |                    d                              d          |           ?|                     t          d          5  d                    d           d d d            d S # 1 swxY w Y   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?rn  )z\\?s   +AFwAXA?)z\\\?s
   +AFwAXABc?)z++--s   +-+---)u   򫳞s   +2m/c3g-)/   /utf-7u   s   +2AE-u   xs   +2AE-xu   s   +3AE-u   xs   +3AE-xu   򫳞s
   +2AHab9ze-s   +re  rm   zGABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'(),-./:?z!"#$%&*;<=>@[]^_`{|}utf7rz   zill-formed sequences   +@)r?   r!   r"   r  ri  )r4   utfTestsr   r  set_dset_or   s          r   test_codecs_utf7zUnicodeTest.test_codecs_utf7  s,   
 
 
"  	3 	3FQQXXg..2222 	118<<<))'22I>>>118<<<))'22I>>>118<<<))'22I>>>118<<<))'22I>>>+227;;]KKK--g668JKKK 	(;;R@@@ Z& 	B 	BAQXXf--qxx/@/@AAAQXXg..55f==qAAAA 	B 	BAQXXg..55f==qAAAA##$6$9; ; 	" 	"LL!!!	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	" 	"s   K::K>K>c                 r   |                      d                    d          d           |                      d                    d          d           |                      d                    d          d           |                      d                    d          d	           |                      d
                    dd          d           |                      d                    dd          d           |                      d                    d          d           |                      d                    d          d           |                      t          d	d          d           |                      t          dd          d           |                      t          dd          d           d S )Nrm   rX  r   rn  s   €u   𐀂s   𐀂u   𣑖s   𣑖r  surrogatepasss   u   s   u(   𐀂𐀂𐀂𐀂𐀂𐀂𐀂𐀂𐀂𐀂s(   𐀂𐀂𐀂𐀂𐀂𐀂𐀂𐀂𐀂𐀂u   正確に言うと翻訳はされていません。一部はドイツ語ですが、あとはでたらめです。実際には「Wenn ist das Nunstuck git unds   正確に言うと翻訳はされていません。一部はドイツ語ですが、あとはでたらめです。実際には「Wenn ist das Nunstuck git und)r?   r!   r:   r3   s    r   test_codecs_utf8zUnicodeTest.test_codecs_utf8	  s   7++S11111?CCC,,W557JKKK,,W557JKKK/BBOTTT/BBOTTT/11'::/	1 	1 	1 
 !'w	9	
 	
 	
( 	0'::LJJJ0'::LJJJ_g66BBBBBr   c                 p    g d}|D ].\  }}|                      |                    d          |           /d S )N))    r!  )   ar   )   )s      )s   ߿u   ߿)s   ࠀu   ࠀ)s   ퟿u   ퟿)s   rs  )s   ￿rK   )s   𐀀r,  )s   􏿿r  rX  )r?   r"   )r4   	sequencesrN  ress       r    test_utf8_decode_valid_sequencesz,UnicodeTest.test_utf8_decode_valid_sequences.  sW    
 
 
	 " 	7 	7HCSZZ00#6666	7 	7r   c                 z   d t          dd          D             }d t          dd          D             }d t          dd          D             }||z   |z   d	 t          d
d          D             z   }|D ]#}|                     t          |j        d           $|D ]+}|D ]&}|                     t          ||z   j        d           ',|D ]F}|d d         D ]9}|d d         D ],}	|                     t          ||z   dz   |	z   j        d           -:Gd t          dd          D             D ]P}|                     t          d|z   dz   j        d           |                     t          d|z   dz   j        d           Qd t          dd          D             D ]P}|                     t          d|z   dz   j        d           |                     t          d|z   dz   j        d           Qd t          dd          D             D ]P}|                     t          d|z   dz   j        d           |                     t          d|z   dz   j        d           Qd t          dd          D             D ]P}|                     t          d|z   dz   j        d           |                     t          d|z   dz   j        d           Qd S )Nc                 .    g | ]}t          |g          S r   rG  .0r   s     r   
<listcomp>zBUnicodeTest.test_utf8_decode_invalid_sequences.<locals>.<listcomp>A  s     DDDQeQCjjDDDr         c                 .    g | ]}t          |g          S r   r  r  s     r   r  zBUnicodeTest.test_utf8_decode_invalid_sequences.<locals>.<listcomp>C       %L%L%LQeQCjj%L%L%Lr      c                 .    g | ]}t          |g          S r   r  r  s     r   r  zBUnicodeTest.test_utf8_decode_invalid_sequences.<locals>.<listcomp>E  r  r         c                 .    g | ]}t          |g          S r   r  r  s     r   r  zBUnicodeTest.test_utf8_decode_invalid_sequences.<locals>.<listcomp>H  s     )Q)Q)Q%**)Q)Q)Qr      rn   rX  r      c                 .    g | ]}t          |g          S r   r  r  s     r   r  zBUnicodeTest.test_utf8_decode_invalid_sequences.<locals>.<listcomp>X       999!5!::999r            c                 .    g | ]}t          |g          S r   r  r  s     r   r  zBUnicodeTest.test_utf8_decode_invalid_sequences.<locals>.<listcomp>^  r  r      c                 .    g | ]}t          |g          S r   r  r  s     r   r  zBUnicodeTest.test_utf8_decode_invalid_sequences.<locals>.<listcomp>c  r  r            s   c                 .    g | ]}t          |g          S r   r  r  s     r   r  zBUnicodeTest.test_utf8_decode_invalid_sequences.<locals>.<listcomp>h  r  r      )r~   rN   ri  r"   )
r4   continuation_bytesinvalid_2B_seq_start_bytesinvalid_4B_seq_start_bytesinvalid_start_bytesbytesbcbcb1cb3s
             r   "test_utf8_decode_invalid_sequencesz.UnicodeTest.test_utf8_decode_invalid_sequences?  s   DD%d2C2CDDD%L%L%d:K:K%L%L%L"%L%L%d:K:K%L%L%L"!;;&')Q)QeD%>P>P)Q)Q)QR 	
 ( 	H 	HD0$+wGGGG, 	O 	OB( O O!!"4r"ungNNNNO - 	L 	LB)"1"- L L-bqb1 L LC%%&8')#vg~c'9&A7L L L LLL
 :9uT4'8'8999 	D 	DB0&rz'197D D D0&rz'197D D D D :9uT4'8'8999 	D 	DB0&rz'197D D D0&rz'197D D D D99uT4'8'8999 	H 	HB0&rz+5=wH H H0&rz+5=wH H H H99uT4'8'8999 	H 	HB0&rz+5=wH H H0&rz+5=wH H H H	H 	Hr   c                 2   d}g d|fd|dz  fd|fd|dz  fd|fd|dz  fd	|dz  fd
|fd|dz  fd|dz  fd|dz   fd|fd|dz  fd|dz  fd|dz  fd|fd|dz   fd|dz   |z   fd|dz   fd|dz   fd|dz  dz   fd|dz   |z   fd|fd|dz  fd|dz  fd |dz  fd!|d"z  fd#|fd$|fd%|dz   fd&|dz   fd'|dz   fd(|dz   |z   fd)|dz   |dz  z   fd*|dz   |z   dz   fd+|dz   |z   fd,|dz   |z   fd-|dz   |dz  z   fd.|dz  dz   fd/|dz   |dz  z   fd0|fd1|dz  fd2|dz  fd3|dz  fd4|dz  fd5|dz  dz   fd6|dz  dz   |z   fd7|dz   |dz  z   dz   fd8|fd9|dz  fd:|dz  fd;|dz  dz   fd<|d"z  fd=|fd>|dz  fd?|dz  fd@|dAz  fdB|fdC|dz  fdDdEdFdG}t          |          D ]\  }\  }}|                     t          |j        dHdI           |                     |                    dHdJ          |           |                     |dKz                       dHdJ          |dLz              |                     |                    dHdM          |                    ddN                     d S )ON   �r  r  r      s      s   s      s   s   r   s   ArI     s   s   s   r   s   s   As   As   AA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��drX  r   rQ     br   re  rm   )	enumeraterN   ri  r"   r?   rQ  )r4   FFFDr  r  rN  r  s         r   test_issue8271zUnicodeTest.test_issue8271n  s    J
dOJ
 $q&!J
 dO	J

 $q&!J
 dOJ
 $q&!J
 $q&!J
 dOJ
 $q&!J
 d1f%J
 $s(#J
 dOJ
  $q&!!J
" d1f%#J
$ !$q&)%J
& $'J
( $s(#)J
* d3htm,+J
, d4i(-J
. d3h'/J
0 !$q&*-1J
2 !$s(4-03J
6 dO7J
8 $q&!9J
: d1f%;J
< !$q&)=J
> %d1f-?J
@ $AJ
B d#CJ
D d3h'EJ
F !$t),GJ
H !$s(+IJ
J d3htm,KJ
L !$s(46/2MJ
N !$s(4-"34OJ
P !$t)D.1QJ
R !$s(4-0SJ
T !$s(46/2UJ
V !$q&*-WJ
X !$s(46/2YJ
\ dO]J
^ $q&!_J
` $q&!aJ
b d1f%cJ
d !$q&)eJ
f d1fSj)gJ
h !$q&*T/2iJ
j %d3htAvoc&9:kJ
n dOoJ
p $q&!qJ
r $q&!sJ
t d1fsl+uJ
v %d1f-wJ
z dO{J
| $q&!}J
~ d1f%J
@ )$q&1AJ
D dOEJ
F d1f%GJ
J <KJ
L >MJ
N 8OJ
PEQJ
	V 'y11 	8 	8MAzS0#*gxPPPSZZ;;SAAAc$h..w	BBCGLLLSZZ:: [[2668 8 8 8		8 	8r   c                    |                      t                    5 }|                    d           ddd           n# 1 swxY w Y   |j        }|                     |t          |                     |                     |                    dd          |           |                     d|z   dz                       dd          d|z   dz              |                    dd	          }|                     |                    dd
          |           |                     d|z   dz                       dd
          d|z   dz              dS )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.
        rX  NrQ  s   aaaas   bbbbaaaabbbbr  rm   re  )rN   ri  r"   rM  r%  r:   r?   rQ  )r4   rN  r  errrN  rO  s         r   assertCorrectUTF8Decodingz%UnicodeTest.assertCorrectUTF8Decoding  s    122 	 bJJw	  	  	  	  	  	  	  	  	  	  	  	  	  	  	 lc3s88$$$GY77==='C-'199'9MM#.	0 	0 	0kk(B''GX66<<<'C-'199'8LL 3,/	1 	1 	1 	1 	1s   =AAc                 ^    d}dD ]'}|                      t          |g          dd           (dS )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.
        r  s   zinvalid start byteN)r  rG  )r4   r  r  s      r   test_invalid_start_bytez#UnicodeTest.test_invalid_start_byte  sV     7 	A 	AD**5$==(+?A A A A	A 	Ar   c                 z    g d}d}|D ]1}|                      t                              |          dd           2d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.
        )&C2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 BFr  zunexpected end of dataNr  rG  fromhex)r4   r  r  rN  s       r   test_unexpected_end_of_dataz'UnicodeTest.test_unexpected_end_of_data  sk    
 
 
	  	E 	EC**5==+=+=x+CE E E E	E 	Er   c           	          d}|dz  }d|dz   fd|dz   fd|fd|fd	|dz   fd
|dz   fd|fd|fg}|D ]4\  }}|                      t                              |          |d           5dS )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'.
        r  r   zC2 00r!  zC2 7Fr~  zC2 C0zC2 FFzDF 00zDF 7FzDF C0zDF FFinvalid continuation byteNr  r4   r  FFFDx2r  rN  r  s         r   test_invalid_cb_for_2bytes_seqz*UnicodeTest.test_invalid_cb_for_2bytes_seq  s     d6k"Wd6k$:f0d6k"Wd6k$:f0	
	 " 	H 	HHC**5==+=+=s+FH H H H	H 	Hr   c                    d}|dz  }g d|dz   fd|dz   fd|fd|fd	|fd
|fd|dz   fd|dz   fd|fd|fd|dz   fd|dz   fd|fd|fd|dz   fd|dz   fd|fd|fd|dz   fd|dz   fd|fd|fd|dz   fd|dz   fd|fd|fd|dz   fd |dz   fd!|fd"|fd#|dz   fd$|dz   fd%|fd&|fd'|dz   fd(|dz   fd)|fd*|fd+|dz   fd,|dz   fd-|fd.|fd/|fd0|fd1|dz   fd2|dz   fd3|fd4|fd5|dz   fd6|dz   fd7|fd8|fd9|dz   fd:|dz   fd;|fd<|fd=|dz   fd>|dz   fd?|fd@|fdA|dz   fdB|dz   fdC|fdD|fdE|dz   fdF|dz   fdG|fdH|fdI|dz   fdJ|dz   fdK|fdL|fdM|dz   fdN|dz   fdO|fdP|f}|D ]4\  }}|                      t                              |          |dQ           5dRS )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.
        r  r   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 FFr  Nr  r  s         r   test_invalid_cb_for_3bytes_seqz*UnicodeTest.test_invalid_cb_for_3bytes_seq  sy   " "
d6k""
%,d6k$:"
=Df<M"
f"
 '0"
3:F2C"
 f%"
 )3DK'@"
  	"
 $.v"6	"

 f%"

 )3DK'@"
  "
 $.v"6"
 :A$v+8N"
 d6k""
 &-f$5"
 9@7H"
 f%"
 )3DK'@"
  "
 $.v"6"
 f%"
 )3DK'@"
  "
 $.v"6"
 :A$v+8N"
 d6k""
 &-f$5"
 9@7H"
 f%"
 )3DK'@"
  "
 $.v"6"
 f%"
 )3DK'@"
   !"
  $.v"6!"
  :A$v+8N!"
" d6k"#"
$ f%"
$ !(0%"
& f'"
& !(0'"
& 4>tF{2K'"
( f%)"
( )3F';)"
*  +"
* $.tF{";+"
, f%-"
, )3F';-"
.  /"
. $+DK"8/"
0 d6k"1"
0 &-f$51"
0 9@7H1"
2 f%3"
2 )3DK'@3"
4  5"
4 $.v"65"
6 f%7"
6 )3DK'@7"
8  9"
8 $.v"69"
8 :A$v+8N9"
: d6k";"
: &-f$5;"
: 9@7H;"
< f%="
< )3DK'@="
>  ?"
> $.v"6?"
@ f%A"
@ )3DK'@A"
B  C"
B $.v"6C"
	F " 	H 	HHC**5==+=+=s+FH H H H	H 	Hr   c                 v   d}|dz  }g d|dz   fd|dz   fd|fd|fd	|fd
|fd|dz   fd|dz   fd|fd|fd|dz   fd|dz   fd|fd|fd|dz   fd|dz   fd|fd|fd|dz   fd|dz   fd|fd|fd|dz   fd|dz   fd|fd|fd|dz   fd |dz   fd!|fd"|fd#|dz   fd$|dz   fd%|fd&|fd'|dz   fd(|dz   fd)|fd*|fd+|dz   fd,|dz   fd-|fd.|fd/|dz   fd0|dz   fd1|fd2|fd3|dz   fd4|dz   fd5|fd6|fd7|dz   fd8|dz   fd9|fd:|fd;|dz   fd<|dz   fd=|fd>|fd?|dz   fd@|dz   fdA|fdB|fdC|dz   fdD|dz   fdE|fdF|fdG|dz   fdH|dz   fdI|fdJ|fdK|dz   fdL|dz   fdM|fdN|fdO|dz   fdP|dz   fdQ|fdR|fdS|dz   fdT|dz   fdU|fdV|fdW|dz   fdX|dz   fdY|fdZ|fd[|dz   fd\|dz   fd]|fd^|fd_|fd`|fda|dz   fdb|dz   fdc|fdd|fde|dz   fdf|dz   fdg|fdh|fdi|dz   fdj|dz   fdk|fdl|fdm|dz   fdn|dz   fdo|fdp|fdq|dz   fdr|dz   fds|fdt|fdu|dz   fdv|dz   fdw|fdx|f}|D ]4\  }}|                      t                              |          |dy           5dzS ){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.
        r  r   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 FFr  Nr  r  s         r   test_invalid_cb_for_4bytes_seqz*UnicodeTest.test_invalid_cb_for_4bytes_seqQ  sx     8
d6k"8
%,d6k$:8
=Df<M8
f8
 '08
3:F2C8
 f%8
 )3DK'@8
  	8
 $.v"6	8

 f%8

 )3DK'@8
  8
 $.v"68
 DK(8
 ,9$v+*F8
 F#8
 '4V%<8
 DK(8
 ,9$v+*F8
 F#8
 '4V%<8
 DK(8
 ,9$v+*F8
 F#8
 '4V%<8
 DK(8
 ,9$v+*F8
 F#8
 '4V%<8
 d6k"8
 &-d6k$:8
 >Ef<M8
  f!8
  !+DK8!8
" f%#8
" )3F';#8
$  %8
$ $.tF{";%8
& f%'8
& )3F';'8
(  )8
( $1$v+">)8
* DK(+8
* ,9&*A+8
, F#-8
, '4T&[%A-8
. DK(/8
. ,9&*A/8
0 F#18
0 '4T&[%A18
2 DK(38
2 ,9&*A38
4 F#58
4 '4T&[%A58
6 DK(78
6 ,9&*A78
8 F#98
8 '.tF{%;98
: d6k";8
: &-f$5;8
: 9@7H;8
< f%=8
< )3DK'@=8
>  ?8
> $.v"6?8
@ f%A8
@ )3DK'@A8
B  C8
B $.v"6C8
D DK(E8
D ,9$v+*FE8
F F#G8
F '4V%<G8
H DK(I8
H ,9$v+*FI8
J F#K8
J '4V%<K8
L DK(M8
L ,9$v+*FM8
N F#O8
N '4V%<O8
P DK(Q8
P ,9$v+*FQ8
R F#S8
R '4V%<S8
T d6k"U8
T &-d6k$:U8
T >Ef<MU8
V fW8
V !(0W8
V 4;F2CW8
X f%Y8
X )3DK'@Y8
Z  [8
Z $.v"6[8
\ f%]8
\ )3DK'@]8
^  _8
^ $.v"6_8
` DK(a8
` ,9$v+*Fa8
b F#c8
b '4V%<c8
d DK(e8
d ,9$v+*Fe8
f F#g8
f '4V%<g8
h DK(i8
h ,9$v+*Fi8
j F#k8
j '4V%<k8
l DK(m8
l ,9$v+*Fm8
n F#o8
n '4V%<o8
	r " 	H 	HHC**5==+=+=s+FH H H H	H 	Hr   c                 X    |                      d                    d          d           d S )Nzwww.python.org.idnas   www.python.org.)r?   r!   r3   s    r   test_codecs_idnazUnicodeTest.test_codecs_idna  s.    *11&99;MNNNNNr   c                 
   |                      t          dj        d           |                      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	                     |                      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 xrz   r   re  s   Andr xrQ  s   Andr? xre  )r   r   s   Andr xzAndr xu	   Andr� xs    xu   � xs	   \N{foo}xxzunicode-escapexx   \   hellor   r   r   r   r  u   )rN   UnicodeErrorr!   r?   r:   r"   r   r   rJ  r  complexr3   s    r   test_codecs_errorszUnicodeTest.test_codecs_errors  s   ,(;WEEE,(;WXNNN,,WX>>	JJJ,,WY??LLL,,Wi@@%,,WY,GG	I 	I 	I,,Wh??%,,gh,OO	Q 	Q 	Q 	,]GDDD,]GXNNN]GX>>III]GY??PPPY;;ZHHH 	--.>II4PPP 	,6FGGG)X_oFFF)S(ODDD)W^_EEE)W^_EEE 	)W^RR@@@ 	*c8444*c8444*eX666*eX666*gx888*gx88888r   c                    |                      d                    d          d           |                      d                    d          d           |                      d                    d          d           |                      d                    d          d           |                      d                    d          d           |                      d                    d          d	           |                      d                    d
          d           |                      d                                d           t          d          D ]M}t          |          }dD ]9}|                      t	          |                    |          |          |           :Nt          d          D ]M}t          |          }dD ]9}|                      t	          |                    |          |          |           :Nt          d          D ]M}t          |          }dD ]9}|                      t	          |                    |          |          |           :Nt          j                    5  d}dD ]9}|                      t	          |                    |          |          |           :	 d d d            n# 1 swxY w Y   d                    t          t          t          t          dd                    t          t          dd                    z                       }dD ]9}|                      t	          |                    |          |          |           :d S )Nr   rz   r  rq  rX  	utf-16-les
   h e l l o 	utf-16-bes
    h e l l olatin-1u   ☃s   ☃i   )rq  rX  utf-16r  r  raw_unicode_escapeunicode_escapern   )r  r  )rz   u   𐀁𠀂𰀃񀀄񐀅)rX  r  r  r  r  r  rm   r   i   i   rL   )rX  )
r?   r!   r~   r}   r:   rh  catch_warningsr{   r|   list)r4   r   r  r   s       r   test_codecszUnicodeTest.test_codecs  s   00(;;;00(;;;00(;;;00(;;;446RSSS446RSSS	22H=== 	**O<<< t 	F 	FAAA/ F F   QXXh%7%7!A!A1EEEEF s 	F 	FAAA( F F  QXXh%7%7!A!A1EEEEF s 	F 	FAAA& F F  QXXh%7%7!A!A1EEEEF $&& 	F 	FDAE F F  QXXh%7%7!A!A1EEEEF	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F 	F GGCT%6"2"233!%"9"9::; < < = =" 	B 	BHS(!3!3H==qAAAA	B 	Bs   2?J>>KKc                 h   t          t          d                    }dD ]9}|                     t          ||                              |          |           :t          t          dd                    }dD ]9}|                     t          ||                              |          |           :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cp1258cp856cp857cp864cp869cp874	mac_greekmac_iceland	mac_romanmac_turkishcp1006	iso8859_8rn   ) 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
  )rG  r~   r?   r:   r!   )r4   rb  r   s      r   test_codecs_charmapzUnicodeTest.test_codecs_charmap  s    %** 	C 	CH2 SH--44X>>BBBB %S//"" 	C 	CH* SH--44X>>BBBB+	C 	Cr   c                     |                      dd           |                      dd           |                      dd           |                      dd           |                      dd           d S )Nr  r   rU  r3   s    r   test_concatenationzUnicodeTest.test_concatenation3	  sx    +111+111+111+k:::+k:::::r   c                 x   d}|                     d                              d          }|                     ||           d}|                    d                               d          }|                     ||           d}|                    d                               d          }|                     ||           	 d                    d           |                     d           d S # t          $ rA}|                     |j        d           |                     |j        d           Y d }~d S d }~ww xY w)	Nr+  zraw-unicode-escapes
   \U00100000s
   \U00010000s
   \U11111111z%Should have raised UnicodeDecodeErrorr   r   )r!   r"   r?   failri  startend)r4   r   r  r   s       r   	test_ucs4zUnicodeTest.test_ucs4:	  sN   HH)**112FGGAHH)**112FGGAHH)**112FGGA	?!!"6777
 II=>>>>>	 " 	( 	( 	(QWa(((QUB'''''''''	(s   C. .
D986D44D9c                 h    G d d          } G d dt                     } G d dt                     }|                     t           |                      d           |                     t           |d                    d           t           |d                    }|                     |d	           |                     t          |          |           t	           |d                    }|                     |d	           |                     t          |          t                     d S )
Nc                       e Zd Zd ZdS )0UnicodeTest.test_conversion.<locals>.ObjectToStrc                     dS NrB  r   r3   s    r   r;  z8UnicodeTest.test_conversion.<locals>.ObjectToStr.__str__Q	      ur   Nr  r   r   r   ObjectToStrr)  P	  #            r   r-  c                       e Zd Zd ZdS )5UnicodeTest.test_conversion.<locals>.StrSubclassToStrc                     dS r+  r   r3   s    r   r;  z=UnicodeTest.test_conversion.<locals>.StrSubclassToStr.__str__U	  r,  r   Nr  r   r   r   StrSubclassToStrr0  T	  r.  r   r2  c                       e Zd ZddZd ZdS )=UnicodeTest.test_conversion.<locals>.StrSubclassToStrSubclassrm   c                 >    t                               | d|z            S rs  )r:   __new__)r   contents     r   r6  zEUnicodeTest.test_conversion.<locals>.StrSubclassToStrSubclass.__new__Y	  s    {{3'	222r   c                     | S r.   r   r3   s    r   r;  zEUnicodeTest.test_conversion.<locals>.StrSubclassToStrSubclass.__str__[	  rI  r   N)rm   )r(   r)   r*   r6  r;  r   r   r   StrSubclassToStrSubclassr4  X	  s7        3 3 3 3    r   r9  rB  r  foofoo)r:   r?   rX  rA   r&   )r4   r-  r2  r9  rb  s        r   test_conversionzUnicodeTest.test_conversionN	  sg   	 	 	 	 	 	 	 		 	 	 	 	s 	 	 		 	 	 	 	s 	 	 	 	[[]]++U333--e4455u===((//00H%%%d1gg7888007788H%%%d1gg{+++++r   c                      G d d          } G d d          }|                      t           |                      d           |                      t           |                      d           d S )Nc                       e Zd Zd ZdS ))UnicodeTest.test_unicode_repr.<locals>.s1c                     dS N\nr   r3   s    r   r;   z2UnicodeTest.test_unicode_repr.<locals>.s1.__repr__i	  r,  r   Nr<   r   r   r   s1r>  h	  r.  r   rB  c                       e Zd Zd ZdS ))UnicodeTest.test_unicode_repr.<locals>.s2c                     dS r@  r   r3   s    r   r;   z2UnicodeTest.test_unicode_repr.<locals>.s2.__repr__m	  r,  r   Nr<   r   r   r   rp  rD  l	  r.  r   rp  rA  r?   r   )r4   rB  rp  s      r   test_unicode_reprzUnicodeTest.test_unicode_reprg	  s    	 	 	 	 	 	 	 		 	 	 	 	 	 	 	 	bbddU+++bbddU+++++r   c                     |                      t          d          ddz             |                      t          d          d           d S )Nr,  z'%c')   u   𔀀z'\U00014000'rF  r3   s    r   test_printable_reprzUnicodeTest.test_printable_reprs	  sI    l++Vj-@AAAl++_=====r   Pr   z only applies to 32-bit platformsc                 \    |                      t          dj        t          j                   d S )Nzt	t	)rN   rL  
expandtabsrw   rK  r3   s    r   $test_expandtabs_overflows_gracefullyz0UnicodeTest.test_expandtabs_overflows_gracefullyz	  s'     	-)<ckJJJJJr   c                 Z    d}|                      |                                |           d S )NrU   )rX  rM  )r4   rb  s     r   test_expandtabs_optimizationz(UnicodeTest.test_expandtabs_optimization	  s)    allnna(((((r   c                 8  	
 d}|dz   }t          j        |          }t          j        |          }dD ]	t          	          }|dk     rd}|}n|dk     rd}|}n|dk     rd}|}nd	}|}t          j        |z
  |z  
	
fd
}|                     	||          5  |                     t          j        	dz            ||dz  z              |                     t          |           |                     t          |           d d d            n# 1 swxY w Y   d S )NnnbPnPn)r   r  rn  r  r  r   rn   rI  r   r   c                       z  S r.   r   )r  maxlens   r   <lambda>z0UnicodeTest.test_raiseMemError.<locals>.<lambda>	  s    D6M r   )r  struct_size	char_sizer   +   )
r   calcobjsizer  rw   rK  r   r?   	getsizeofrN   r  )r4   asciifieldscompactfieldsascii_struct_sizecompact_struct_sizecoderX  rW  allocr  rU  s            @@r   test_raiseMemErrorzUnicodeTest.test_raiseMemError	  s   #e+#/<<%1-@@9 	6 	6Dt99Dd{{	/	1	1	1 {[0Y>F)))))E'#    6 6   M$),,9#78   !!+u555!!+u5556 6 6 6 6 6 6 6 6 6 6 6 6 6 6'	6 	6s   A(DD	D	c                      G d dt                     } |d          }|                     d|z  d           |                     d                    |          d           d S )Nc                       e Zd Zd ZdS )+UnicodeTest.test_format_subclass.<locals>.Sc                     dS )N__str__ overriddenr   r3   s    r   r;  z3UnicodeTest.test_format_subclass.<locals>.S.__str__	  s    ++r   Nr  r   r   r   r  re  	  s#        , , , , ,r   r  xxxr  rg  r  )r:   r?   r  r4   r  rb  s      r   test_format_subclassz UnicodeTest.test_format_subclass	  s}    	, 	, 	, 	, 	, 	, 	, 	, AeHH#7888Q)=>>>>>r   c                      G d dt                     }|                      |d           |d          z   d            G d dt                     } |d          }|dz  }|                     |d           d S )Nc                       e Zd Zd ZdS )(UnicodeTest.test_subclass_add.<locals>.Sc                     dS NrC  r   r4   ra  s     r   __add__z0UnicodeTest.test_subclass_add.<locals>.S.__add__	      sr   N)r(   r)   r*   rq  r   r   r   r  rm  	  r  r   r  r  r  rC  c                       e Zd Zd ZdS )rm  c                     dS ro  r   rp  s     r   __iadd__z1UnicodeTest.test_subclass_add.<locals>.S.__iadd__	  rr  r   N)r(   r)   r*   ru  r   r   r   r  z(UnicodeTest.test_subclass_add.<locals>.S	  r  r   r@  rD  ri  s      r   test_subclass_addzUnicodeTest.test_subclass_add	  s    	 	 	 	 	 	 	 	 	3!!C&&#...	 	 	 	 	 	 	 	 AcFF	SC     r   c                     d}|                                 }|                     |d         |           |                     |d         |           |                     t          |          d           d S )NrU   r   r   )__getnewargs__assertIsNotr?   r^  )r4   r#   rE   s      r   test_getnewargszUnicodeTest.test_getnewargs	  sn    ""$$a$'''a$'''TA&&&&&r   c                    t          ddd          D ]}d|z  dz   }|                     t                    5  t          j        |          }d d d            n# 1 swxY w Y   |                     ||           |dz  }|                     t                    5  t          j        |          }d d d            n# 1 swxY w Y   |                     ||           |                     ||           d S )Nr   r   r   r   r   r   )r~   assertWarnsr  r  	getargs_ur?   rQ   )r4   lengthr#   rU   r  s        r   test_resizezUnicodeTest.test_resize	  s}    AsA&& 	+ 	+F<#%D !!"455 0 0)$//0 0 0 0 0 0 0 0 0 0 0 0 0 0 0S$''' CKD!!"455 3 3",T223 3 3 3 3 3 3 3 3 3 3 3 3 3 3V,,,VT****	+ 	+s#   AA	A	B88B<	?B<	c                    d}d|z  }d|z  }d|z  }d|z  }d|z  }d|z  }d|z  }d	|z  }	||||||||	f}
t          j        |
d
          D ]\  }}||u }|                     ||k    |           |                     ||k    |            |r|                     ||k               |                     ||k               t	          |          }t	          |          }|                     ||           |                     ||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                |                     ||k               |                     ||k               |                     ||k               |                     ||	k               d S )Nr   r   r  r  rJ   r$  rK   r+  r  r   )	itertoolscombinationsr?   r@   r$   ry  r  )r4   r~  rz   ascii2latinlatin2bmpbmp2astralastral2stringstext1text2equalcopy1copy2s                   r   test_comparezUnicodeTest.test_compare	  sv   aq
!l!|!"66G	
 &27A>> 	0 	0LE5e^EUe^U333Ue^Y777 0//////
 )//(//  ...///  %000//////'''&&&$$$'''&)))%(((#&&&&)))''''''$$$''''''&)))#&&&&)))u%%%u%%%d
###f%%%u%%%u%%%%%%'''%(((%((($'''()))%(((%((($'''7*+++++r   c                     t          j        | t          t                     t          j        | t          t                     d S r.   )r   check_free_after_iteratingr   r:   reversedr3   s    r   test_free_after_iteratingz%UnicodeTest.test_free_after_iterating#
  s2    *4s;;;*43?????r   c                     d}d}t          j        d|d|d|d|d|d|d	|d
          }t          ddd|          }|                     |j        d|           d S )N)rz   utf8latin1zBoom, Shaka Laka, Boom!z0
            import sys
            encodings = zn

            for data in (b'', b'short string'):
                try:
                    str(data, encoding=z)
                except LookupError:
                    pass
                else:
                    sys.exit(21)

                try:
                    str(data, errors=z)
                except LookupError:
                    pass
                else:
                    sys.exit(22)

                for encoding in encodings:
                    try:
                        str(data, encoding, errors=z)
                    except LookupError:
                        pass
                    else:
                        sys.exit(22)

            for data in ('', 'short string'):
                try:
                    data.encode(encoding=z)
                except LookupError:
                    pass
                else:
                    sys.exit(23)

                try:
                    data.encode(errors=z)
                except LookupError:
                    pass
                else:
                    sys.exit(24)

                for encoding in encodings:
                    try:
                        data.encode(encoding, errors=z)
                    except LookupError:
                        pass
                    else:
                        sys.exit(24)

            sys.exit(10)
        z-Xdevz-cr   )textwrapdedentr   r?   rc)r4   	encodingsinvalidr`  procs        r   test_check_encoding_errorsz&UnicodeTest.test_check_encoding_errors'
  s     0	+ 3 "3  3  )03  3  '.3  3 * 5<+3  3 : +2;3  3 H )0I3  3 X 7>Y3  3  3  3 3h %T5$=="d+++++r   )vr(   r)   r*   r:   r  r5   rH   rR   r   r   r   r   r   r   r   r   r   r   r   r   r  r"  r)  r/  r2  rD  unittestskipIfrw   rK  rO  rU  r   cpython_onlyrZ  rc  rl  ru  r  r  r  r  requires_resourcer  r  r  r  r  r  r  r  requires_legacy_unicode_capir  r  r  r  r  r  r  r  r  r  r  
skipUnlessr  r)  r/  r  r  r  r  r  r  r  r6  r9  rE  rH  rJ  rP  run_with_localerV  rc  rf  rk  rv  ry  r  r  r  r  r  r  r  r  r  r  r  r  r  r!  r&  r;  rG  rJ  structcalcsizerN  rP  rb  rj  rv  rz  r  r  r  r  __classcell__)r  s   @r   r,   r,   :   s       
 I< < <6 6 6$, , ,(= (= (=T(< (< (<T3 3 32 2 2< < <A A A8 8 8G G G4+H +H +HZ'I 'I 'IRR R R0S S S4DH DH DHLM M M"; ; ;(R R R"S S S"@ @ @( X_S[5(46 67 76 67
@ @ @. < < <
. . .,? ? ?99 99 99v1 1 1 1 11 1 1 1 1 
K 
K 
K 
K 
KL L L L L Wu%%4 4 &%4G G G G G
1 
1 
1 
1 
11 1 1 1 1
K K K$
I 
I 
I 
I 
IK K K&- - - )X_Y$&(?@@O O A@ *) O5 5 5O O O65 5 5,8 8 85 5 5"H H H"9 9 9 9 9"D D D4< < < X	13KLL
 
  ML
%; %; %;N	, 	, 	,F5 F5 F5P
5M 5M 5Mn1 1 1
1 1 1
0 0 0
I I I<iN iN iNV#+ #+ #+J* * *
K K K X_Y$&(?@@* * A@ *
* * *
( ( ( WXw88. . 98.D6 D6 D6LE E E	P 	P 	P1" 1" 1"fC C CJ7 7 7"-H -H -H^W8 W8 W8r1 1 1&A A AE E E4H H H,8H 8H 8HtMH MH MH^O O O'9 '9 '9R-B -B -B^5C 5C 5Cn; ; ;? ? ?(, , ,2
, 
, 
,> > > X_S[G,I0D0D0I79 9K K9 9K ) ) )$6 $6 $6L? ? ?
! 
! 
!' ' ' )X_Y$&(?@@+ + A@ *) +"H, H, H,T@ @ @:, :, :, :, :, :, :,r   r,   c                        e Zd Zd Zd Zd ZdS )StringModuleTestc                    d } |d          }|                      |g d            |d          }|                      |ddg            |d          }|                      |dg            |d	          }|                      |g             |d
          }|                      |dg           |                     t          t          j        d           d S )Nc                 D    t          t          j        |                     S r.   )r  _stringformatter_parserr?  s    r   parsez5StringModuleTest.test_formatter_parser.<locals>.parsef
  s    088999r   z2prefix {2!s}xxx{0:^+10.3f}{obj.attr!s} {z[0]!s:10}))prefix rA  rm   rb  )rh  r  z^+10.3fN)rm   zobj.attrrm   rb  )rM   zz[0]r  rb  zprefix {} suffix)r  rm   rm   N)z suffixNNNr:   )r:   NNNrm   r  )rm   r  rm   Nr   )r?   rN   r   r  r  )r4   r  	formatters      r   test_formatter_parserz&StringModuleTest.test_formatter_parsere
  s+   	: 	: 	: ENOO	 %
 %
 %
 	 	 	 E,--	%)%
 	 	 	
 E%LL	%%
 	 	 	 E"II	B'''E%LL	%
 	 	 	 	)W%=qAAAAAr   c                 h   d }|                       |d          dg g           |                       |d          ddgg           |                       |d          ddgg           |                       |d          dg dg           |                     t          t          j        d	           d S )
Nc                 x    t          t          j        |                     }t          |d                   |d<   |S )Nr   )r  r  formatter_field_name_split)r<  itemss     r   r!  z?StringModuleTest.test_formatter_field_name_split.<locals>.split
  s2    ;DAABBEE!H~~E!HLr   rb  zobj.argTargzobj[key])Fr  zobj.arg[key1][key2])r  )Fkey1)Fkey2r   )r?   rN   r   r  r  )r4   r!  s     r   test_formatter_field_name_splitz0StringModuleTest.test_formatter_field_name_split
  s    	 	 	 	ur{333y))EM?+CDDDz**U^4D,EFFF455  8 	 	 	 	)W%GKKKKKr   c                 R   t          d          }t          d          } G d d          } |            }|                     t                    5  t          ||           d d d            n# 1 swxY w Y   t	          ||d           |                     |j        d           d|_        |                     t          |j                  |g           |                     t                    5  t          ||           d d d            n# 1 swxY w Y   |                     t                    5  |`	d d d            n# 1 swxY w Y   t	          ||d           |                     |j	        d           d|_	        |                     t          |j                  ||g           d S )	Nr<  name2c                       e Zd ZdS )4StringModuleTest.test_str_subclass_attr.<locals>.BagNr'   r   r   r   Bagr  
  r`  r   r  r   r   r   r   )
r&   rN   AttributeErrordelattrsetattrr?   r<  r  __dict__r  )r4   r<  r  r  ra  s        r   test_str_subclass_attrz'StringModuleTest.test_str_subclass_attr
  s_   6""G$$	 	 	 	 	 	 	 	 CEE~.. 	 	At	 	 	 	 	 	 	 	 	 	 	 	 	 	 	4###aj))D6222~.. 	 	Au	 	 	 	 	 	 	 	 	 	 	 	 	 	 	~.. 	 		 	 	 	 	 	 	 	 	 	 	 	 	 	 	5!!$$$aj))D%=99999s6   A--A14A1.DDD0D??EEN)r(   r)   r*   r  r  r  r   r   r   r  r  d
  sH        B B BBL L L : : : : :r   r  __main__)!__doc__r  r/   r  r!  r   r  rw   r  r  r  rh  test.supportr   r  r   r   test.support.script_helperr   r  ImportErrorr   r$   r:   r&   r   r.  MixinStrUnicodeTestTestCaser,   r  r(   mainr   r   r   <module>r     s             



        ( ( ( ( ( ( & & & & & & & & < < < < < <   III   " " "	 	 	 	 	# 	 	 	g(, g(, g(, g(, g(,,)2(g(, g(, g(,TQH: H: H: H: H:x( H: H: H:V zHMOOOOO s   A	 	AA