mirror of
https://github.com/python/cpython.git
synced 2025-08-31 22:18:28 +00:00
Merged revisions 76230 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r76230 | benjamin.peterson | 2009-11-12 17:39:44 -0600 (Thu, 12 Nov 2009) | 2 lines fix several compile() issues by translating newlines in the tokenizer ........
This commit is contained in:
parent
a1d23326b1
commit
aeaa592516
8 changed files with 106 additions and 35 deletions
|
@ -5,6 +5,19 @@ from test import support
|
|||
|
||||
class TestSpecifics(unittest.TestCase):
|
||||
|
||||
def test_no_ending_newline(self):
|
||||
compile("hi", "<test>", "exec")
|
||||
compile("hi\r", "<test>", "exec")
|
||||
|
||||
def test_empty(self):
|
||||
compile("", "<test>", "exec")
|
||||
|
||||
def test_other_newlines(self):
|
||||
compile("\r\n", "<test>", "exec")
|
||||
compile("\r", "<test>", "exec")
|
||||
compile("hi\r\nstuff\r\ndef f():\n pass\r", "<test>", "exec")
|
||||
compile("this_is\rreally_old_mac\rdef f():\n pass", "<test>", "exec")
|
||||
|
||||
def test_debug_assignment(self):
|
||||
# catch assignments to __debug__
|
||||
self.assertRaises(SyntaxError, compile, '__debug__ = 1', '?', 'single')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue