
    Ae
                     f    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y)	    N)
PyrexTypes)NameNode)CFuncTypeArgc                      t        j                  t         j                  | D cg c]  }t        d|d        c}      S c c}w )Nname)pt	CFuncType
c_int_typer   )	arg_typesarg_types     Klib/python3.12/site-packages/Cython/Compiler/Tests/TestSignatureMatching.py	cfunctyper      s5    <<?HJ8,vx
.JL LJs   >
c                 8    t        j                  | d d| z   |      S )NCPP_)r   CppClassType)r   base_classess     r   cppclasstyper      s    ??4vd{LAA    c                   .    e Zd ZdZd Zd Zd Zd Zd Zy)SignatureMatcherTestzJ
    Test the signature matching algorithm for overloaded signatures.
    c                     t        j                  ||      }|| j                  d |       | j                  ||j                         y )N)r   
best_matchassertNotEqualassertEqualtype)selfexpected_typer   	functionsmatchs        r   assertMatchesz"SignatureMatcherTest.assertMatches   s<    i3$e,

3r   c                 &   t        t        j                  t        j                              t        t        j                  t        j                              t        t        j                  t        j
                              g}|D cg c]  }t        d |       }}| j                  |d   t        j                  g|       | j                  |d   t        j                  g|       | j                  |d   t        j
                  g|       y c c}w )Nr   r         )r   r   CReferenceTyper
   c_long_typec_double_typer   r    r   function_typestr   s       r   test_cpp_reference_single_argz2SignatureMatcherTest.test_cpp_reference_single_arg   s    b''67b''78b''(8(89: 7EFht!,F	F>!,r}}oyI>!,r~~.>	J>!,r/?/?.@)L Gs   Dc                    t        t        j                  t        j                        t        j                  t        j                              t        t        j                  t        j                        t        j                  t        j                              g}|D cg c]  }t        d |       }}| j                  |d   t        j                  t        j                  g|       | j                  |d   t        j                  t        j                  g|       | j                  |d   t        j                  t        j                  g|       y c c}w )Nr"   r   r#   )r   r   r%   r
   r&   r   r    r(   s       r   test_cpp_reference_two_argsz0SignatureMatcherTest.test_cpp_reference_two_args$   s    !!"--0"2C2CBNN2SU!!"..123D3DR^^3TV 7EFht!,F	F>!,r}}bnn.MyY>!,r~~r~~.NPYZ>!,r~~r}}.MyY Gs   !Ec                    t        d      D cg c]  }t        d|z  g        }}t        t        j                  |d               t        t        j                  |d               g}|D cg c]  }t        d |       }}| j                  |d   |d   g|       | j                  |d   |d   g|       y c c}w c c}w )Nr$   Test%dr   r#   r"   )ranger   r   r   r%   r   r    r   iclassesr)   r*   r   s         r   test_cpp_reference_cpp_classz1SignatureMatcherTest.test_cpp_reference_cpp_class1   s    :?(DQL!R0DDb''
34b''
34
 7EFht!,F	F>!,wqzlIF>!,wqzlIF E Gs   B7,B<c           	      Z   t        d      D cg c]  }t        d|z  g        }}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 cg c]  }t        d |       }}| j                  |d   |d   t        j
                  g|       | j                  |d   |d   t        j                  g|       | j                  |d   |d   t        j
                  g|       | j                  |d   |d   t        j                  g|       y c c}w c c}w )Nr$   r/   r   r#   r"      )	r0   r   r   r   r%   r
   r&   r   r    r1   s         r   $test_cpp_reference_cpp_class_and_intz9SignatureMatcherTest.test_cpp_reference_cpp_class_and_int<   sX   :?(DQL!R0DDb''
3R]]Cb''
3R^^Db''
3R]]Cb''
3R^^D	 7EFht!,F	F>!,wqz2==.I9U>!,wqz2>>.JIV>!,wqz2==.I9U>!,wqz2>>.JIV E Gs   F#(F(N)	__name__
__module____qualname____doc__r    r+   r-   r4   r7    r   r   r   r      s$    4
MZ	GWr   r   )unittestCython.Compilerr   r   Cython.Compiler.ExprNodesr   Cython.Compiler.PyrexTypesr   r   r   TestCaser   r<   r   r   <module>rB      s1     , . 3LB;W8,, ;Wr   