Ë
    pPêjŸ	  ã                  óÊ   — 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mZ dd	lmZ dd
l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gZ G d„ de«      Z y)z|Test runner for exception handling transform test cases.

The transform inserts exception handling branch operations to IR.
é    )ÚannotationsN)ÚCompileError)Útest_temp_dir)ÚDataDrivenTestCase)Úfrequently_executed_blocks)ÚIS_FREE_THREADEDÚTOP_LEVEL_NAME)Úformat_func)ÚICODE_GEN_BUILTINSÚMypycDataSuiteÚassert_test_outputÚbuild_ir_for_single_fileÚremove_comment_linesÚuse_custom_builtins)Úinsert_exception_handling)Úinsert_ref_count_opcodes)Úinsert_uninit_checkszexceptions.testzexceptions-freq.testc                  ó   — e Zd ZeZeZdd„Zy)ÚTestExceptionTransformc           	     óD  — d|j                   v rt        ryd|j                   v rt        syt        t        j                  j                  | j                  t        «      |«      5  t        |j                  «      }	 t        |j                  «      }g }|D ]Æ  }|j                   t        k(  r|j                   j                  d«      sŒ2t        |d«       t        |d«       t!        |«       |j#                  t%        |«      «       |j                   j                  d«      sŒ‹t'        |j(                  d   «      }|j+                  dt-        d	„ |D «       «      z  «       ŒÈ 	 t3        ||d
|«       ddd«       y# t.        $ r}|j0                  }Y d}~Œ1d}~ww xY w# 1 sw Y   yxY w)z4Perform a runtime checking transformation test case.Ú_withgilNÚ_nogilÚ	_toplevelTÚ_freqr   zhot blocks: %sc              3  ó4   K  — | ]  }|j                   –— Œ y ­w)N)Úlabel)Ú.0Úbs     ú_/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/mypyc/test/test_exceptions.pyú	<genexpr>z2TestExceptionTransform.run_case.<locals>.<genexpr>>   s   è ø€ Ò?XÈAÀÇÅÑ?Xùs   ‚zInvalid source code output)Únamer   r   ÚosÚpathÚjoinÚdata_prefixr   r   Úoutputr   Úinputr	   Úendswithr   r   r   Úextendr
   r   ÚblocksÚappendÚsortedr   Úmessagesr   )ÚselfÚtestcaseÚexpected_outputÚirÚactualÚfnÚcommonÚes           r   Úrun_casezTestExceptionTransform.run_case#   s]  € ð ˜Ÿ™Ñ&Õ+;àØ�x—}‘}Ñ$Õ-=àä ¤§¡§¡¨d×.>Ñ.>Ô@RÓ!SÐU]Ó^ñ 	`Ü2°8·?±?ÓCˆOðZÜ-¨h¯n©nÓ=�ð �Øò 	Z�BØ—w‘w¤.Ò0¸¿¹×9OÑ9OÐP[Ô9\Ø Ü(¨¨TÔ2Ü-¨b°$Ô7Ü,¨RÔ0Ø—M‘M¤+¨b£/Ô2Ø—}‘}×-Ñ-¨gÕ6Ü!;¸B¿I¹IÀa¹LÓ!I˜ØŸ™Ð&6¼Ñ?XÐQWÔ?XÓ9XÑ&XÕYñ	Zô ˜x¨Ð1MÈÔ_÷'	`ð 	`øô  ò $ØŸ™•ûð$ú÷		`ð 	`ús>   Á#FÁ:E4ÂBFÄAFÅ4	FÅ=FÆ	FÆFÆFÆFN)r/   r   ÚreturnÚNone)Ú__name__Ú
__module__Ú__qualname__Úfilesr   Ú	base_pathr6   © ó    r   r   r      s   „ Ø€EØ€Iô`r?   r   )!Ú__doc__Ú
__future__r   Úos.pathr"   Úmypy.errorsr   Úmypy.test.configr   Úmypy.test.datar   Úmypyc.analysis.blockfreqr   Úmypyc.commonr   r	   Úmypyc.ir.pprintr
   Úmypyc.test.testutilr   r   r   r   r   r   Úmypyc.transform.exceptionsr   Úmypyc.transform.refcountr   Úmypyc.transform.uninitr   r<   r   r>   r?   r   ú<module>rM      sS   ðñõ
 #ã å $Ý *Ý -Ý ?ß 9Ý '÷÷ õ AÝ =Ý 7à	Ð2Ð3€ô!`˜^õ !`r?   