o
    2g                     @  sd   d dl mZ d dlmZmZmZmZ d dlmZ d dl	m
Z
 d dlmZmZmZ G dd deZdS )	    )annotations)
SUBTYPE_OFSUPERTYPE_OF
Constraintinfer_constraints)Suite)TypeFixture)Instance	TupleType
UnpackTypec                   @  sz   e Zd ZdddZdddZdddZdd	d
ZdddZdddZdddZ	dddZ
dddZdddZdddZdS )ConstraintsSuitereturnNonec                 C  s   t  | _d S N)r   fxself r   Q/home/garg/my-data/venv/lib/python3.10/site-packages/mypy/test/testconstraints.pysetUp
   s   zConstraintsSuite.setUpc                 C  s   t | jj| jjtrJ d S r   )r   r   or   r   r   r   r   test_no_type_variables   s   z'ConstraintsSuite.test_no_type_variablesc                 C  s@   | j }ttfD ]}t|j|j|t|j||jdgksJ qd S N)type_varoptarget)	r   r   r   r   gtgar   ta)r   r   	directionr   r   r   test_basic_type_variable   s   z)ConstraintsSuite.test_basic_type_variablec                 C  s\   | j }tt|jt|jgt|j|j|jgtt	|jtt
|j|jg|jdgks,J d S r   )r   r   r	   gvir   tsr   br   r   r
   	std_tupler   r   r   r   r   !test_basic_type_var_tuple_subtype   s   &z2ConstraintsSuite.test_basic_type_var_tuple_subtypec                 C  s~   | j }ttt|jt|jgt|j|j|jgt	t
|jt	t|j|jg|jdt
|jtt|j|jg|jdhks=J d S r   )r   setr   r	   r"   r   r#   r   r$   r   r   r
   r%   r   r&   r   r   r   test_basic_type_var_tuple   s   &z*ConstraintsSuite.test_basic_type_var_tuplec              	   C  s   | j }ttt|j|jt|j|jgt|j|j	|j
|j|jgtt|jt|j	dt|jtt|j
|jg|jdt|jtt|j
|jg|jdt|jt|jdhksUJ d S r   )r   r(   r   r	   gv2ir   r   r#   sr   r$   cdr   r   r
   r%   r   r&   r   r   r   *test_type_var_tuple_with_prefix_and_suffix.   s$   z;ConstraintsSuite.test_type_var_tuple_with_prefix_and_suffixc              	   C  s   | j }ttt|jtt|j|jggt|j|j|j	gt
t|jt
|jdt|jt|jdt|jt
|j	dt|jt|j	dhksDJ d S r   )r   r(   r   r	   r"   r   
std_tupleir   r   r$   r   r   r   r&   r   r   r   test_unpack_homogenous_tupleA   s   z-ConstraintsSuite.test_unpack_homogenous_tuplec                 C  s   | j }ttt|j|jtt|j|jg|j	gt|j|j
|j|j|jgtt|jt|j
dt|jt|jdt|jt|jdt|jt|jdt|jt|jdt|j	t|jdhks\J d S r   )r   r(   r   r	   r*   r   r   r/   r+   ur   r$   r,   r-   r   r   r   r&   r   r   r   3test_unpack_homogenous_tuple_with_prefix_and_suffixP   s    $zDConstraintsSuite.test_unpack_homogenous_tuple_with_prefix_and_suffixc                 C  s   | j }ttt|j|j|j|j|jgt|j|j|j	|j
|jgtt|jt|jdt|jt|j	dt|jt|j	dt|jt|j
dt|jt|j
dt|jt|jdhksWJ d S r   )r   r(   r   r	   r*   r1   r   r+   r   r$   r,   r-   r   r   r   r&   r   r   r   "test_unpack_with_prefix_and_suffixa   s    z3ConstraintsSuite.test_unpack_with_prefix_and_suffixc                 C  sn   | j }ttt|j|j|j|j|jgt|j|j|j	|j
gtt|jt|jdt|jt|j
dhks5J d S r   )r   r(   r   r	   r*   r1   r   r+   r   r$   r-   r   r   r&   r   r   r   "test_unpack_tuple_length_non_matchr   s   z3ConstraintsSuite.test_unpack_tuple_length_non_matchc                 C  sB   | j }tt|j|jgt|j|jgdt|j|jgt	rJ d S )N)fallback)
r   r   r
   r   r+   r	   r/   r   r   r   r&   r   r   r   -test_var_length_tuple_with_fixed_length_tuple   s   z>ConstraintsSuite.test_var_length_tuple_with_fixed_length_tupleN)r   r   )__name__
__module____qualname__r   r   r!   r'   r)   r.   r0   r2   r3   r4   r6   r   r   r   r   r   	   s    









r   N)
__future__r   mypy.constraintsr   r   r   r   mypy.test.helpersr   mypy.test.typefixturer   
mypy.typesr	   r
   r   r   r   r   r   r   <module>   s    