U :el @spdZddlZddlZddlmZddlmZddlmZdZ Gdddej ej Z d d Z ed krlee dS) zTests for distutils.text_file.N)TextFile)support) run_unittestzE# test file line 3 \ # intervening comment continues on next line c@seZdZddZdS)TextFileTestCasec sdddddg}dddg}ddddg}ddg}dg}d g}fd d }}tj|d } t| d } z| tW5| Xt| ddddd} z|dd| |W5| Xt| ddddd} z|dd| |W5| Xt| ddddd} z|dd| |W5| Xt| } z|dd| |W5| Xt| ddddd} z|dd| |W5| Xt| dddddd} z|dd| |W5| XdS)Nz # test file  z line 3 \ z# intervening comment z continues on next line zline 3 \z continues on next linezline 3 continues on next linezline 3 continues on next linecs|}||dSN) readlinesZ assertEqual)count descriptionfileZexpected_resultresultselfC/usr/local/python38/lib/python3.8/distutils/tests/test_text_file.py test_input2sz/TextFileTestCase.test_class..test_inputztest.txtwr)strip_comments skip_blanksZ lstrip_ws rstrip_wsz no processingzstrip commentsz strip blankszdefault processing)rr join_linesrzjoin lines without collapsing)rrrrZ collapse_joinzjoin lines with collapsing) mkdtempospathjoinopenclosewrite TEST_DATAr) rZresult1Zresult2Zresult3Zresult4Zresult5Zresult6rZtmpdirfilenameZout_fileZin_filerr r test_classs        zTextFileTestCase.test_classN)__name__ __module__ __qualname__r&rrrrrsrcCs ttSr)unittestZ makeSuiterrrrr test_suitegsr+__main__)__doc__rr*Zdistutils.text_filerZdistutils.testsrZ test.supportrr$ZTempdirManagerZTestCaserr+r'rrrrs   X