
    `N`S                         d Z ddlZddlmZ ddlmZ ddlmZ  G d dej                  Z	 G d d	ej                  Z
ed
k    r ej                     dS dS )zTests for yapf.format_token.    N)pytree)token)format_tokenc                        e Zd Zd Zd Zd ZdS )"TabbedContinuationAlignPaddingTestc                    d}t          j        d|d          }|                     |d           t          j        d|d          }|                     |d           t          j        d|d          }|                     |d           d S )NSPACEr       z     z     r   _TabbedContinuationAlignPaddingassertEqualselfalign_stylepads      ;lib/python3.11/site-packages/yapftests/format_token_test.py	testSpacez,TabbedContinuationAlignPaddingTest.testSpace   s    K

6q+q
I
ICS"

6q+q
I
ICS'"""

6q+q
I
ICS'"""""    c                    d}t          j        d|d          }|                     |d           t          j        d|d          }|                     |d           t          j        d|d          }|                     |d           d S )	NFIXEDr      r   r
   	r   		r   r   s      r   	testFixedz,TabbedContinuationAlignPaddingTest.testFixed&   s    K

6q+q
I
ICS"

6q+q
I
ICS$

6q+q
I
ICS(#####r   c                 j   d}t          j        d|d          }|                     |d           t          j        d|d          }|                     |d           t          j        d|d          }|                     |d           t          j        d|d          }|                     |d           d S )	NzVALIGN-RIGHTr   r   r   r
   r   r   r   r   r   s      r   testVAlignRightz2TabbedContinuationAlignPaddingTest.testVAlignRight2   s     K

6q+q
I
ICS"

6q+q
I
ICS$

6q+q
I
ICS$

6q+q
I
ICS(#####r   N)__name__
__module____qualname__r   r   r    r   r   r   r      sA        
# 
# 
#
$ 
$ 
$$ $ $ $ $r   r   c                       e Zd Zd Zd ZdS )FormatTokenTestc                    t          j        t          j        t          j        d                    }|                     dt          |                     |                     |j	                   t          j        t          j        t          j
        d                    }|                     dt          |                     |                     |j                   d S )Nz'hello world'z7FormatToken(name=STRING, value='hello world', lineno=0)z# A commentz6FormatToken(name=COMMENT, value=# A comment, lineno=0))r   FormatTokenr   Leafr   STRINGr   str
assertTrue	is_stringCOMMENT
is_commentr   toks     r   
testSimplezFormatTokenTest.testSimpleD   s    

"6;u|_#M#M
N
NCNXX  OOCM"""

"6;u}m#L#L
M
MCMXX  OOCN#####r   c                 2   t          j        t          j        t          j        d                    }|                     |j                   t          j        t          j        t          j        d                    }|                     |j                   d S )Nz"""hello"""zr"""hello""")r   r&   r   r'   r   r(   r*   is_multiline_stringr.   s     r   testIsMultilineStringz%FormatTokenTest.testIsMultilineStringO   sn    

"6;u|]#K#K
L
LCOOC+,,,

"6;u|^#L#L
M
MCOOC+,,,,,r   N)r   r    r!   r0   r3   r"   r   r   r$   r$   B   s2        	$ 	$ 	$- - - - -r   r$   __main__)__doc__unittestlib2to3r   lib2to3.pgen2r   yapf.yapflibr   TestCaser   r$   r   mainr"   r   r   <module>r<      s    # "              % % % % % %'$ '$ '$ '$ '$): '$ '$ '$T- - - - -h' - - -* z(-///// r   