o
    Tæ«dÅ  ã                   @   s’   d dl Z d dlZd dlZd dlmZmZmZmZmZm	Z	m
Z
 d dlmZ edƒZedƒZejdd… dkZG dd	„ d	eƒZed
krGe ¡  dS dS )é    N)ÚConstantÚ	FloatTypeÚ
DoubleTypeÚLiteralStructTypeÚIntTypeÚ	ArrayTypeÚHalfType)ÚTestCaseé   é   é   )é   é   c                   @   s@   e Zd Zdd„ Zdd„ Ze ed¡dd„ ƒZdd	„ Z	d
d„ Z
dS )ÚTestValueReprc                    ó8   ‡ fdd„}|t jdƒ |tdƒdƒ |tdƒdƒ d S )Nc                    ó    t tƒ | ƒ}ˆ  t|ƒ|¡ d S ©N)r   r   ÚassertEqualÚstr©ÚvalÚexpectedÚc©Úself© úp/home/ncw/WWW/www-new/content/articles/pi-bbp/venv/lib/python3.10/site-packages/llvmlite/tests/test_valuerepr.pyÚ
check_repr   ó   z2TestValueRepr.test_double_repr.<locals>.check_reprzdouble 0x400921fb54442d18Úinfzdouble 0x7ff0000000000000ú-infzdouble 0xfff0000000000000©ÚmathÚpiÚfloat©r   r   r   r   r   Útest_double_repr   ó   zTestValueRepr.test_double_reprc                    r   )Nc                    r   r   )r   r   r   r   r   r   r   r   r      r   z1TestValueRepr.test_float_repr.<locals>.check_reprzfloat 0x400921fb60000000r   zfloat 0x7ff0000000000000r    zfloat 0xfff0000000000000r!   r%   r   r   r   Útest_float_repr   r'   zTestValueRepr.test_float_reprz
py36+ onlyc                    r   )Nc                    r   r   )r   r   r   r   r   r   r   r   r   &   r   z0TestValueRepr.test_half_repr.<locals>.check_reprzhalf 0x4009200000000000r   zhalf 0x7ff0000000000000r    zhalf 0xfff0000000000000r!   r%   r   r   r   Útest_half_repr$   s   zTestValueRepr.test_half_reprc                 C   s:   t ttgƒ}t|ttdƒttdƒfƒ}|  t|ƒd¡ d S )Néd   iè  z{i8, i16} {i8 100, i16 1000})r   Úint8Úint16r   r   r   )r   Útpr   r   r   r   Útest_struct_repr-   s   zTestValueRepr.test_struct_reprc                 C   sT   t tdƒ}dd„ dD ƒ}t||ƒ}|  t|ƒd¡ t|tdƒƒ}|  t|ƒd¡ d S )Nr   c                 S   s   g | ]}t t|ƒ‘qS r   )r   r+   )Ú.0Úxr   r   r   Ú
<listcomp>4   s    z1TestValueRepr.test_array_repr.<locals>.<listcomp>)é   é
   iñÿÿÿz[3 x i8] [i8 5, i8 10, i8 -15]s   z[3 x i8] c"\01\02\03")r   r+   r   r   r   Ú	bytearray)r   r-   Úvaluesr   r   r   r   Útest_array_repr2   s   

zTestValueRepr.test_array_reprN)Ú__name__Ú
__module__Ú__qualname__r&   r(   ÚunittestÚ
skipUnlessÚPY36_OR_LATERr)   r.   r6   r   r   r   r   r      s    

r   Ú__main__)r"   Úsysr:   Úllvmlite.irr   r   r   r   r   r   r   Úllvmlite.testsr	   r+   r,   Úversion_infor<   r   r7   Úmainr   r   r   r   Ú<module>   s    $)ÿ