mirror of
https://github.com/python/cpython.git
synced 2025-12-04 00:30:19 +00:00
Patch #536661: Improve performance of splitext. Add test_macpath.
This commit is contained in:
parent
427a290c9a
commit
de3337913f
6 changed files with 95 additions and 42 deletions
|
|
@ -15,6 +15,16 @@ def tester(fn, wantResult):
|
|||
print " returned: " + str(gotResult)
|
||||
print ""
|
||||
errors = errors + 1
|
||||
|
||||
tester('ntpath.splitext("foo.ext")', ('foo', '.ext'))
|
||||
tester('ntpath.splitext("/foo/foo.ext")', ('/foo/foo', '.ext'))
|
||||
tester('ntpath.splitext(".ext")', ('', '.ext'))
|
||||
tester('ntpath.splitext("\\foo.ext\\foo")', ('\\foo.ext\\foo', ''))
|
||||
tester('ntpath.splitext("foo.ext\\")', ('foo.ext\\', ''))
|
||||
tester('ntpath.splitext("")', ('', ''))
|
||||
tester('ntpath.splitext("foo.bar.ext")', ('foo.bar', '.ext'))
|
||||
tester('ntpath.splitext("xx/foo.bar.ext")', ('xx/foo.bar', '.ext'))
|
||||
tester('ntpath.splitext("xx\\foo.bar.ext")', ('xx\\foo.bar', '.ext'))
|
||||
|
||||
tester('ntpath.splitdrive("c:\\foo\\bar")',
|
||||
('c:', '\\foo\\bar'))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue