diff options
author | Guido van Rossum <guido@python.org> | 2007-04-11 14:19:59 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-04-11 14:19:59 (GMT) |
commit | cba608cadbf24f2f88f5db215a58fc9428a9aafd (patch) | |
tree | b99f066084e02d12ba2a5419fa7b600205db382d /Lib/test/test_io.py | |
parent | 0dd32e246cd232012d07926ae312205decb74b61 (diff) | |
download | cpython-cba608cadbf24f2f88f5db215a58fc9428a9aafd.zip cpython-cba608cadbf24f2f88f5db215a58fc9428a9aafd.tar.gz cpython-cba608cadbf24f2f88f5db215a58fc9428a9aafd.tar.bz2 |
More efficient implementation of tell(); _read_chunk() doesn't have to
call self.buffer.tell().
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r-- | Lib/test/test_io.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index d19b2a0..5542a5b 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -532,25 +532,21 @@ class TextIOWrapperTest(unittest.TestCase): f.truncate() sample = u"s\xff\u0fff\uffff" wlines = [] - for size in (0, 1, 2, 3, 4, 5, 15, 16, 17, 31, 32, 33, 63, 64, 65, - 100, 200, 300, 400, 500, 1000): + for size in (0, 1, 2, 3, 4, 5, 30, 31, 32, 33, 62, 63, 64, 65, 1000): chars = [] for i in xrange(size): chars.append(sample[i % len(sample)]) line = u"".join(chars) + "\n" wlines.append((f.tell(), line)) f.write(line) - wendpos = f.tell() f.seek(0) rlines = [] while True: pos = f.tell() line = f.readline() if not line: - rendpos = pos break rlines.append((pos, line)) - self.assertEquals(rendpos, wendpos) self.assertEquals(rlines, wlines) |