shell bypass 403
o
`b"� � @ s d Z ddlmZ ddlmZmZmZmZ ddlZddl Z ddl
Z
dZdZdZ
e
jdk r-dnd ZG d
d� d�ZG dd
� d
eje�ZG dd� deje�ZG dd� deje�ZG dd� dej�ZG dd� dej�Zedkree
j�dkrye�e
jd � e�� dS dS )a� Bigmem tests - tests for the 32-bit boundary in containers.
These tests try to exercise the 32-bit boundary that is sometimes, if
rarely, exceeded in practice, but almost never tested. They are really only
meaningful on 64-bit builds on machines with a *lot* of memory, but the
tests are always run, usually with very low memory limits to make sure the
tests themselves don't suffer from bitrot. To run them for real, pass a
high memory limit to regrtest, with the -M option.
� )�support)�
bigmemtest�_1G�_2G�_4GN� � � l � c @ s< e Zd Zdd� Zeed dd�dd� �Zeedd�d d
� �Zeedd�dd� �Zeed dd�d
d� �Z eedd�dd� �Z
eedd�dd� �Zeedd�dd� �Zeedd�dd� �Z
eedd�dd� �Zeedd�dd� �Zeedd�dd� �Zeedd�dd� �Zeedd�dd � �Zeedd�d!d"� �Zeed dd�d#d$� �Zeed dd�d%d&� �Zeed dd�d'd(� �Zeed dd�d)d*� �Zeedd�d+d,� �Zeedd�d-d.� �Zeed dd�d/d0� �Zeed dd�d1d2� �Zeed3d�d4d5� �Zeed6 ed e d�d7d8� �Zeed3d�d9d:� �Z eedd�d;d<� �Z!eedd�d=d>� �Z"d?d@� Z#dAdB� Z$eedd�dCdD� �Z%eed6 dd�dEdF� �Z&eedG dd�dHdI� �Z'ee(d dJd�dKdL� �Z)ee(d dJd�dMdN� �Z*eedG dd�dOdP� �Z+eedd�dQdR� �Z,eed dd�dSdT� �Z-eed dd�dUdV� �Z.dWS )X�BaseStrTestc C s` | j }| � d�}|d�| | }|�� }| �|t|� d � |�� � | �|�|d��|� d S �N� abc def ghi�-)�from_latin1�
capitalize�assertEqual�len�lstrip)�self�size�_�SUBSTR�sZcaps� r �9/usr/local/python-3.10/lib/python3.10/test/test_bigmem.py�_test_capitalizeH s
�zBaseStrTest._test_capitalize�
r �r �memusec C s~ | � d�}|�|�}| �t|�|� t|�t|� d }}t|�d r(|d7 }| �||| � |� | �|�� |�� � d S )Nr
r r )r �centerr r �strip)r r r r ZlpadsizeZrpadsizer r r �test_centerQ s
zBaseStrTest.test_centerr c C s� | j }|d�}|d�| | }| �|�|d��|� ||d�7 }| �|�|d��|d � | �|�|d��d� | �|�|d��d� | �|�|d��d� d S ) Nr
�.r � � �i�jr )r r �count�r r r r r r r r �
test_count\ s zBaseStrTest.test_countc C s� | j }|d�}|d�| | }| �|�|�� | �|�|�� |d�| }| �|�|�� | �|�|d�| �� | �|�|�� d S )Nr
r �...�a)r �
assertTrue�endswith�assertFalse)r r r r r �s2r r r �
test_endswithh s zBaseStrTest.test_endswithc C s� | j }|d�| }d}| �|�� |k� ~t||�\}}|d�| }|�|�}| �t|�|| � | �t|�|d���d� d S )Nr r
z r# r )r r, �
expandtabs�divmodr r r )r r r r �tabsizeZslen� remainderr r r �test_expandtabst s
zBaseStrTest.test_expandtabsc C s | j }|d�}t|�}|d��||d�| |g�}| �|�|d��d� | �|�|�d� | �|�|d�|�|| � | �|�|t|��|| � | �|�|d��|�|d��� | �|�|d�|�|| |�|d�� � | �|�|d�|�|| |�|d�� � | �|�|d��d� d S � Nr
� r r# r r% r&