o
    ?n0j6
                     @   sb   d Z ddl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	e
dkr/e  dS dS )	zTests for yapf.line_joiner.    N)line_joiner)style)yapf_test_helperc                   @   sP   e Zd Ze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 )LineJoinerTestc                 C   s   t t   d S )N)r   ZSetGlobalStyleZCreatePEP8Style)cls r   a/home/wildlama/miniconda3/envs/lam_a2e/lib/python3.10/site-packages/yapftests/line_joiner_test.py
setUpClass   s   zLineJoinerTest.setUpClassc                 C   s    t |}| t|| dS )zCheck that the given LogicalLines are joined as expected.

    Arguments:
      code: The code to check to see if we can join it.
      join_lines: True if we expect the lines to be joined.
    N)r   ZParseAndUnwrapZassertCodeEqualr   ZCanMergeMultipleLines)selfcode
join_linesZllinesr   r   r   _CheckLineJoining   s   
z LineJoinerTest._CheckLineJoiningc                 C      t d}| j|dd d S )Nz0        if isinstance(a, int): continue
        Tr   textwrapdedentr   r
   r   r   r   r   testSimpleSingleLineStatement)      
z,LineJoinerTest.testSimpleSingleLineStatementc                 C   r   )Nz<        if isinstance(b, int):
            continue
        Fr   r   r   r   r   r   testSimpleMultipleLineStatement/   s   
z.LineJoinerTest.testSimpleMultipleLineStatementc                 C   r   )NzX        if isinstance(c, int):
            while True:
                continue
        Fr   r   r   r   r   r   &testSimpleMultipleLineComplexStatement6   s   
z5LineJoinerTest.testSimpleMultipleLineComplexStatementc                 C   r   )NzR        if isinstance(d, int): continue  # We're pleased that d's an int.
        Tr   r   r   r   r   r   *testSimpleMultipleLineStatementWithComment>   r   z9LineJoinerTest.testSimpleMultipleLineStatementWithCommentc                 C   r   )Nz3        if isinstance(e, int):    continue
        Tr   r   r   r   r   r   .testSimpleMultipleLineStatementWithLargeIndentD   r   z=LineJoinerTest.testSimpleMultipleLineStatementWithLargeIndentc                 C   r   )Nzp        if instance(bbbbbbbbbbbbbbbbbbbbbbbbb, int): cccccccccccccccccccccccccc = ddddddddddddddddddddd
        Fr   r   r   r   r   r   testOverColumnLimitJ   r   z"LineJoinerTest.testOverColumnLimitN)__name__
__module____qualname__classmethodr	   r   r   r   r   r   r   r   r   r   r   r   r      s    

r   __main__)__doc__r   ZunittestZyapf.yapflibr   r   Z	yapftestsr   ZYAPFTestr   r   mainr   r   r   r   <module>   s   8