o
    ¢øÁf×  ã                   @   s<   d dl mZ G dd„ deƒZedkrd dlZe ¡  dS dS )é    )Ú
CythonTestc                   @   sŒ   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d„ Zdd„ Zdd„ Zdd „ Zd!S )"ÚTestCodeWriterc                 C   s   |   ||  |¡j¡ d S )N)Ú
assertCodeÚfragmentÚroot)ÚselfÚcodestr© r	   úW/var/www/html/mig_web/myenv/lib/python3.10/site-packages/Cython/Tests/TestCodeWriter.pyÚt   s   zTestCodeWriter.tc                 C   ó   |   d¡ d S )Nz’
                    print(x + y ** 2)
                    print(x, y, z)
                    print(x + y, x + y * z, x * (y + z))
               ©r   ©r   r	   r	   r
   Ú
test_print   ó   zTestCodeWriter.test_printc                 C   r   )Nzif x:
    passr   r   r	   r	   r
   Útest_if   r   zTestCodeWriter.test_ifc                 C   r   )Na   
                    if x:
                        pass
                    elif y:
                        pass
                    elif z + 34 ** 34 - 2:
                        pass
                    else:
                        pass
                r   r   r	   r	   r
   Útest_ifelifelse   r   zTestCodeWriter.test_ifelifelsec                 C   r   )Nzœ
                    def f(x, y, z):
                        pass
                    def f(x = 34, y = 54, z):
                        pass
               r   r   r	   r	   r
   Útest_def*   r   zTestCodeWriter.test_defc                 C   r   )Na¦  
                    cdef f(x, y, z):
                        pass
                    cdef public void (x = 34, y = 54, z):
                        pass
                    cdef f(int *x, void *y, Value *z):
                        pass
                    cdef f(int **x, void **y, Value **z):
                        pass
                    cdef inline f(int &x, Value &z):
                        pass
               r   r   r	   r	   r
   Ú	test_cdef2   r   zTestCodeWriter.test_cdefc                 C   r   )Nz8def f(unsigned long long long long long int y):
    passr   r   r	   r	   r
   Útest_longness_and_signedness@   r   z+TestCodeWriter.test_longness_and_signednessc                 C   r   )Nz#def f(signed short int y):
    passr   r   r	   r	   r
   Útest_signed_shortC   r   z TestCodeWriter.test_signed_shortc                 C   r   )Nz+def f(int x, unsigned long int y):
    passr   r   r	   r	   r
   Útest_typed_argsF   r   zTestCodeWriter.test_typed_argsc                 C   r   )Nzh
                    cdef int hello
                    cdef int hello = 4, x = 3, y, z
                r   r   r	   r	   r
   Útest_cdef_varI   r   zTestCodeWriter.test_cdef_varc                 C   s   |   d¡ |   d¡ d S )Nz­
                    for x, y, z in f(g(h(34) * 2) + 23):
                        print(x, y, z)
                    else:
                        print(43)
                zž
                    for abc in (1, 2, 3):
                        print(x, y, z)
                    else:
                        print(43)
                r   r   r	   r	   r
   Útest_for_loopO   s   
zTestCodeWriter.test_for_loopc                 C   r   )Nz¦
                    while True:
                        while True:
                            while True:
                                continue
                r   r   r	   r	   r
   Útest_while_loop]   r   zTestCodeWriter.test_while_loopc                 C   r   )Nzx += 43r   r   r	   r	   r
   Útest_inplace_assignmente   r   z&TestCodeWriter.test_inplace_assignmentc                 C   r   )Nzx = y = z = abc = 43r   r   r	   r	   r
   Útest_cascaded_assignmenth   r   z'TestCodeWriter.test_cascaded_assignmentc                 C   r   )Nza.xr   r   r	   r	   r
   Útest_attributek   r   zTestCodeWriter.test_attributec                 C   r   )Na¹  
                    def f(x, y, z):
                        return
                    cdef f(x, y, z):
                        return
                    def f(x, y, z):
                        return None
                    cdef f(x, y, z):
                        return None
                    def f(x, y, z):
                        return 1234
                    cdef f(x, y, z):
                        return 1234
               r   r   r	   r	   r
   Útest_return_nonen   r   zTestCodeWriter.test_return_noneN)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r	   r	   r	   r
   r      s"    r   Ú__main__N)ÚCython.TestUtilsr   r   r   ÚunittestÚmainr	   r	   r	   r
   Ú<module>   s    {þ