summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2000-03-31 01:09:14 (GMT)
committerGuido van Rossum <guido@python.org>2000-03-31 01:09:14 (GMT)
commit767e775a98df2b1537fea974c062c8e2df8b2907 (patch)
tree139818b9125a06dbd8a5326e58e01a92489d445d /Lib/test
parent2b6004a07f8c5eb6006e8c9fc466b0499b00c105 (diff)
downloadcpython-767e775a98df2b1537fea974c062c8e2df8b2907.zip
cpython-767e775a98df2b1537fea974c062c8e2df8b2907.tar.gz
cpython-767e775a98df2b1537fea974c062c8e2df8b2907.tar.bz2
Improved test, by Mark Hammond, for Win32.
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_mmap.py21
1 files changed, 10 insertions, 11 deletions
diff --git a/Lib/test/test_mmap.py b/Lib/test/test_mmap.py
index d6c7c89..b8ecbe7 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -4,9 +4,9 @@ import string, os, re, sys
PAGESIZE = mmap.PAGESIZE
-def test_unix():
- "Test mmap module on Unix systems"
-
+def test_both():
+ "Test mmap module on Unix systems and Windows"
+
# Create an mmap'ed file
f = open('foo', 'w+')
@@ -14,8 +14,11 @@ def test_unix():
f.write('\0'* PAGESIZE)
f.write('foo')
f.write('\0'* (PAGESIZE-3) )
-
- m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
+
+ if sys.platform[:3]=="win":
+ m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
+ else:
+ m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
f.close()
# Simple sanity checks
@@ -61,9 +64,5 @@ def test_unix():
print ' Test passed'
-# XXX need to write a test suite for Windows
-if sys.platform == 'win32':
- pass
-else:
- test_unix()
-
+test_both()
+