More efficient implementation of tell(); _read_chunk() doesn't have to
call self.buffer.tell().
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 @@
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)