ó
ŒwÛjc           @   s¬   d  Z  d d l Z d d l Z d d l m Z y  d d l m Z m Z m Z Wn e	 k
 ro d Z Z Z n Xd e j
 f d	 „  ƒ  YZ d
 „  Z e d k r¨ e ƒ  n  d S(   s¾    Test script for the Unicode implementation.

Written by Bill Tutt.
Modified for Python 2.0 by Fredrik Lundh (fredrik@pythonware.com)

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

iÿÿÿÿN(   t   test_support(   t   INT_MAXt   PY_SSIZE_T_MAXt   UINT_MAXi   i@   i   t   UnicodeNamesTestc           B   sÈ   e  Z d  „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z	 d „  Z
 e j e j e e k  d	 ƒ e j e e j k  d
 ƒ e j d e d d d d e d ƒ ƒ d „  ƒ ƒ ƒ ƒ Z RS(   c         C   s$   t  d | ƒ } |  j | | ƒ | S(   Nu	   u"\N{%s}"(   t   evalt   assertEqual(   t   selft   namet   codet   res(    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_ucn.pyt   checkletter   s    c         C   sœ   d d d d d d d d d d	 d
 d d d d d d d d d d d d d d d g } d } |  j  d j g  t | | ƒ D] } |  j | Œ  ^ qv ƒ | ƒ d  S(   Ns   LATIN CAPITAL LETTER Ts   LATIN SMALL LETTER Hs   LATIN SMALL LETTER Et   SPACEs   LATIN SMALL LETTER Rs   LATIN CAPITAL LETTER Es   LATIN SMALL LETTER Ds   LATIN SMALL LETTER fs   LATIN CAPITAL LeTtEr os   LATIN SMaLl LETTER xs   LATIN SMALL LETTER As   LATIN SMALL LETTER Tt   SpAcEs   LATIN SMALL LETTER Ss   LATIN small LETTER es   LATIN SMALL LETTER Ps	   FULL STOPu   The rEd fOx ate the sheep.u    (   R   t   joint   zipR   (   R   t   charst   stringt   args(    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_ucn.pyt   test_general   s<    	1c         C   s€   d d  l  } xm d j t t t t d ƒ t d ƒ ƒ ƒ ƒ D]> } d | j ƒ  } | j | ƒ } |  j | j	 | ƒ | ƒ q: Wd  S(   Niÿÿÿÿt    t   at   zs   LATIN SMALL LETTER %s(
   t   unicodedataR   t   mapt   chrt   xranget   ordt   uppert   lookupR   R   (   R   R   t   charR   R	   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_ucn.pyt   test_ascii_lettersC   s
    4c         C   sö   |  j  d d ƒ |  j  d d ƒ |  j  d d ƒ |  j  d d ƒ |  j  d	 d
 ƒ |  j  d d ƒ |  j  d d ƒ |  j  d d ƒ |  j  d d ƒ |  j  d d ƒ |  j  d d ƒ |  j  d d ƒ |  j  d d ƒ d d  l } |  j t | j d ƒ d  S(   Ns   HANGUL SYLLABLE GAu   ê°€s   HANGUL SYLLABLE GGWEOSSu   ê¿¨s   HANGUL SYLLABLE DOLSu   ë��s   HANGUL SYLLABLE RYANu   ëž¸s   HANGUL SYLLABLE MWIKu   ë® s   HANGUL SYLLABLE BBWAEMu   ë¾ˆs   HANGUL SYLLABLE SSEOLu   ì�°s   HANGUL SYLLABLE YIu   ì�˜s   HANGUL SYLLABLE JJYOSSu   ì­€s   HANGUL SYLLABLE KYEOLSu   ì¼¨s   HANGUL SYLLABLE PANu   íŒ�s   HANGUL SYLLABLE HWEOKu   í›¸s   HANGUL SYLLABLE HIHu   íž£iÿÿÿÿu   íž¤(   R   R   t   assertRaisest
   ValueErrorR   (   R   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_ucn.pyt   test_hangul_syllablesK   s    c         C   sd   |  j  d d ƒ |  j  d d ƒ |  j  d d ƒ |  j  d d ƒ |  j  d	 d
 ƒ |  j  d d ƒ d  S(   Ns   CJK UNIFIED IDEOGRAPH-3400u   ã�€s   CJK UNIFIED IDEOGRAPH-4DB5u   ä¶µs   CJK UNIFIED IDEOGRAPH-4E00u   ä¸€s   CJK UNIFIED IDEOGRAPH-9FA5u   é¾¥s   CJK UNIFIED IDEOGRAPH-20000u   ð €€s   CJK UNIFIED IDEOGRAPH-2A6D6u   ðª›–(   R   (   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_ucn.pyt   test_cjk_unified_ideographs]   s    c         C   s}   d d  l  } d } xd t d ƒ D]V } t | ƒ } | j | d  ƒ } | d  k	 r |  j | j | ƒ | ƒ | d 7} q q Wd  S(   Niÿÿÿÿi    i   i   (   R   R   t   unichrR   t   NoneR   R   (   R   R   t   countR	   R   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_ucn.pyt   test_bmp_characterse   s    c         C   sD   |  j  d d ƒ |  j  d d ƒ |  j  d d ƒ |  j  d d ƒ d  S(	   Ns   PILCROW SIGNu   Â¶s   REPLACEMENT CHARACTERu   ï¿½s)   HALFWIDTH KATAKANA SEMI-VOICED SOUND MARKu   ï¾Ÿs   FULLWIDTH LATIN SMALL LETTER Au   ï½�(   R   (   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_ucn.pyt   test_misc_symbolso   s    c         C   sb   d d  l  } |  j t | j ƒ |  j t | j d ƒ |  j t | j ƒ |  j t | j d ƒ d  S(   Niÿÿÿÿu   xxu   unknown(   R   R    t	   TypeErrorR   R   t   KeyError(   R   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_ucn.pyt   test_errorsu   s
    c         C   sp   |  j  t t d d d ƒ |  j  t t d d d d d ƒ |  j  t t d d d ƒ |  j  t t d d d ƒ d  S(	   Ns   \N{blah}s   unicode-escapet   stricts   \N{%s}t   xi † s   \N{SPACEs   \NSPACE(   R    t   UnicodeErrort   unicode(   R   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_ucn.pyt   test_strict_eror_handling|   s    s   needs UINT_MAX < SIZE_MAXs   needs UINT_MAX < sys.maxintt   minsizei   t   memusei   i   u   ð�€€c         C   s¢   |  j  } | | j k  rE t j d | j | j t d ƒ f ƒ ‚ n  d d t t d ƒ d } |  j t	 | ƒ t	 d ƒ t d ƒ |  j
 t d	 | j d
 ƒ d  S(   Ns'   not enough memory: %.1fG minimum neededi   i   s   \N{SPACER-   i   t   }s	   \N{SPACE}s   unknown Unicode character names   unicode-escapei   @(   t   test_issue16335R1   t   unittestt   SkipTestR2   t   floatt   intR   R   t   lent   assertRaisesRegexpR.   t   decode(   R   t   sizet   funcR-   (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_ucn.pyR4   ’   s    		$$	(   t   __name__t
   __module__R   R   R   R"   R#   R'   R(   R+   R0   R    t   cpython_onlyR5   t
   skipUnlessR   R   R   t   syst   maxintt
   bigmemtestR9   R4   (    (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_ucn.pyR      s   		%				
			c           C   s   t  j t ƒ d  S(   N(   R    t   run_unittestR   (    (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_ucn.pyt	   test_main¥   s    t   __main__l            l   ÿÿÿÿ (   t   __doc__R5   RB   t   testR    t	   _testcapiR   R   R   t   ImportErrort   TestCaseR   RF   R>   (    (    (    sƒ   /home/sim/yocto/scarthgap/build/tmp/work/x86_64-linux/python-native/2.7.18/recipe-sysroot-native/usr/lib/python2.7/test/test_ucn.pyt   <module>   s    ‘	