fix MockFileSystem.glob(), refactor filesystem tests
Created attachment 106085 [details] Patch
Comment on attachment 106085 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=106085&action=review OK. > Tools/Scripts/webkitpy/common/system/filesystem_mock.py:155 > + glob_string = glob_string.replace('\\*', '[^\\/]*') + '$' > + glob_string = glob_string.replace('\\/', '/') > + path_filter = lambda path: re.match(glob_string, path) This is going to end up matching . in glob_string against any char. Which is OK, but you shoudl be aware.
Comment on attachment 106085 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=106085&action=review >> Tools/Scripts/webkitpy/common/system/filesystem_mock.py:155 >> + path_filter = lambda path: re.match(glob_string, path) > > This is going to end up matching . in glob_string against any char. Which is OK, but you shoudl be aware. If I understand you correctly (you're saying that glob('foo.ar') will match a file called 'foobar', I don't think so; the '.' in glob string is escaped out on line 152. Or am I missing something?
Comment on attachment 106085 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=106085&action=review >>> Tools/Scripts/webkitpy/common/system/filesystem_mock.py:155 >>> + path_filter = lambda path: re.match(glob_string, path) >> >> This is going to end up matching . in glob_string against any char. Which is OK, but you shoudl be aware. > > If I understand you correctly (you're saying that glob('foo.ar') will match a file called 'foobar', I don't think so; the '.' in glob string is escaped out on line 152. Or am I missing something? Ah, I missed the regexp escape.
(In reply to comment #4) > Ah, I missed the regexp escape. Okay. Probably would be a good thing to test for, though. I'll add a test. Thanks!
Committed r94618: <http://trac.webkit.org/changeset/94618>