B
    18\l                 @   sp   d Z ddlZddlZddlmZ ddlmZ ddlmZ dZ	G dd dej
ejZd	d
 Zedkrlee  dS )zTests for distutils.text_file.    N)TextFile)support)run_unittestzE# test file

line 3 \
# intervening comment
  continues on next line
c               @   s   e Zd Zdd ZdS )TextFileTestCasec                s  dddddg}dddg}ddddg}ddg}dg}d	g} fd
d}   }tj|d}	t|	d}
z|
t W d |
  X t|	ddddd}z|dd|| W d |  X t|	ddddd}z|dd|| W d |  X t|	ddddd}z|dd|| W d |  X t|	}z|dd|| W d |  X t|	ddddd}z|dd|| W d |  X t|	dddddd}z|dd|| W d |  X d S )Nz# test file

z	line 3 \
z# intervening comment
z  continues on next line
zline 3 \z  continues on next linezline 3   continues on next linezline 3 continues on next linec                s   |  } || d S )N)	readlinesassertEqual)countdescriptionfileZexpected_resultresult)self b/oak/stanford/groups/akundaje/marinovg/programs/Python-3.7.3/Lib/distutils/tests/test_text_file.py
test_input2   s    z/TextFileTestCase.test_class.<locals>.test_inputztest.txtwr   )strip_commentsskip_blanks	lstrip_ws	rstrip_ws   zno processing   zstrip comments   zstrip blanks   zdefault processing)r   r   
join_linesr      zjoin lines without collapsing)r   r   r   r   Zcollapse_join   zjoin lines with collapsing)	mkdtempospathjoinopenwrite	TEST_DATAcloser   )r   Zresult1Zresult2Zresult3Zresult4Zresult5Zresult6r   tmpdirfilenameout_filein_filer   )r   r   
test_class   sd    










zTextFileTestCase.test_classN)__name__
__module____qualname__r)   r   r   r   r   r      s   r   c               C   s
   t tS )N)unittest	makeSuiter   r   r   r   r   
test_suiteg   s    r/   __main__)__doc__r   r-   distutils.text_filer   distutils.testsr   Ztest.supportr   r#   TempdirManagerTestCaser   r/   r*   r   r   r   r   <module>   s   X