o
    2g                     @  s   d Z ddlmZ ddlZddlmZ ddlmZ ddl	m
Z
 ddlmZ ddlmZ dd	lmZ dd
lmZmZmZmZmZmZmZ ddlmZ ddlmZ ddlmZ ddlm Z  ddl!m"Z" G dd deZ#dS )z$Runner for lowering transform tests.    )annotationsN)CompileError)test_temp_dir)DataDrivenTestCase)TOP_LEVEL_NAME)format_func)CompilerOptions)ICODE_GEN_BUILTINSMypycDataSuiteassert_test_outputbuild_ir_for_single_fileremove_comment_linesreplace_word_sizeuse_custom_builtins)insert_exception_handling)do_flag_elimination)lower_ir)insert_ref_count_opcodes)insert_uninit_checksc                   @  s"   e Zd ZddgZeZd
ddZd	S )TestLoweringzlowering-int.testzlowering-list.testtestcaser   returnNonec                 C  s   t tj| jt|i t|j}t|}zt	|j
}W n ty1 } z	|j}W Y d }~n8d }~ww g }|D ].}|jtkrD|jdsDq6t }t| t| t| t|| t|| |t| q6t||d| W d    d S 1 sww   Y  d S )N	_toplevelzInvalid source code output)r   ospathjoindata_prefixr	   r   outputr   r   inputr   messagesnamer   endswithr   r   r   r   r   r   extendr   r   )selfr   expected_outputireactualfnoptions r+   P/home/garg/my-data/venv/lib/python3.10/site-packages/mypyc/test/test_lowering.pyrun_case!   s,   


"zTestLowering.run_caseN)r   r   r   r   )__name__
__module____qualname__filesr   	base_pathr-   r+   r+   r+   r,   r      s    r   )$__doc__
__future__r   os.pathr   mypy.errorsr   mypy.test.configr   mypy.test.datar   mypyc.commonr   mypyc.ir.pprintr   mypyc.optionsr   mypyc.test.testutilr	   r
   r   r   r   r   r   mypyc.transform.exceptionsr    mypyc.transform.flag_eliminationr   mypyc.transform.lowerr   mypyc.transform.refcountr   mypyc.transform.uninitr   r   r+   r+   r+   r,   <module>   s     $	