Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
a74b67e1
Commit
a74b67e1
authored
May 11, 2007
by
Raymond Hettinger
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Better tests for posixpath.commonprefix
parent
e3e62b37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
Lib/test/test_posixpath.py
Lib/test/test_posixpath.py
+10
-0
No files found.
Lib/test/test_posixpath.py
View file @
a74b67e1
...
...
@@ -130,6 +130,16 @@ class PosixPathTest(unittest.TestCase):
"/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
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment