B
    ž†\	  ã               @   s8   d dl mZ G dd„ deƒZedkr4d dlZe ¡  dS )é    )Ú
CythonTestc               @   sl   e Zd 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d„ Zdd„ Zdd„ Zdd„ ZdS )ÚTestCodeWriterc             C   s   |   ||  |¡j¡ d S )N)Z
assertCodeZfragmentÚroot)ÚselfZcodestr© r   ú:lib/python3.7/site-packages/Cython/Tests/TestCodeWriter.pyÚt   s    zTestCodeWriter.tc             C   s   |   d¡ d S )Nzw
                    print x, y
                    print x + y ** 2
                    print x, y, z,
               )r   )r   r   r   r   Ú
test_print   s    zTestCodeWriter.test_printc             C   s   |   d¡ d S )Nzif x:
    pass)r   )r   r   r   r   Útest_if   s    zTestCodeWriter.test_ifc             C   s   |   d¡ d S )Na   
                    if x:
                        pass
                    elif y:
                        pass
                    elif z + 34 ** 34 - 2:
                        pass
                    else:
                        pass
                )r   )r   r   r   r   Útest_ifelifelse   s    	zTestCodeWriter.test_ifelifelsec             C   s   |   d¡ d S )Nzœ
                    def f(x, y, z):
                        pass
                    def f(x = 34, y = 54, z):
                        pass
               )r   )r   r   r   r   Útest_def*   s    zTestCodeWriter.test_defc             C   s   |   d¡ d S )Nz8def f(unsigned long long long long long int y):
    pass)r   )r   r   r   r   Útest_longness_and_signedness2   s    z+TestCodeWriter.test_longness_and_signednessc             C   s   |   d¡ d S )Nz#def f(signed short int y):
    pass)r   )r   r   r   r   Útest_signed_short5   s    z TestCodeWriter.test_signed_shortc             C   s   |   d¡ d S )Nz+def f(int x, unsigned long int y):
    pass)r   )r   r   r   r   Útest_typed_args8   s    zTestCodeWriter.test_typed_argsc             C   s   |   d¡ d S )Nzh
                    cdef int hello
                    cdef int hello = 4, x = 3, y, z
                )r   )r   r   r   r   Útest_cdef_var;   s    zTestCodeWriter.test_cdef_varc             C   s   |   d¡ d S )Nz«
                    for x, y, z in f(g(h(34) * 2) + 23):
                        print x, y, z
                    else:
                        print 43
                )r   )r   r   r   r   Útest_for_loopA   s    zTestCodeWriter.test_for_loopc             C   s   |   d¡ d S )Nzx += 43)r   )r   r   r   r   Útest_inplace_assignmentI   s    z&TestCodeWriter.test_inplace_assignmentc             C   s   |   d¡ d S )Nza.x)r   )r   r   r   r   Útest_attributeL   s    zTestCodeWriter.test_attributeN)Ú__name__Ú
__module__Ú__qualname__r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   r      s   r   Ú__main__N)ZCython.TestUtilsr   r   r   ZunittestÚmainr   r   r   r   Ú<module>   s   L