From 0a5485390d43f408b130011ae3452855e766786d Mon Sep 17 00:00:00 2001 From: achapp Date: Tue, 25 Nov 2014 12:30:32 -0600 Subject: new readline test passes Changed file.py readline() to always check for a newline. Had to make a few changes for what went into self._rbuffer in the case where buffer size was met or exceeded and we found a newline. --- tests/test_file.py | 1 + 1 file changed, 1 insertion(+) (limited to 'tests/test_file.py') diff --git a/tests/test_file.py b/tests/test_file.py index 24a7fa9b..044dc591 100755 --- a/tests/test_file.py +++ b/tests/test_file.py @@ -77,6 +77,7 @@ class BufferedFileTest (unittest.TestCase): # truncated line: self.assertEqual(f.readline(7), 'Third l') self.assertEqual(f.readline(), 'ine.\n') + # readline should not read past the fourth line self.assertEqual(f.readline(25), 'Fourth line.\n') self.assertEqual(f.readline(), 'Fifth line.\n') self.assertEqual(f.readline(), 'Final line non-terminated.') -- cgit v1.2.3