NL idZddlmZddlZddlmZddlmZddl m Z ddl m Z ddl mZdd lmZmZmZmZmZmZmZmZdd lmZdd lmZd gZGd deZy)zTest runner for reference count opcode insertion transform test cases. The transform inserts needed reference count increment/decrement operations to IR. ) annotationsN) CompileError) test_temp_dir)DataDrivenTestCase)TOP_LEVEL_NAME) format_func)ICODE_GEN_BUILTINSMypycDataSuiteassert_test_outputbuild_ir_for_single_file%infer_ir_build_options_from_test_nameremove_comment_linesreplace_word_sizeuse_custom_builtins)insert_ref_count_opcodes)insert_uninit_checksz refcount.testc eZdZeZeZdZddZy)TestRefCountTransformTcnt|j}|yttjj |j t|5t|j}t|} t|j|}g}|D]a}|jtk(r|jjds2t|t!||j#t%|c t+||d|dddy#t&$r}|j(}Yd}~1d}~wwxYw#1swYyxYw)z4Perform a runtime checking transformation test case.N _toplevelzInvalid source code output)r namerospathjoin data_prefixr routputrr inputrendswithrrextendrrmessagesr )selftestcaseoptionsexpected_outputiractualfnes ^/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/mypyc/test/test_refcount.pyrun_casezTestRefCountTransform.run_case%s7 F ?  d.>.>@R!SU] ^ `28??CO/@O 3-hnngF3Bww.09O9OP[9\ (,,R0MM+b/2 3 x1M _! ` `   $ $  ` `s7!D+3D  A7D+ D( D#D+#D((D++D4N)r"rreturnNone)__name__ __module__ __qualname__filesr base_path optional_outr*r)rr s EIL`r4r)__doc__ __future__ros.pathr mypy.errorsrmypy.test.configrmypy.test.datar mypyc.commonrmypyc.ir.pprintrmypyc.test.testutilr r r r r rrrmypyc.transform.refcountrmypyc.transform.uninitrr0rr3r4r)r@sN #$*-''   >7 `N`r4