diff options
Diffstat (limited to 'Lib/test/test_genericpath.py')
-rw-r--r-- | Lib/test/test_genericpath.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/Lib/test/test_genericpath.py b/Lib/test/test_genericpath.py index 614f887..4ceb292 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" + ) self.assertEqual( commonprefix([b"/home/swenson/spam", b"/home/swen/spam"]), @@ -60,6 +72,18 @@ class GenericTest(unittest.TestCase): commonprefix([b"/home/swen/spam", b"/home/swen/spam"]), b"/home/swen/spam" ) + self.assertEqual( + commonprefix([b"home:swenson:spam", b"home:swen:spam"]), + b"home:swen" + ) + self.assertEqual( + commonprefix([b":home:swen:spam", b":home:swen:eggs"]), + b":home:swen:" + ) + self.assertEqual( + commonprefix([b":home:swen:spam", b":home:swen:spam"]), + b":home:swen:spam" + ) testlist = ['', 'abc', 'Xbcd', 'Xb', 'XY', 'abcd', 'aXc', 'abd', 'ab', 'aX', 'abcX'] |