
    i                     d    S SK r S SKJr  SSKJr  SSKJrJrJr   " S S\5      r	 " S S	\5      r
g)
    N)TestCase   )Naming)_indent_chunkUtilityCodeprocess_utility_ccodec                   >    \ rS rSrS rS rS rS rS rS r	S r
S	rg
)
TestIndent   c                 |   [        S5       H  n[        R                  " USU-  5      nUR                  5        H8  nU R	                  US:H  =(       d    UR                  5       [        U5      5        M:     U R                  US9   [        XS9nU R                  XF5        S S S 5        M     g ! , (       d  f       M  = f)N     )indentation)indentation_length)
rangetextwrapindent
splitlines
assertTruestripreprsubTestr   assertEqual)selfchunkexpectedr   expected_indentedlineresults          ^/var/www/html/banglarbhumi/venv/lib/python3.13/site-packages/Cython/Compiler/Tests/TestCode.py_test_indentationsTestIndent._test_indentations   s     9K (#:K L)446
 :djjlDJG 7 +6&uM  !2; 76 % 76s   B,,
B;	c                 (    U R                  SS5        g )Nr   r"   r   s    r!   test_indent_emptyTestIndent.test_indent_empty   s    B'    c                     U R                  SS5        U R                  SS5        U R                  SS5        U R                  SS5        U R                  SS5        g )N


z


z 
 
z
  
 
    
z



r%   r&   s    r!   test_indent_empty_lines"TestIndent.test_indent_empty_lines   sS    d+//0 16:r)   c                 (    U R                  SS5        g )Nabcr%   r&   s    r!   test_indent_one_lineTestIndent.test_indent_one_line   s    u-r)   c                 .    SnSnU R                  X5        g )Nz
            x = 1
            if x == 2:
                print("False")
            else:
                print("True")
        z=
x = 1
if x == 2:
    print("False")
else:
    print("True")
r%   r   r   r   s      r!   test_indent_chunkTestIndent.test_indent_chunk    s      	0r)   c                 .    SnSnU R                  X5        g )N
            x = 1

            if x == 2:
                print("False")
            else:
                print("True")
        >
x = 1

if x == 2:
    print("False")
else:
    print("True")
r%   r4   s      r!   test_indent_empty_line!TestIndent.test_indent_empty_line1   s      	0r)   c                 t    SR                  SS9nSUS'   SR                  U5      nSnU R                  X#5        g )Nr8   T)keependsz            
r   r   r9   )r   joinr"   )r   linesr   r   s       r!   test_indent_empty_line_unclean)TestIndent.test_indent_empty_line_uncleanD   sI     JJ% 	 $a 	0r)    N)__name__
__module____qualname____firstlineno__r"   r'   r-   r1   r5   r:   r@   __static_attributes__rB   r)   r!   r
   r
      s%    	<(;.1"1&1r)   r
   c                   B    \ rS rSrS rSS\S\4S jjrS rS rS r	S	r
g
)TestUtilityCodeProcessingZ   c                 Z    [        5       n[        US U5      u  p4U R                  U5        U$ )N)r   r   assertFalse)r   codeutility_codeformatted_codeis_module_specifics        r!   _process"TestUtilityCodeProcessing._process[   s1    "}-B<QUW[-\*+,r)   rM   r   c                     U(       a  [         R                  " U5      nUR                  5       S-   nU R                  U5      nU R	                  XB5        g )Nr,   )r   dedentr   rQ   r   )r   rM   r   rT   	formatteds        r!   assert_formatted_code/TestUtilityCodeProcessing.assert_formatted_codea   s@    x0H>>#f,MM$'	-r)   c                 &    U R                  SSSS9  g )Nz
        Some Text and a CSTRING("""
        spanning "multiple" 'lines'.
        Really.
        """);   # end of C string
        z
        Some Text and a "\n"
        "        spanning \042multiple\042 'lines'.\n"
        "        Really.\n"
        "        \n"
        ;   # end of C string
        T)r   rT   )rV   r&   s    r!   test_format_cstring-TestUtilityCodeProcessing.test_format_cstringh   s$    "" $  	# 	r)   c           
          U R                  SS[        R                   S[        R                   S[        R                   S3S9  g )NzB
        CGLOBAL(name)
        NAMED_CGLOBAL(empty_tuple)
        	
        z->name
        ->r   )rV   r   modulestateglobal_cnameempty_tupler&   s    r!   test_cglobal&TestUtilityCodeProcessing.test_cglobalx   sS    "" $			'	'( )			'	'(6+=+=*> ?		 	# 	r)   c                     U R                  SS[        R                   S[        R                   [        R                   S[        R                   S[        R                   S[        R                   S[        R                   S[        R                   S[        R                   S[        R
                   S[        R                   S[        R                   S[        R                   S[        R                   S3S9  g )Nz
        EMPTY(tuple)EMPTY(bytes)
        EMPTY(tuple);EMPTY(bytes)
        EMPTY(unicode)
        EMPTY(bytes)
        EMPTY(tuple)
        r\   r]   ;r^   )rV   r   r_   r`   empty_bytesempty_unicoder&   s    r!   test_empty_builtin,TestUtilityCodeProcessing.test_empty_builtin   s    "" $			'	'(6+=+=*>v?]?]>^^`agasas`t u			'	'(6+=+=*>a@^@^?__abhbtbtau v			'	'(6+?+?*@ A			'	'(6+=+=*> ?			'	'(6+=+=*> ?	 	# 	r)   rB   N)F)rC   rD   rE   rF   rQ   strrV   rY   ra   rg   rG   rB   r)   r!   rI   rI   Z   s)    .# . . r)   rI   )r   unittestr   r   r   Coder   r   r   r
   rI   rB   r)   r!   <module>rl      s/       D DP1 P1f6 6r)   