diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2014-12-17 16:01:10 -0800 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2014-12-17 16:01:10 -0800 |
commit | cca8c511f69e355bdce1534c6091d5c65e7f114c (patch) | |
tree | fbdb580631caffb5bdba25d341df3db80f76f14d /tests | |
parent | 87047cccb99914d75553bceeb9abb9afab00e6fb (diff) | |
parent | fc59b7db5d995d03cc502be906f6fab8e948228c (diff) |
Merge branch '1.13' into 1.14
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_file.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/test_file.py b/tests/test_file.py index 22a34aca..a6ff69e9 100755 --- a/tests/test_file.py +++ b/tests/test_file.py @@ -70,13 +70,17 @@ class BufferedFileTest (unittest.TestCase): def test_2_readline(self): f = LoopbackFile('r+U') - f.write(b'First line.\nSecond line.\r\nThird line.\nFinal line non-terminated.') + f.write(b'First line.\nSecond line.\r\nThird line.\n' + + b'Fourth line.\nFinal line non-terminated.') + self.assertEqual(f.readline(), 'First line.\n') # universal newline mode should convert this linefeed: self.assertEqual(f.readline(), 'Second line.\n') # truncated line: self.assertEqual(f.readline(7), 'Third l') self.assertEqual(f.readline(), 'ine.\n') + # newline should be detected and only the fourth line returned + self.assertEqual(f.readline(39), 'Fourth line.\n') self.assertEqual(f.readline(), 'Final line non-terminated.') self.assertEqual(f.readline(), '') f.close() |