Ë
    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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
gZ G d„ de«      Zy)zBTest cases for annotating source code to highlight inefficiencies.é    )ÚannotationsN)ÚCompileError)Útest_temp_dir)ÚDataDrivenTestCase)Úgenerate_annotationsÚget_max_prio)Úformat_func)ÚICODE_GEN_BUILTINSÚMypycDataSuiteÚassert_test_outputÚbuild_ir_for_single_file2Ú%infer_ir_build_options_from_test_nameÚremove_comment_linesÚuse_custom_builtinszannotate-basic.testc                  ó    — e Zd ZeZeZdZdd„Zy)Ú
TestReportTc                ó$  — t        |j                  «      }|€yt        t        j                  j                  | j                  t        «      |«      5  t        |j                  «      }t        |j                  «      D ]F  \  }}d|v sŒ|j                  d«      d   j                  «       }|j                  d|dz   › d|› �«       ŒH d}	 t        |j                  |«      \  }}}	}
t!        d|||	|
«      }g }t#        |j$                  j'                  «       d„ ¬	«      D ]Q  \  }}t)        |«      }|D �cg c]  }|j*                  ‘Œ }}d
j                  |«      }|j                  d|› d|› �«       ŒS 	 	 t1        ||d|«       	 ddd«       yc c}w # t,        $ r}|j.                  }Y d}~Œ8d}~ww xY w# t2        $ rK |rGt5        d«       |j6                  D ]-  }|j                  dk(  rŒt9        |«      D ]  }t5        |«       Œ Œ/ ‚ w xY w# 1 sw Y   yxY w)z4Perform a runtime checking transformation test case.Nz# A:é   zmain:é   z: z	native.pyc                ó   — | d   S )Nr   © )Úits    ú]/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/mypyc/test/test_annotate.pyú<lambda>z%TestReport.run_case.<locals>.<lambda>6   s
   € ÀBÀqÁE€ ó    )Úkeyú zInvalid source code outputzGenerated IR:
Ú__top_level__)r   Únamer   ÚosÚpathÚjoinÚdata_prefixr
   r   ÚoutputÚ	enumerateÚinputÚ
rpartitionÚstripÚappendr   r   Úsortedr   Úitemsr   Úmessager   Úmessagesr   ÚBaseExceptionÚprintÚ	functionsr	   )ÚselfÚtestcaseÚoptionsÚexpected_outputÚiÚlineÚmsgÚirÚtreeÚtype_mapÚmapperr   ÚactualÚline_numÚ	line_annsÚannsÚaÚstr_annsÚsÚeÚfns                        r   Úrun_casezTestReport.run_case   s  € ä7¸¿¹ÓFˆØˆ?àÜ ¤§¡§¡¨d×.>Ñ.>Ô@RÓ!SÐU]Ó^ñ #	Ü2°8·?±?ÓCˆOô % X§^¡^Ó4ò C‘��4Ø˜T’>ØŸ/™/¨&Ó1°!Ñ4×:Ñ:Ó<�CØ#×*Ñ*¨U°1°q±5°'¸¸C¸5Ð+AÕBðCð
 ˆBð;Ü-FÀxÇ~Á~ÐW^Ó-_Ñ*��D˜( Fô 3°;ÀÀbÈ(ÐTZÓ[�Ø�Ü+1Ø×+Ñ+×1Ñ1Ó3Ñ9Iô,ò ;Ñ'�H˜iô (¨	Ó2�DØ37Ö8¨a §	£	Ð8�HÐ8ØŸ™ Ó*�AØ—M‘M E¨(¨°2°a°SÐ"9Õ:ñ;ð
Ü" 8¨VÐ5QÐSbÕc÷5#	ð #	ùò*  9øô  ò $ØŸ™•ûð$ûô !ò ÙÜÐ+Ô,Ø Ÿl™lò %˜ØŸ7™7 oÒ5Ø$Ü!,¨R£ò %˜AÜ! !�Hñ%ð%ð
 ðú÷7#	ð #	úsc   Á5HÂA HÃFÃ#AHÄ/FÅ-HÅ0F/ÆHÆ	F,ÆF'Æ"HÆ'F,Æ,HÆ/AHÈHÈHN)r2   r   ÚreturnÚNone)Ú__name__Ú
__module__Ú__qualname__Úfilesr   Ú	base_pathÚoptional_outrE   r   r   r   r   r      s   „ Ø€EØ€IØ€Lô)r   r   )Ú__doc__Ú
__future__r   Úos.pathr    Úmypy.errorsr   Úmypy.test.configr   Úmypy.test.datar   Úmypyc.annotater   r   Úmypyc.ir.pprintr	   Úmypyc.test.testutilr
   r   r   r   r   r   r   rK   r   r   r   r   ú<module>rW      sB   ðÙ Hå "ã å $Ý *Ý -ß =Ý '÷÷ ñ ð 
Ð€ô.�õ .r   