Ë
    pPêj¥  ã                  ó~   — d Z ddlmZ ddlZddl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  G d„ d	e«      Zdd
„Zy)zÃTest cases for `--output=json`.

These cannot be run by the usual unit test runner because of the backslashes in
the output, which get normalized to forward slashes by the test suite on Windows.
é    )ÚannotationsN)Úapi)ÚPYTHON3_VERSION)Útest_temp_dir)ÚDataDrivenTestCaseÚ	DataSuitec                  ó   — e Zd ZdgZdd„Zy)ÚOutputJSONsuitezoutputjson.testc                ó   — t        |«       y )N)Útest_output_json)ÚselfÚtestcases     úY/home/oem/CyberBrain26-unified/.venv/lib/python3.12/site-packages/mypy/test/testoutput.pyÚrun_casezOutputJSONsuite.run_case   s
   € Ü˜Õ"ó    N©r   r   ÚreturnÚNone)Ú__name__Ú
__module__Ú__qualname__Úfilesr   © r   r   r
   r
      s   „ ØÐ€Eô#r   r
   c           	     óÚ  — dj                  | j                  «      }t        j                  d|t        j                  ¬«      }|� |j                  d«      j                  «       }ndg}|j                  ddj                  t        t        t        «      «      › �«       t        j                  j                  t        d	«      }|j                  |«       t        |d
d¬«      5 }| j                  D ]  }|j                  |› d�«       Œ 	 ddd«       g }t!        j"                  |«      \  }}	}
||	z   j%                  d«      j'                  «       D ]Š  }|j)                  t        t        j*                  z   «      rB|j                  |t-        t        t        j*                  z   «      d j%                  d«      «       Œk|j                  |j%                  d«      «       ŒŒ |
dkD  r|j                  d«       t        j.                  |«       t        j*                  j1                  dd«      }|D �cg c]  }|j1                  t        |z   d«      ‘Œ }}|| j2                  k(  sJ ‚y# 1 sw Y   �ŒWxY wc c}w )zNRuns Mypy in a subprocess, and ensures that `--output=json` works as intended.ú
z# flags: (.*)$)ÚflagsNé   z--output=jsonz--python-version=ú.ÚmainÚwÚutf8)Úencodingz
z!!! Mypy crashed !!!ú\z\\Ú )ÚjoinÚinputÚreÚsearchÚ	MULTILINEÚgroupÚsplitÚappendÚmapÚstrr   ÚosÚpathr   ÚopenÚwriter   ÚrunÚrstripÚ
splitlinesÚ
startswithÚsepÚlenÚremoveÚreplaceÚoutput)r   Úprogram_textÚflags_matchÚmypy_cmdlineÚprogram_pathÚfileÚsr;   ÚoutÚerrÚ
returncodeÚlineÚjson_os_separatorÚnormalized_outputs                 r   r   r      s÷  € à—9‘9˜XŸ^™^Ó,€LÜ—)‘)Ð,¨lÄ"Ç,Á,ÔO€KØÐØ"×(Ñ(¨Ó+×1Ñ1Ó3‰à'Ð(ˆØ×ÑÐ+¨C¯H©H´S¼¼oÓ5NÓ,OÐ+PÐQÔRô —7‘7—<‘<¤¨vÓ6€LØ×Ñ˜Ô%Ü	ˆl˜C¨&Ô	1ð !°TØ—‘ò 	!ˆAØ�J‰J˜!˜˜B�xÕ ñ	!÷!ð €FäŸ7™7 <Ó0Ñ€Cˆˆjà�s‘×"Ñ" 4Ó(×3Ñ3Ó5ò /ˆØ�?‰?œ=¬2¯6©6Ñ1Ô2Ø�M‰M˜$œs¤=´2·6±6Ñ#9Ó:Ð<Ð=×DÑDÀVÓLÕMà�M‰M˜$Ÿ+™+ fÓ-Õ.ð	/ð �A‚~Ø�‰Ð,Ô-ô ‡I�IˆlÔô Ÿ™Ÿ™ t¨VÓ4ÐØY_Ö`ÐQU˜Ÿ™¤mÐ6GÑ&GÈÕLÐ`ÐÐ`à §¡Ò/Ð/Ñ/÷3!ñ !üò. as   Ã&IÈ' I(ÉI%r   )Ú__doc__Ú
__future__r   r/   Úos.pathr'   Úmypyr   Úmypy.defaultsr   Úmypy.test.configr   Úmypy.test.datar   r   r
   r   r   r   r   ú<module>rO      s5   ðñõ #ã 	Û Û 	å Ý )Ý *ß 8ô#�iô #ô&0r   