o
    GXîhT
  ã                   @   s”   d dl Z d dlmZ d dlmZ d dlZd dlZee	ddƒƒg d¢ Z
G dd„ dƒZG d	d
„ d
ee jƒZG dd„ dee jƒZedkrHe  ¡  dS dS )é    N)Úsupport)Ú	os_helperé   i  )i   iè  i   i   i   i    i'  i @  i €  i   i@B c                   @   s,   e Zd Zdd„ Zdd„ Zdd„ Zdd„ Zd	S )
ÚBufferSizeTestc              	   C   s´   t  t j¡ |  t jd¡}zE| |¡ | d¡ | |¡ | ¡  tt jdƒ}| ¡ }|  ||d ¡ | ¡ }|  ||¡ | ¡ }|  |¡ | ¡  W t  t j¡ d S t  t j¡ w )NÚwbó   
Úrb)	r   ÚunlinkZTESTFNÚopenÚwriteÚcloseÚreadlineÚassertEqualZassertFalse)ÚselfÚsÚfÚline© r   ú9/opt/python-3.10.19/usr/lib/python3.10/test/test_bufio.pyÚtry_one   s    




zBufferSizeTest.try_onec                 C   sn   t D ]2}t|t|ƒƒ\}}|| |d |…  }|  t|ƒ|¡ |  |¡ |  |d ¡ |  |d d… ¡ qd S )Nó   xéÿÿÿÿ)ÚlengthsÚdivmodÚlenr   r   )r   ÚpatternÚlengthÚqÚrZ
teststringr   r   r   Ú	drive_one+   s   
õzBufferSizeTest.drive_onec                 C   ó   |   d¡ d S )Ns   1234567890 ©r   ©r   r   r   r   Útest_primepat9   s   zBufferSizeTest.test_primepatc                 C   r    )Nsè                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          r!   r"   r   r   r   Útest_nullpat>   s   zBufferSizeTest.test_nullpatN)Ú__name__Ú
__module__Ú__qualname__r   r   r#   r$   r   r   r   r   r      s
    r   c                   @   s   e Zd ZejZdS )ÚCBufferSizeTestN)r%   r&   r'   Úior
   r   r   r   r   r(   B   s    
r(   c                   @   s   e Zd ZeejƒZdS )ÚPyBufferSizeTestN)r%   r&   r'   ÚstaticmethodÚpyior
   r   r   r   r   r*   E   s    r*   Ú__main__)ZunittestÚtestr   Ztest.supportr   r)   Z_pyior,   ÚlistÚranger   r   ZTestCaser(   r*   r%   Úmainr   r   r   r   Ú<module>   s    3ÿ