summaryrefslogtreecommitdiffstats
path: root/WebKitTools/Scripts/webkitpy/common/system
diff options
context:
space:
mode:
Diffstat (limited to 'WebKitTools/Scripts/webkitpy/common/system')
-rw-r--r--WebKitTools/Scripts/webkitpy/common/system/filesystem_mock.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/WebKitTools/Scripts/webkitpy/common/system/filesystem_mock.py b/WebKitTools/Scripts/webkitpy/common/system/filesystem_mock.py
index 2dbc1e8..4e6d3da 100644
--- a/WebKitTools/Scripts/webkitpy/common/system/filesystem_mock.py
+++ b/WebKitTools/Scripts/webkitpy/common/system/filesystem_mock.py
@@ -49,7 +49,16 @@ class MockFileSystem(object):
return False
def join(self, *comps):
- return '/'.join(comps)
+ # os.path.join ignores trailing slashes on components (i.e.
+ # join('foo/', 'bar') and join('foo', 'bar') produce the same result),
+ # we emulate that behavior.
+ trimmed_comps = []
+ for comp in comps:
+ if len(comp) and comp[-1] == '/':
+ trimmed_comps.append(comp[0:-1])
+ else:
+ trimmed_comps.append(comp)
+ return '/'.join(trimmed_comps)
def maybe_make_directory(self, *path):
# FIXME: Implement such that subsequent calls to isdir() work?