mirror of
https://github.com/python/cpython.git
synced 2025-12-04 08:34:25 +00:00
Test that after resizing the mmap'd file, we can't seek beyond the new size.
This commit is contained in:
parent
6b24dffd13
commit
af4cfae300
1 changed files with 8 additions and 1 deletions
|
|
@ -105,7 +105,14 @@ def test_both():
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
# resize() is supported
|
# resize() is supported
|
||||||
|
assert len(m) == 512, "len(m) is %d, but expecting 512" % (len(m),)
|
||||||
|
# Check that we can no longer seek beyond the new size.
|
||||||
|
try:
|
||||||
|
m.seek(513,0)
|
||||||
|
except ValueError:
|
||||||
pass
|
pass
|
||||||
|
else:
|
||||||
|
assert 0, 'Could seek beyond the new size'
|
||||||
|
|
||||||
m.close()
|
m.close()
|
||||||
os.unlink("foo")
|
os.unlink("foo")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue