diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py index fc0c33d430f..af501cf0c76 100644 --- a/Lib/test/test_genericpath.py +++ b/Lib/test/test_genericpath.py @@ -47,6 +47,18 @@ class GenericTest(unittest.TestCase): commonprefix(["/home/swen/spam", "/home/swen/spam"]), "/home/swen/spam" ) + self.assertEqual( + commonprefix(["home:swenson:spam", "home:swen:spam"]), + "home:swen" + ) + self.assertEqual( + commonprefix([":home:swen:spam", ":home:swen:eggs"]), + ":home:swen:" + ) + self.assertEqual( + commonprefix([":home:swen:spam", ":home:swen:spam"]), + ":home:swen:spam" + ) testlist = ['', 'abc', 'Xbcd', 'Xb', 'XY', 'abcd', 'aXc', 'abd', 'ab', 'aX', 'abcX'] diff --git a/Lib/test/test_macpath.py b/Lib/test/test_macpath.py index b29ed4c02c7..2c86c532c7e 100644 --- a/Lib/test/test_macpath.py +++ b/Lib/test/test_macpath.py @@ -18,16 +18,6 @@ class MacPathTestCase(unittest.TestCase): self.assertFalse(isabs(":foo:bar")) self.assertFalse(isabs(":foo:bar:")) - - def test_commonprefix(self): - commonprefix = macpath.commonprefix - self.assertEqual(commonprefix(["home:swenson:spam", "home:swen:spam"]), - "home:swen") - self.assertEqual(commonprefix([":home:swen:spam", ":home:swen:eggs"]), - ":home:swen:") - self.assertEqual(commonprefix([":home:swen:spam", ":home:swen:spam"]), - ":home:swen:spam") - def test_split(self): split = macpath.split self.assertEqual(split("foo:bar"),