a
    Ø
þdû  ã                   @   sh   d Z ddlZddlmZ ddlmZ ddlmZ G dd„ dejƒZ	G dd	„ d	ejƒZ
ed
krde ¡  dS )zTests for yapf.format_token.é    N)Úpytree)Útoken)Úformat_tokenc                   @   s$   e Zd Zdd„ Zdd„ Zdd„ ZdS )Ú"TabbedContinuationAlignPaddingTestc                 C   sV   d}t  d|d¡}|  |d¡ t  d|d¡}|  |d¡ t  d|d¡}|  |d¡ d S )NÚSPACEr   é   Ú z  é   z     ©r   Z_TabbedContinuationAlignPaddingÚassertEqual©ÚselfZalign_styleÚpad© r   úd/var/www/html/stable-diffusion-webui/venv/lib/python3.9/site-packages/yapftests/format_token_test.pyÚ	testSpace   s    z,TabbedContinuationAlignPaddingTest.testSpacec                 C   sV   d}t  d|d¡}|  |d¡ t  d|d¡}|  |d¡ t  d|d¡}|  |d¡ d S )	NZFIXEDr   é   r   r   ú	r	   ú		r
   r   r   r   r   Ú	testFixed&   s    z,TabbedContinuationAlignPaddingTest.testFixedc                 C   sp   d}t  d|d¡}|  |d¡ t  d|d¡}|  |d¡ t  d|d¡}|  |d¡ t  d|d¡}|  |d¡ d S )	NzVALIGN-RIGHTr   r   r   r   r   r	   r   r
   r   r   r   r   ÚtestVAlignRight2   s    z2TabbedContinuationAlignPaddingTest.testVAlignRightN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r      s   r   c                   @   s   e Zd Zdd„ Zdd„ ZdS )ÚFormatTokenTestc                 C   sh   t  t tjd¡d¡}|  dt|ƒ¡ |  |j	¡ t  t tj
d¡d¡}|  dt|ƒ¡ |  |j¡ d S )Nz'hello world'ÚSTRINGzTFormatToken(name=DOCSTRING, value='hello world', column=0, lineno=0, splitpenalty=0)z# A commentÚCOMMENTzPFormatToken(name=COMMENT, value=# A comment, column=0, lineno=0, splitpenalty=0))r   ÚFormatTokenr   ÚLeafr   r   r   ÚstrÚ
assertTrueÚ	is_stringr   Z
is_comment©r   Útokr   r   r   Ú
testSimpleD   s     ÿþÿþzFormatTokenTest.testSimplec                 C   sH   t  t tjd¡d¡}|  |j¡ t  t tjd¡d¡}|  |j¡ d S )Nz"""hello"""r   zr"""hello""")r   r   r   r   r   r   r    Zis_multiline_stringr"   r   r   r   ÚtestIsMultilineStringS   s    ÿÿz%FormatTokenTest.testIsMultilineStringN)r   r   r   r$   r%   r   r   r   r   r   B   s   r   Ú__main__)Ú__doc__ZunittestZyapf_third_party._ylib2to3r   Z yapf_third_party._ylib2to3.pgen2r   Zyapf.yapflibr   ZTestCaser   r   r   Úmainr   r   r   r   Ú<module>   s   *