HEX
Server: LiteSpeed
System: Linux server.nevid-deploma.com 4.18.0-553.111.1.lve.el8.x86_64 #1 SMP Fri Mar 13 13:42:17 UTC 2026 x86_64
User: smilepac (1037)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/cppython/lib/python3.8/test/__pycache__/test_list.cpython-38.pyc
U

.D�g\�@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�Zedd��Zdd�Z�ZS)�ListTestcCs|�tg�g�ddddg}t|�}|�||�|�||k	�|�td�g�|�td�ddddg�|�td�g�|�td�d	d
ddg�|�td
d�td�D��dddddg�tjdkr�|�ttttjd��g}|�dd�|D��|�|g�dS)Nr����)rrrr�Zspam�s�p�a�mcss|]}|dr|VqdS)rNr)�.0�xrr�-/opt/cppython/lib/python3.8/test/test_list.py�	<genexpr>sz&ListTest.test_basic.<locals>.<genexpr>�
���	i���css|]}|VqdS�Nr)r�yrrrr*s)	�assertEqual�list�
assertTrue�range�sys�maxsize�assertRaises�MemoryError�extend)�selfZl0_3Zl0_3_bisrrrr�
test_basic
s"�
zListTest.test_basicc	Cs&|�td��tgd�W5QRXdS)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|�ggk	�dSr)rr$rrr�
test_identity6szListTest.test_identitycsFt���|�tg�d�|�tdg�d�|�tdddg�d�dS)Nrrrr)r'�test_lenr�lenr$r)rrr,9s
zListTest.test_lencCsbddddg}ttjddt|��}dd�}dd	�}|�ttf|||�|�ttf|||�dS)
N�r�rrcSs||Srr�r�brrr�mulB�z#ListTest.test_overflow.<locals>.mulcSs||9}dSrrr0rrr�imulCr3z$ListTest.test_overflow.<locals>.imul)�intrrr-rr�
OverflowError)r!�lst�nr2r4rrr�
test_overflow?szListTest.test_overflowc	Cs�dgd}|dd�=|�t|�d�dtjddd}|�ttf��||W5QRX|�ttf��||9}W5QRXdS)Nr�Arr�)rr-�tuple�__itemsize__rrr6)r!r7�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)r8�lr
r$rr�checkVs

�z'ListTest.test_repr_large.<locals>.checkri@Br)r!rFrr$r�test_repr_largeTszListTest.test_repr_largec	Cs�|�ddddg�}ddddd	d
g}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�q0dS)Nr.rr/rr���
��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�|�ddddg�}ddddd	d
g}ttjd�D�]�}t|�}t�||f|�}t�|�\}}||dd�<|�t|�t|��|�t	|�|t
|�ddd��t|�t�||f|�}t�|�\}}||dd�<|�t|�t|��|�t	|�|t
|�d
dd��tdt
|��D]}t|��qt�||f|�}t�|�\}}||dd�<|�t|�t|��|�t	|�g�|�t
t|�t�||f|�}t�|�\}}||dd�<|�t	|�g�q0dS)Nr.rr/rrrHrIrJrKrLr���r)rMrrNrO�reversedrQrRrrSrr-rTrrUrVrrr�test_reversed_pickle�s6""zListTest.test_reversed_picklec	Cs:Gdd�dt�}|�t��d|ddg�W5QRXdS)Nc@seZdZdS)z*ListTest.test_no_comdat_folding.<locals>.LN)�__name__�
__module__�__qualname__rrrr�L�src)rrr)rrr#)r!rcrrr�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�r`rarbrlrrjrr�X�srncseZdZ�fdd�ZdS)z9ListTest.test_equal_operator_modifying_operand.<locals>.Ycs���tSrrerh��list1rrrl�sz@ListTest.test_equal_operator_modifying_operand.<locals>.Y.__eq__Nrmrrorr�Y�srqcseZdZ�fdd�ZdS)z9ListTest.test_equal_operator_modifying_operand.<locals>.Zcs���tSrrerh��list3rrrl�sz@ListTest.test_equal_operator_modifying_operand.<locals>.Z.__eq__Nrmrrrrr�Z�srtr)rZassertFalse)r!rnrqrtZlist4r)rprkrsr�%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_preallocationc	s�G�fdd�d�}|�g�|�t������W5QRXGdd�dt�}||�g������||�g��|�t������W5QRX|�|�g�d�k|�|�g�|��kdS)NcseZdZ�fdd�ZdS)z3ListTest.test_count_index_remove_crashes.<locals>.Xcs���tSrrerh�r7rrrl�sz:ListTest.test_count_index_remove_crashes.<locals>.X.__eq__Nrmrryrrrn�srnc@seZdZdd�ZdS)z3ListTest.test_count_index_remove_crashes.<locals>.LcSst|�tSr)�strrgrhrrrrl�sz:ListTest.test_count_index_remove_crashes.<locals>.L.__eq__Nrmrrrrrc�srcr)r�
ValueError�indexr�count�remove)r!rnrcrryr�test_count_index_remove_crashes�s
z(ListTest.test_count_index_remove_crashes)r`rarbrrMr"r%r(r+r,r9r?rGr\r_rdrurrxr�
__classcell__rrr)rrs #

$$
r�__main__)r�testrZtest.supportrrNZunittestZ
CommonTestrr`�mainrrrr�<module>sj