]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Test that after resizing the mmap'd file, we can't seek beyond the new size.
authorMark Hammond <mhammond@skippinet.com.au>
Sun, 30 Jul 2000 02:20:38 +0000 (02:20 +0000)
committerMark Hammond <mhammond@skippinet.com.au>
Sun, 30 Jul 2000 02:20:38 +0000 (02:20 +0000)
Lib/test/test_mmap.py

index de78c14268f51a894237658520d956a42433f90f..44d28f13a73afee8316fe644382e0cf999ab5e37 100644 (file)
@@ -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")