NL ijdZddlmZddlZddlZddlZddlZddlmZGddejZ y)zPTest that C functions used in primitives are declared in a header such as CPy.h.) annotationsN)registryceZdZddZy)TestHeaderInclusionc tjjtjjtdd}t tjj|d5}|j dddt tjj|d5} |j z dddd fd }tjjtjjtjjtjjfD]/}|D](}|D]!}|j||j#*1tjjtjjtdd}tj|dD]I}t |5}|j } dddtj d D] } ||  Ky#1swYxYw#1swYlxYw#1swYIxYw) Nz..zlib-rtzCPy.hzpythonsupport.hct|jdr&tjd|ds Jd|dyy)NCPyz\b"z7" is used in mypyc.primitives but not declared in CPy.h) startswithresearch)nameheaders ]/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/mypyc/test/test_cheader.py check_namezJTestHeaderInclusion.test_primitives_included_in_header..check_namesKu%yy$rNFUtfSTU& primitivesz/*.pyz'c_function_name=["\'](CPy[A-Z_a-z0-9]+))rstrreturnNone)ospathjoindirname__file__openreadrmethod_call_opsvalues binary_ops unary_ops function_opsc_function_nameglobr findall) selfbase_dirfrropsopprimitives_pathfnamcontentrrs @r"test_primitives_included_in_headerz6TestHeaderInclusion.test_primitives_included_in_headers77<< 94J "'',,x1 2 aVVXF  "'',,x):; <  affh F  U  $ $ + + -    & & (    % % '  ! ! ( ( *  7F  77B))5"2#5#567 7 7'',,rwwx'@$ UII 178 !Dd #q&&( # #MwW !4  ! !/    , # #s$-H /H-!H: H*-H7:I N)rr)__name__ __module__ __qualname__r.rrrr s!rr) __doc__ __future__rr$rr unittestmypyc.primitivesrTestCaserr2rrr8s,V" %!(++!r