
    -Ph                     d    d dl Z d dlmZ d dlmZ d dlmZ d Zd Z	 G d de j
                  ZdS )	    N)
PyrexTypesNameNodeCFuncTypeArgc                  T    t          j        t           j        d | D                       S )Nc                 0    g | ]}t          d |d          S )nameNr   ).0arg_types     k/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/Cython/Compiler/Tests/TestSignatureMatching.py
<listcomp>zcfunctype.<locals>.<listcomp>	   s$    JJJ8,vx
.
.JJJ    )pt	CFuncType
c_int_type)	arg_typess    r   	cfunctyper      s.    <JJyJJJL L Lr   c                 6    t          j        | d d| z   |          S )NCPP_)r   CppClassType)r
   base_classess     r   cppclasstyper      s    ?4vd{LAAAr   c                   0    e Zd ZdZd Zd Zd Zd Zd ZdS )SignatureMatcherTestzJ
    Test the signature matching algorithm for overloaded signatures.
    c                     t          j        ||          }||                     d |           |                     ||j                   d S )N)r   
best_matchassertNotEqualassertEqualtype)selfexpected_typer   	functionsmatchs        r   assertMatchesz"SignatureMatcherTest.assertMatches   sM    i33$e,,,
33333r   c                    t          t          j        t          j                            t          t          j        t          j                            t          t          j        t          j                            g}d |D             }|                     |d         t          j        g|           |                     |d         t          j        g|           |                     |d         t          j        g|           d S )Nc                 0    g | ]}t          d |          S N)r    r   r   ts     r   r   zFSignatureMatcherTest.test_cpp_reference_single_arg.<locals>.<listcomp>   %    FFFht!,,,FFFr   r         )r   r   CReferenceTyper   c_long_typec_double_typer%   r!   function_typesr#   s      r   test_cpp_reference_single_argz2SignatureMatcherTest.test_cpp_reference_single_arg   s    b'6677b'7788b'(899:: GFnFFF	>!,r}oyIII>!,r~.>	JJJ>!,r/?.@)LLLLLr   c                 p   t          t          j        t          j                  t          j        t          j                            t          t          j        t          j                  t          j        t          j                            g}d |D             }|                     |d         t          j        t          j        g|           |                     |d         t          j        t          j        g|           |                     |d         t          j        t          j        g|           d S )Nc                 0    g | ]}t          d |          S r(   r   r)   s     r   r   zDSignatureMatcherTest.test_cpp_reference_two_args.<locals>.<listcomp>,   r+   r   r   r,   )r   r   r.   r   r/   r%   r1   s      r   test_cpp_reference_two_argsz0SignatureMatcherTest.test_cpp_reference_two_args$   s    !"-00"2CBN2S2SU U!".1123DR^3T3TV V GFnFFF	>!,r}bn.MyYYY>!,r~r~.NPYZZZ>!,r~r}.MyYYYYYr   c                 |   d t          d          D             }t          t          j        |d                             t          t          j        |d                             g}d |D             }|                     |d         |d         g|           |                     |d         |d         g|           d S )Nc                 4    g | ]}t          d |z  g           S zTest%dr   r   is     r   r   zESignatureMatcherTest.test_cpp_reference_cpp_class.<locals>.<listcomp>2   &    FFFqLAr22FFFr   r-   r   r,   c                 0    g | ]}t          d |          S r(   r   r)   s     r   r   zESignatureMatcherTest.test_cpp_reference_cpp_class.<locals>.<listcomp>8   r+   r   )ranger   r   r.   r%   r!   classesr2   r#   s       r   test_cpp_reference_cpp_classz1SignatureMatcherTest.test_cpp_reference_cpp_class1   s    FFE!HHFFFb'
3344b'
3344
 GFnFFF	>!,wqzlIFFF>!,wqzlIFFFFFr   c           	      T   d t          d          D             }t          t          j        |d                   t          j                  t          t          j        |d                   t          j                  t          t          j        |d                   t          j                  t          t          j        |d                   t          j                  g}d |D             }|                     |d         |d         t          j        g|           |                     |d         |d         t          j        g|           |                     |d         |d         t          j        g|           |                     |d         |d         t          j        g|           d S )Nc                 4    g | ]}t          d |z  g           S r9   r:   r;   s     r   r   zMSignatureMatcherTest.test_cpp_reference_cpp_class_and_int.<locals>.<listcomp>=   r=   r   r-   r   r,   c                 0    g | ]}t          d |          S r(   r   r)   s     r   r   zMSignatureMatcherTest.test_cpp_reference_cpp_class_and_int.<locals>.<listcomp>E   r+   r      )r?   r   r   r.   r   r/   r%   r@   s       r   $test_cpp_reference_cpp_class_and_intz9SignatureMatcherTest.test_cpp_reference_cpp_class_and_int<   sV   FFE!HHFFFb'
33R]CCb'
33R^DDb'
33R]CCb'
33R^DD	 GFnFFF	>!,wqz2=.I9UUU>!,wqz2>.JIVVV>!,wqz2=.I9UUU>!,wqz2>.JIVVVVVr   N)	__name__
__module____qualname____doc__r%   r3   r6   rB   rG    r   r   r   r      sw         4 4 4
M 
M 
MZ Z Z	G 	G 	GW W W W Wr   r   )unittestCython.Compilerr   r   Cython.Compiler.ExprNodesr   Cython.Compiler.PyrexTypesr   r   r   TestCaser   rL   r   r   <module>rR      s     , , , , , , . . . . . . 3 3 3 3 3 3L L LB B B;W ;W ;W ;W ;W8, ;W ;W ;W ;W ;Wr   