[Python-checkins] r55273 - python/trunk/Lib/test/test_posixpath.py
raymond.hettinger
python-checkins at python.org
Fri May 11 20:00:05 CEST 2007
Author: raymond.hettinger
Date: Fri May 11 19:59:59 2007
New Revision: 55273
Modified:
python/trunk/Lib/test/test_posixpath.py
Log:
Better tests for posixpath.commonprefix
Modified: python/trunk/Lib/test/test_posixpath.py
==============================================================================
--- python/trunk/Lib/test/test_posixpath.py (original)
+++ python/trunk/Lib/test/test_posixpath.py Fri May 11 19:59:59 2007
@@ -130,6 +130,16 @@
"/home/swen/spam"
)
+ testlist = ['', 'abc', 'Xbcd', 'Xb', 'XY', 'abcd', 'aXc', 'abd', 'ab', 'aX', 'abcX']
+ for s1 in testlist:
+ for s2 in testlist:
+ p = posixpath.commonprefix([s1, s2])
+ self.assert_(s1.startswith(p))
+ self.assert_(s2.startswith(p))
+ if s1 != s2:
+ n = len(p)
+ self.assertNotEqual(s1[n:n+1], s2[n:n+1])
+
def test_getsize(self):
f = open(test_support.TESTFN, "wb")
try:
More information about the Python-checkins
mailing list