a
    "h	                     @   sN   d dl Z d dlmZ d dlmZ d dlZG dd dejZedkrJe	  dS )    N)support)script_helperc                   @   sD   e Zd Zdd Zdd Zdd Zdd Zee	j
 d	d
d ZdS )EOFTestCasec              
   C   sP   d}zt d W n4 tyD } z| t|| W Y d }~nd }~0 0 tjd S )Nz4EOL while scanning string literal (<string>, line 1)z'this is a test            evalSyntaxErrorassertEqualstrr   
TestFailedselfexpectmsg r   5/opt/python-3.9.21/usr/lib/python3.9/test/test_eof.py	test_EOFC	   s    &zEOFTestCase.test_EOFCc              
   C   sP   d}zt d W n4 tyD } z| t|| W Y d }~nd }~0 0 tjd S )NzBEOF while scanning triple-quoted string literal (<string>, line 1)z'''this is a testr   r   r   r   r   	test_EOFS   s    &zEOFTestCase.test_EOFSc              
   C   sX   d}zt ddddd W n4 tyL } z| t|| W Y d }~nd }~0 0 tjd S )N/unexpected EOF while parsing (<string>, line 1)z"\xhh" \z<string>execT)dont_inherit)compiler   r   r	   r   r
   r   r   r   r   test_eof_with_line_continuation   s    &z+EOFTestCase.test_eof_with_line_continuationc                 C   s   d}|  t}td W d    n1 s,0    Y  | t|j| |  t}td W d    n1 sp0    Y  | t|j| d S )Nr   zx = 5\\)ZassertRaisesr   r   r   r	   	exception)r   r   excinfor   r   r   test_line_continuation_EOF&   s    &&z&EOFTestCase.test_line_continuation_EOFzsys.executable requiredc                 C   s   t  }t|dd}t|\}}}| d| | d| | d| t|dd}t|\}}}| d| | d| | d| W d    n1 s0    Y  d S )NZfoor   s   unexpected EOF while parsings   line 2   \zy = 6\s   y = 6\)r   temp_dirr   Zmake_scriptZassert_python_failureZassertIn)r   r   	file_namercouterrr   r   r   ,test_line_continuation_EOF_from_file_bpo21800   s    
z8EOFTestCase.test_line_continuation_EOF_from_file_bpo2180N)__name__
__module____qualname__r   r   r   r   unittestZskipIfsys
executabler"   r   r   r   r   r      s   

	
r   __main__)
r'   testr   Ztest.supportr   r&   ZTestCaser   r#   mainr   r   r   r   <module>   s   8