a ze @sRdZddlZddlmZddlmZddlZGdddejZe dkrNe dS)z/test script for a few new invalid token catchesN)support) script_helperc@sDeZdZddZddZddZddZee j d d d Z d S) EOFTestCasec CsPd}z tdWn4tyD}z|t||WYd}~nd}~00tjdS)Nz4EOL while scanning string literal (, line 1)z'this is a test eval SyntaxError assertEqualstrr TestFailedselfexpectmsgrA/opt/bitninja-python-dojo/embedded/lib/python3.9/test/test_eof.py test_EOFC s  &zEOFTestCase.test_EOFCc CsPd}z tdWn4tyD}z|t||WYd}~nd}~00tjdS)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}~00tjdS)N/unexpected EOF while parsing (, line 1)z"\xhh" \zexecT) dont_inherit)compilerrr rr r rrrtest_eof_with_line_continuations &z+EOFTestCase.test_eof_with_line_continuationcCsd}|t}tdWdn1s,0Y|t|j||t}tdWdn1sp0Y|t|j|dS)z=A continuation at the end of input must be an error; bpo2180.rzx = 5\N\)Z assertRaisesrrrr exception)r r excinforrrtest_line_continuation_EOF&s & &z&EOFTestCase.test_line_continuation_EOFzsys.executable requiredcCst}t|dd}t|\}}}|d||d||d|t|dd}t|\}}}|d||d||d|Wdn1s0YdS) z9Ensure tok_nextc() does not add too many ending newlines.Zfoorsunexpected EOF while parsingsline 2\zy = 6\sy = 6\N)rtemp_dirrZ make_scriptZassert_python_failureZassertIn)r r file_namercouterrrrr,test_line_continuation_EOF_from_file_bpo21800s      z8EOFTestCase.test_line_continuation_EOF_from_file_bpo2180N) __name__ __module__ __qualname__rrrrunittestZskipIfsys executabler"rrrrrs     r__main__) __doc__r'testrZ test.supportrr&ZTestCaserr#mainrrrrs  8