HEX
Server: Apache
System: Linux zacp120.webway.host 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP Thu Apr 17 19:10:24 UTC 2025 x86_64
User: govancoz (1003)
PHP: 8.3.26
Disabled: exec,system,passthru,shell_exec,proc_close,proc_open,dl,popen,show_source,posix_kill,posix_mkfifo,posix_getpwuid,posix_setpgid,posix_setsid,posix_setuid,posix_setgid,posix_seteuid,posix_setegid,posix_uname
Upload Files
File: //usr/local/lib/python3.7/test/__pycache__/test_numeric_tower.cpython-37.pyc
B

��g��@s�ddlZddlZddlZddlZddlZddlmZddlm	Z
ejjZ
ejjZGdd�dej�ZGdd�dej�Zedkr�e��dS)	�N)�Decimal)�Fractionc@sLeZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
d�Z	dd�Z
dS)�HashTestcCs.|�t|�t|�d�||��|�||�dS)Nz&got different hashes for {!r} and {!r})�assertEqual�hash�format)�self�x�y�r�3/usr/local/lib/python3.7/test/test_numeric_tower.py�check_equal_hashszHashTest.check_equal_hashcCs|�dd�|�dd�dS)NFrT�)r
)rrrr�
test_boolsszHashTest.test_boolscCs�xBtdd�D]4}|�|t|��|�|t|��|�|t|��qW�xtd�D�]}d|d}|tt|��kr�|�|t|��|�|t|��|�|t|��|�|t|��|�|t|��|�|t|��d|}|�|t|��|�|t|��|�|t|��|�|t|��|�|t|��|�|t|��qPWxttd�D]h}t�d�}t�d|d|�}|�|t|��|�|t|��|tt|��k�r`|�|t|���q`WdS)Ni���i��d�ri,�
)�ranger
�float�D�F�int�randomZ	randrange)r�i�n�_�errr�
test_integerss6
zHashTest.test_integerscCs�|�dd�|�dtd��|�dtd��|�dtd��|�dtd��|�td�td��|�td�td��xRtd�D]F}t��t�t��dd	�}|�|t�|��|�|t�|��q~WdS)
Ngg�rz-0.0�infz-infi�gi@gY@)	r
rrrrr�mathZexpZ
from_float)rrr	rrr�test_binary_floatsBszHashTest.test_binary_floatsc	CsNddddddtd�td�g}x,d	D]$}x|D]}|�|t||��q,Wq"WdS)
Ngg�g�?g�g�?g���rz-inf)g�g)rr
�complex)r�test_values�zero�valuerrr�test_complexWs


zHashTest.test_complexcCs�dddddg}x |D]}|�t|�td��qW|�td�td��|�td	�td��|�td
�td��|�td�td��|�td
�td��|�td�td��|�td�td��|�td�td��|�td�td��|�td�td��dS)N�0z-0z0.0z-0.0e10z000e-10rz1.00rz1.00000z-1.00���z-1.00000Z123e2i0Z1230e1Z12300z12300.0z12300.00z	12300.000)r
r)rZzerosr#rrr�
test_decimalsbs
zHashTest.test_decimalscCsh|�ttdt��t�|�ttddt��t�|�ttdtd��d�|�tttd��d�dS)Nrr'��r)rrr�_PyHASH_MODULUS�_PyHASH_INF)rrrr�test_fractionstszHashTest.test_fractionscCs,Gdd�d�}d|�h}|�t|�d�dS)Nc@seZdZdd�Zdd�ZdS)z6HashTest.test_hash_normalization.<locals>.HalibutProxycSstd�S)N�halibut)r)rrrr�__hash__�sz?HashTest.test_hash_normalization.<locals>.HalibutProxy.__hash__cSs|dkS)Nr.r)r�otherrrr�__eq__�sz=HashTest.test_hash_normalization.<locals>.HalibutProxy.__eq__N)�__name__�
__module__�__qualname__r/r1rrrr�HalibutProxy�sr5r.r)r�len)rr5r	rrr�test_hash_normalization|s
z HashTest.test_hash_normalizationN)r2r3r4r
rrr r%r(r-r7rrrrrs&rc@seZdZdd�Zdd�ZdS)�ComparisonTestcCs�td�td�dtdd�dddd	d
td�td�td
�tdd�td�tdd�tdd�dtd�g}x^t|�D]R\}}xH||dd�D]4}|�||�|�||�|�||�|�||�q�WqfWdS)Nz-infz-1e425000000g������i��r*g��Q�	����gg�Tz1.2z1.3z1.4i_5i�z1.414213562373095048801688724iC�i�;i��:i�Jgvܼ5J�iZinfinityr)rrr�	enumerateZ
assertLessZassertLessEqualZ
assertGreaterZassertGreaterEqual)rr"r�first�secondrrr�test_mixed_comparisons�s0
z%ComparisonTest.test_mixed_comparisonscCsd}d}x:ddtd�td�td�fD]}|�||�|�||�q$WxRddtd�td�td�fD]4}|�||�|�||�|�||�|�||�q`Wxxddtd�td�td�ddtd�td�td�|fD]B}x<tjtjtjtj	fD]$}|�
t|||�|�
t|||�q�Wq�WdS)Ny�?y��Q�	�������@rg�?rg@)rrr!rZassertNotEqual�operator�le�lt�ge�gtZassertRaises�	TypeError)r�z�w�v�oprrrr%�s   zComparisonTest.test_complexN)r2r3r4r=r%rrrrr8�sr8�__main__)Zunittestrr�sysr>�decimalrrZ	fractionsrr�	hash_info�modulusr+rr,ZTestCaserr8r2�mainrrrr�<module>s8