From: Mark Hammond Date: Sun, 30 Jul 2000 02:20:38 +0000 (+0000) Subject: Test that after resizing the mmap'd file, we can't seek beyond the new size. X-Git-Tag: v2.0b1~675 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=af4cfae300846ecf6ad21946f52535fd69e1773b;p=thirdparty%2FPython%2Fcpython.git Test that after resizing the mmap'd file, we can't seek beyond the new size. --- diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py index de78c14268f5..44d28f13a73a 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")