diff options
-rw-r--r-- | test/test_testing.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/test_testing.py b/test/test_testing.py index 1cae9310..67f4412c 100644 --- a/test/test_testing.py +++ b/test/test_testing.py @@ -109,3 +109,11 @@ class CoverageTestTest(CoverageTest): # A deeper directory self.make_file("sub/deeper/evenmore/third.txt") self.assertEqual(open("sub/deeper/evenmore/third.txt").read(), "") + + def test_make_file_newline(self): + self.make_file("unix.txt", "Hello\n") + self.assertEqual(open("unix.txt", "rb").read().decode('ascii'), "Hello\n") + self.make_file("dos.txt", "Hello\n", newline="\r\n") + self.assertEqual(open("dos.txt", "rb").read().decode('ascii'), "Hello\r\n") + self.make_file("mac.txt", "Hello\n", newline="\r") + self.assertEqual(open("mac.txt", "rb").read().decode('ascii'), "Hello\r") |