mirror of
https://github.com/python/cpython.git
synced 2025-12-09 18:48:05 +00:00
Added fast alternate io.BytesIO implementation and its test suite.
Removed old test suite for StringIO. Modified truncate() to imply a seek to given argument value.
This commit is contained in:
parent
5d8da20dd1
commit
77250f4df7
10 changed files with 1245 additions and 193 deletions
|
|
@ -120,14 +120,15 @@ class TestCase(unittest.TestCase):
|
|||
newsize -= 1
|
||||
f.seek(42)
|
||||
f.truncate(newsize)
|
||||
self.assertEqual(f.tell(), 42) # else pointer moved
|
||||
f.seek(0, 2)
|
||||
self.assertEqual(f.tell(), newsize) # else wasn't truncated
|
||||
f.seek(0, 2)
|
||||
self.assertEqual(f.tell(), newsize)
|
||||
# XXX truncate(larger than true size) is ill-defined
|
||||
# across platform; cut it waaaaay back
|
||||
f.seek(0)
|
||||
f.truncate(1)
|
||||
self.assertEqual(f.tell(), 0) # else pointer moved
|
||||
self.assertEqual(f.tell(), 1) # else pointer moved
|
||||
f.seek(0)
|
||||
self.assertEqual(len(f.read()), 1) # else wasn't truncated
|
||||
|
||||
def test_main():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue