o
    ȷe.                     @   sP   d Z ddlZdd Zdd Zdd Zd	d
 Zdd Zdd Zdd Zdd Z	dS )zCore tests module for wcwidth.    Nc                  C   sF   d} d}t |}tttj| }t| }||ksJ ||ks!J dS )u   
    Width of Japanese phrase: コンニチハ, セカイ!

    Given a phrase of 5 and 3 Katakana ideographs, joined with
    3 English-ASCII punctuation characters, totaling 11, this
    phrase consumes 19 cells of a terminal emulator.
       コンニチハ, セカイ!)   r   r   r   r      r   r   r   r   r   N)sumtuplemapwcwidthwcswidthphraseexpect_length_eachexpect_length_phraselength_eachlength_phrase r   N/var/www/ideatree/venv/lib/python3.10/site-packages/wcwidth/tests/test_core.pytest_hello_jp   s   	
r   c                  C   s0   d} d}d}t |}t| |}||ksJ dS )z
    Test wcswidth() optional 2nd parameter, ``n``.

    ``n`` determines at which position of the string
    to stop counting length.
    r      )r   r   r   r   r   r   r   N)r   r   r	   )r   endr   r   r   r   r   r   test_wcswidth_substr   s   r   c                  C   sL   d} d}t |}tttj| }t| t| }||ksJ ||ks$J dS )zNULL (0) reports width 0.zabc def)r   r   r   r   r   r   r   N)r   r   r   r   r	   lenr
   r   r   r   test_null_width_00   s   r   c                  C   H   d} d}d}t ttj| }t| t| }||ksJ ||ks"J dS )z1CSI (Control sequence initiate) reports width -1.z[0m)r   r   r   r   Nr   r   r   r	   r   r
   r   r   r    test_control_c0_width_negative_1@      r   c                  C   r   )z/Simple test combining reports total width of 4.u   --ֿ--)r   r   r   r   r      Nr   r
   r   r   r   test_combining_width_negative_1P   r   r   c                  C   r   )u:   Phrase cafe + COMBINING ACUTE ACCENT is café of length 4.u   café)r   r   r   r   r   r   Nr   r
   r   r   r   test_combining_cafe`      r   c                  C   r   )uZ   CYRILLIC CAPITAL LETTER A + COMBINING CYRILLIC HUNDRED THOUSANDS SIGN is А҈ of length 1.u   А҈)r   r   r   Nr   r
   r   r   r   test_combining_enclosingo   r    r!   c                  C   r   )u2   Balinese kapal (ship) is ᬓᬨᬮ᭄ of length 4.u   ᬓᬨᬮ᭄)r   r   r   r   r   Nr   r
   r   r   r   test_combining_spacing~   r    r"   )
__doc__r   r   r   r   r   r   r   r!   r"   r   r   r   r   <module>   s   