a 5êdgº ã@sRdZddlZddlmZddlmZddlZGdd„dejƒZe dkrNe  ¡dS)z/test script for a few new invalid token catcheséN)Úsupport)Ú script_helperc@sDeZdZdd„Zdd„Zdd„Zdd„Ze e j d ¡d d „ƒZ d S) Ú EOFTestCasec CsPd}z tdƒWn4tyD}z| t|ƒ|¡WYd}~nd}~00tj‚dS)Nz4EOL while scanning string literal (, line 1)z'this is a test ©ÚevalÚ SyntaxErrorÚ assertEqualÚstrrÚ TestFailed©ÚselfÚexpectÚmsg©rú)/usr/local/lib/python3.9/test/test_eof.pyÚ test_EOFC s  &zEOFTestCase.test_EOFCc CsPd}z tdƒWn4tyD}z| t|ƒ|¡WYd}~nd}~00tj‚dS)NzBEOF while scanning triple-quoted string literal (, line 1)z'''this is a testrr rrrÚ test_EOFSs  &zEOFTestCase.test_EOFSc CsXd}ztdddddWn4tyL}z| t|ƒ|¡WYd}~nd}~00tj‚dS)Nú/unexpected EOF while parsing (, line 1)z"\xhh" \zÚexecT)Ú dont_inherit)Úcompilerrr rr r rrrÚtest_eof_with_line_continuations &z+EOFTestCase.test_eof_with_line_continuationcCsd}| t¡}tdƒWdƒn1s,0Y| t|jƒ|¡| t¡}tdƒWdƒn1sp0Y| t|jƒ|¡dS)z=A continuation at the end of input must be an error; bpo2180.rzx = 5\Nú\)Z assertRaisesrrrr Ú exception)r r ÚexcinforrrÚtest_line_continuation_EOF&s & &z&EOFTestCase.test_line_continuation_EOFzsys.executable requiredcCs°t ¡”}t |dd¡}t |¡\}}}| d|¡| d|¡| d|¡t |dd¡}t |¡\}}}| d|¡| d|¡| d|¡Wdƒn1s¢0YdS) z9Ensure tok_nextc() does not add too many ending newlines.Zfoorsunexpected EOF while parsingsline 2ó\zy = 6\sy = 6\N)rÚtemp_dirrZ make_scriptZassert_python_failureZassertIn)r rÚ file_nameÚrcÚoutÚerrrrrÚ,test_line_continuation_EOF_from_file_bpo21800s      z8EOFTestCase.test_line_continuation_EOF_from_file_bpo2180N) Ú__name__Ú __module__Ú __qualname__rrrrÚunittestZskipIfÚsysÚ executabler"rrrrrs     rÚ__main__) Ú__doc__r'ÚtestrZ test.supportrr&ZTestCaserr#ÚmainrrrrÚs  8