
    z%ij                         	 d dl Z d dlmZ d dlmZ d dlmZ d dlmZ d dlZ G d dej                        Z	e
dk(  r ej                          yy)	    N)support)	os_helper)script_helper)warnings_helperc                       e Zd Zd Zd Zd Z ej                  e      d        Z	d Z
 ej                  ej                   d      d        Zy	)
EOFTestCasec                     d}dD ]   }	 t        | d       t        j                   y # t        $ rA}| j	                  t        |      |       | j	                  |j                  d       Y d }~id }~ww xY w)NzCunterminated string literal (detected at line 1) (<string>, line 1))'"zthis is a test                   evalr   
TestFailedSyntaxErrorassertEqualstroffset)selfexpectquotemsgs       A/home/uftp/.pyenv/versions/3.12.0/lib/python3.12/test/test_eof.pytest_EOF_single_quotez!EOFTestCase.test_EOF_single_quote   s|    V  	)E)% !   (((	)  0  S62  Q//0s   )	A37A..A3c                     d}	 t        d       t        j                  # t        $ rA}| j	                  t        |      |       | j	                  |j                  d       Y d }~y d }~ww xY w)NzQunterminated triple-quoted string literal (detected at line 1) (<string>, line 1)z'''this is a testr   r   r   r   r   s      r   	test_EOFSzEOFTestCase.test_EOFS   s`    e	%()
 $$$	  	,SXv.SZZ++	,s    	A)7A$$A)c                     d}t        j                         5 }t        j                  |dd      }t        j                  |      \  }}}d d d        | j                  d       y # 1 sw Y   xY w)Nz(<string>, line 1)fooz'''this is 
a 
tests>   unterminated triple-quoted string literal (detected at line 3)r   temp_dirr   make_scriptassert_python_failureassertIn)r   r   r    	file_namercouterrs          r   test_EOFS_with_filezEOFTestCase.test_EOFS_with_file!   sk    &! 	JX%11(EC^_I(>>yILBS	J 	WY\]	J 	Js   1A##A,)categoryc                     d}	 t        ddd       t        j                  # t        $ r%}| j	                  t        |      |       Y d }~y d }~ww xY w)N/unexpected EOF while parsing (<string>, line 1)z"\Xhh" \z<string>exec)compiler   r   r   r   r   r   s      r   test_eof_with_line_continuationz+EOFTestCase.test_eof_with_line_continuation(   sO    B	%L*f5 $$$  	/SXv..	/s   ! 	AA

Ac                 r   	 d}| j                  t              5 }t        d       d d d        | j                  t	        j
                        |       | j                  t              5 }t        d       d d d        | j                  t	        |j
                        |       y # 1 sw Y   }xY w# 1 sw Y   ;xY w)Nr+   zx = 5\\)assertRaisesr   r,   r   r   	exception)r   r   excinfos      r   test_line_continuation_EOFz&EOFTestCase.test_line_continuation_EOF2   s    KB{+ 	wO	W../8{+ 	wJ	W../8	 		 	s   B!'B-!B*-B6zsys.executable requiredc                    	 t        j                         5 }t        j                  |dd      }t        j                  |      \  }}}| j                  d|       | j                  d|       | j                  d|       t        j                  |dd      }t        j                  |      \  }}}| j                  d|       | j                  d|       | j                  d|       d d d        y # 1 sw Y   y xY w)Nr   r0   s   unexpected EOF while parsings   line 1   \zy = 6\s   y = 6\r   )r   r    r$   r%   r&   r'   s         r   ,test_line_continuation_EOF_from_file_bpo2180z8EOFTestCase.test_line_continuation_EOF_from_file_bpo2180<   s    G! 	+X%11(E4HI(>>yILBSMM93?MM)S)MM%%%11(E9MI(>>yILBSMM93?MM)S)MM*c*	+ 	+ 	+s   CC,,C5N)__name__
__module____qualname__r   r   r(   r   ignore_warningsSyntaxWarningr.   r4   unittestskipIfsys
executabler7        r   r   r   
   sb    
)%^ %_$$m<% =%9 X__')BC+ D+rB   r   __main__)r?   testr   test.supportr   r   r   r=   TestCaser   r8   mainrA   rB   r   <module>rH      sI    5 
  " & ( @+(## @+D zHMMO rB   