diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-05-11 23:57:53 (GMT) |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-05-11 23:57:53 (GMT) |
commit | 3486a98dcd7f11215b61be3428edbbc9b6aa3164 (patch) | |
tree | 3077952f72041cedc71b79469e76c4e577ff2ec5 /Lib/test/test_io.py | |
parent | e9c7d6c3d90667727b668248d2a8191cfefa2528 (diff) | |
download | cpython-3486a98dcd7f11215b61be3428edbbc9b6aa3164.zip cpython-3486a98dcd7f11215b61be3428edbbc9b6aa3164.tar.gz cpython-3486a98dcd7f11215b61be3428edbbc9b6aa3164.tar.bz2 |
Issue #9971: Write an optimized implementation of BufferedReader.readinto().
Patch by John O'Connor.
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r-- | Lib/test/test_io.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 8d293d0..153548e 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -794,6 +794,12 @@ class BufferedReaderTest(unittest.TestCase, CommonBufferedTests): self.assertEqual(b, b"gf") self.assertEqual(bufio.readinto(b), 0) self.assertEqual(b, b"gf") + rawio = self.MockRawIO((b"abc", None)) + bufio = self.tp(rawio) + self.assertEqual(bufio.readinto(b), 2) + self.assertEqual(b, b"ab") + self.assertEqual(bufio.readinto(b), 1) + self.assertEqual(b, b"cb") def test_readlines(self): def bufio(): |