diff options
author | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-08 12:42:20 (GMT) |
---|---|---|
committer | Florent Xicluna <florent.xicluna@gmail.com> | 2010-03-08 12:42:20 (GMT) |
commit | e3ed2e02be2df49f040ea1560a86727bf7a99fee (patch) | |
tree | bd4c840d1aa6f3ffd104d1364a5388fc2a8f55cd /Lib/test/test_genericpath.py | |
parent | 19b02d4558515e761755346dd1c119cf6ad55352 (diff) | |
download | cpython-e3ed2e02be2df49f040ea1560a86727bf7a99fee.zip cpython-e3ed2e02be2df49f040ea1560a86727bf7a99fee.tar.gz cpython-e3ed2e02be2df49f040ea1560a86727bf7a99fee.tar.bz2 |
Merge other tests from test_*path.py into test_genericpath.CommonTest, and do some cleanup.
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'] |