summaryrefslogtreecommitdiff
path: root/test/test_execfile.py
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2009-06-29 11:57:38 -0400
committerNed Batchelder <ned@nedbatchelder.com>2009-06-29 11:57:38 -0400
commit82a63bcc44f505b28cd7d17249c88d9f01615e50 (patch)
tree1419ceaa9ec9984fe9bcf58341b04de46898240f /test/test_execfile.py
parent318364cdc098ca929a51f9944506b3ef505b0776 (diff)
parent27aceec8f322fa0703c8b1aea550182422a9f4b0 (diff)
downloadpython-coveragepy-git-82a63bcc44f505b28cd7d17249c88d9f01615e50.tar.gz
Merged weekend work
Diffstat (limited to 'test/test_execfile.py')
-rw-r--r--test/test_execfile.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test_execfile.py b/test/test_execfile.py
index eae227a1..6cc7cab8 100644
--- a/test/test_execfile.py
+++ b/test/test_execfile.py
@@ -46,3 +46,14 @@ class RunTest(CoverageTest):
self.assertEqual(os.listdir("."), ["xxx"])
run_python_file("xxx", ["xxx"])
self.assertEqual(os.listdir("."), ["xxx"])
+
+ def test_universal_newlines(self):
+ # Make sure we can read any sort of line ending.
+ pylines = """# try newlines|print 'Hello, world!'|""".split('|')
+ for nl in ('\n', '\r\n', '\r'):
+ fpy = open('nl.py', 'wb')
+ fpy.write(nl.join(pylines))
+ fpy.close()
+ run_python_file('nl.py', ['nl.py'])
+ self.assertEqual(self.stdout(), "Hello, world!\n"*3)
+