Your IP : 216.73.216.213


Current Path : /opt/alt/python39/lib64/python3.9/test/__pycache__/
Upload File :
Current File : //opt/alt/python39/lib64/python3.9/test/__pycache__/test_list.cpython-39.opt-2.pyc

a

XC?h��@sVddlZddlmZddlmZddlZddlZGdd�dej�Ze	dkrRe�
�dS)�N)�
list_tests)�cpython_onlycs�eZdZeZdd�Zdd�Z�fdd�Zdd�Z�fd	d
�Z	dd�Z
d
d�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd�Zedd��Zdd�Z�ZS)�ListTestcCs�|�tg�g�gd�}t|�}|�||�|�||u�|�td�g�|�td�gd��|�td�g�|�td�gd��|�tdd�td�D��gd	��tjd
kr�|�ttttjd��g}|�dd�|D��|�|g�dS)
N)r�����Zspam)�s�p�a�mcss|]}|dr|VqdS)rNr)�.0�xrr�3/opt/alt/python39/lib64/python3.9/test/test_list.py�	<genexpr>�z&ListTest.test_basic.<locals>.<genexpr>�
)rr���	i���rcss|]}|VqdS�Nr)r�yrrrr*r)	�assertEqual�list�
assertTrue�range�sys�maxsize�assertRaises�MemoryError�extend)�selfZl0_3Zl0_3_bisrrrr�
test_basic
s"�
zListTest.test_basiccCs:|�td��tgd�Wd�n1s,0YdS)Nzkeyword argument)Zsequence)ZassertRaisesRegex�	TypeErrorr�r"rrr�test_keyword_args-szListTest.test_keyword_argscs&t���|�g�|�dg�dS)N�*)�super�
test_truthrr%��	__class__rrr)1s
zListTest.test_truthcCs|�ggu�dSr)rr%rrr�
test_identity6szListTest.test_identitycsDt���|�tg�d�|�tdg�d�|�tgd��d�dS)Nrr)rrrr)r(�test_lenr�lenr%r*rrr-9s
zListTest.test_lencCs^gd�}ttjddt|��}dd�}dd�}|�ttf|||�|�ttf|||�dS)N��r�rrcSs||Srr�r�brrr�mulBrz#ListTest.test_overflow.<locals>.mulcSs||9}dSrrr2rrr�imulCrz$ListTest.test_overflow.<locals>.imul)�intrrr.rr �
OverflowError)r"�lst�nr4r5rrr�
test_overflow?szListTest.test_overflowcCs�dgd}|dd�=|�t|�d�dtjddd}|�ttf��||Wd�n1sf0Y|�ttf��||9}Wd�n1s�0YdS)Nr�Arr�)rr.�tuple�__itemsize__rr r7)r"r8�sizerrr�test_list_resize_overflowGs

&z"ListTest.test_list_resize_overflowcs �fdd�}|d�|d�dS)Ncs6dg|}t|�}��|dd�dg|�d�dS)Nr�[z, �0�])�reprr�join)r9�lr
r%rr�checkVs

�z'ListTest.test_repr_large.<locals>.checkri@Br)r"rGrr%r�test_repr_largeTszListTest.test_repr_largec	Cs�|�gd��}gd�}ttjd�D�]v}t|�}t�||f|�}t�|�\}}||dd�<|�t|�t|��|�t	|�|�t
|�t�||f|�}t�|�\}}||dd�<|�t|�t|��|�t	|�|dd��tdt|��D]}t
|�q�t�||f|�}t�|�\}}||dd�<|�t|�t|��|�t	|�|t|�d��|�t
t
|�t�||f|�}t�|�\}}||dd�<|�t	|�g�q$dS)Nr/�r���
��r)�	type2testr�pickle�HIGHEST_PROTOCOL�iter�dumps�loadsr�typer�nextr.r�
StopIteration�	r"Zorig�data�protoZitorig�d�itr�irrr�test_iterator_pickle^s6
zListTest.test_iterator_picklec	Cs�|�gd��}gd�}ttjd�D�]�}t|�}t�||f|�}t�|�\}}||dd�<|�t|�t|��|�t	|�|t
|�ddd��t|�t�||f|�}t�|�\}}||dd�<|�t|�t|��|�t	|�|t
|�ddd��tdt
|��D]}t|��qt�||f|�}t�|�\}}||dd�<|�t|�t|��|�t	|�g�|�t
t|�t�||f|�}t�|�\}}||dd�<|�t	|�g�q$dS)Nr/rIr���r)rOrrPrQ�reversedrSrTrrUrr.rVrrWrXrrr�test_reversed_pickle�s6""zListTest.test_reversed_picklecCs8gd�}dg|ddtj�<|�|ddtj�dg�dS)N)rrrrr0rrr)rrr)r"rrrr�test_step_overflow�szListTest.test_step_overflowcCsNGdd�dt�}|�t�� d|ddg�Wd�n1s@0YdS)Nc@seZdZdS)z*ListTest.test_no_comdat_folding.<locals>.LN)�__name__�
__module__�__qualname__rrrr�L�rrf)rrr)rrr$)r"rfrrr�test_no_comdat_folding�szListTest.test_no_comdat_foldingcstG�fdd�d�}G�fdd�d�}G�fdd�d�}|�g�|�g�|���k�|�g�dg}|��|k�dS)NcseZdZ�fdd�ZdS)z9ListTest.test_equal_operator_modifying_operand.<locals>.Xcs���tSr��clear�NotImplemented�r"�other��list2rr�__eq__�sz@ListTest.test_equal_operator_modifying_operand.<locals>.X.__eq__N�rcrdrerorrmrr�X�srqcseZdZ�fdd�ZdS)z9ListTest.test_equal_operator_modifying_operand.<locals>.Ycs���tSrrhrk��list1rrro�sz@ListTest.test_equal_operator_modifying_operand.<locals>.Y.__eq__Nrprrrrr�Y�srtcseZdZ�fdd�ZdS)z9ListTest.test_equal_operator_modifying_operand.<locals>.Zcs���tSrrhrk��list3rrro�sz@ListTest.test_equal_operator_modifying_operand.<locals>.Z.__eq__Nrprrurr�Z�srwr)rZassertFalse)r"rqrtrwZlist4r)rsrnrvr�%test_equal_operator_modifying_operand�sz.ListTest.test_equal_operator_modifying_operandcCsNdgd}t�|�}|�|t�tdgd���|�|t�ttd����dS)Nrr)r�	getsizeofrrr)r"�iterableZ	iter_sizerrr�test_preallocation�s

zListTest.test_preallocationcs�G�fdd�d�}|�g�|�t������Wd�n1sD0YGdd�dt�}||�g������||�g��|�t������Wd�n1s�0Y|�|�g�d�v|�|�g�|��vdS)NcseZdZ�fdd�ZdS)z3ListTest.test_count_index_remove_crashes.<locals>.Xcs���tSrrhrk�r8rrro�sz:ListTest.test_count_index_remove_crashes.<locals>.X.__eq__Nrprr|rrrq�srqc@seZdZdd�ZdS)z3ListTest.test_count_index_remove_crashes.<locals>.LcSst|�tSr)�strrjrkrrrro�sz:ListTest.test_count_index_remove_crashes.<locals>.L.__eq__Nrprrrrrf�srfr)r�
ValueError�indexr�count�remove)r"rqrfrr|r�test_count_index_remove_crashes�s(
(z(ListTest.test_count_index_remove_crashes)rcrdrerrOr#r&r)r,r-r:r@rHr^rarbrgrxrr{r��
__classcell__rrr*rrs"#

$$
r�__main__)r�testrZtest.supportrrPZunittestZ
CommonTestrrc�mainrrrr�<module>so