From f978ba005c883f19ebd131842a679d8a9b0fd354 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sun, 30 Jan 2011 11:46:12 -0500 Subject: Add a test for the newline= feature of make_file --- test/test_testing.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') 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") -- cgit v1.2.1