diff options
author | Mark Hammond <mhammond@skippinet.com.au> | 2000-07-30 02:20:38 (GMT) |
---|---|---|
committer | Mark Hammond <mhammond@skippinet.com.au> | 2000-07-30 02:20:38 (GMT) |
commit | af4cfae300846ecf6ad21946f52535fd69e1773b (patch) | |
tree | 7b72cf31a351f67852abc8bfd7b0a9df26a7e6e4 | |
parent | 6b24dffd13155ccd8ff33a4ad788452c16953574 (diff) | |
download | cpython-af4cfae300846ecf6ad21946f52535fd69e1773b.zip cpython-af4cfae300846ecf6ad21946f52535fd69e1773b.tar.gz cpython-af4cfae300846ecf6ad21946f52535fd69e1773b.tar.bz2 |
Test that after resizing the mmap'd file, we can't seek beyond the new size.
-rw-r--r-- | Lib/test/test_mmap.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py index de78c14..44d28f1 100644 --- a/Lib/test/test_mmap.py +++ b/Lib/test/test_mmap.py @@ -105,7 +105,14 @@ def test_both(): pass else: # resize() is supported - pass + 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 + else: + assert 0, 'Could seek beyond the new size' m.close() os.unlink("foo") |