Page MenuHomePhabricator

Escape glob characters for FileFinder's withSuffix() and withName()
ClosedPublic

Authored by epriestley on Jan 31 2018, 9:32 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Feb 9, 5:11 AM
Unknown Object (File)
Sun, Feb 9, 5:10 AM
Unknown Object (File)
Sun, Feb 9, 5:10 AM
Unknown Object (File)
Sun, Feb 9, 5:10 AM
Unknown Object (File)
Fri, Jan 31, 4:56 AM
Unknown Object (File)
Fri, Jan 24, 11:33 PM
Unknown Object (File)
Fri, Jan 24, 11:32 PM
Unknown Object (File)
Fri, Jan 24, 11:32 PM
Subscribers
None

Details

Summary

Depends on D18980. When you search for files withSuffix('t*t'), that should match that suffix, literally, in a portable way.

Test Plan

Added unit tests and made them pass.

Diff Detail

Repository
rPHU libphutil
Branch
finder3
Lint
Lint Errors
SeverityLocationCodeMessage
Errorsrc/filesystem/__tests__/glob-magic/star-*.*:NAME1Bad Filename
Errorsrc/filesystem/__tests__/glob-magic/star-*.txt:NAME1Bad Filename
Errorsrc/filesystem/__tests__/glob-magic/star.t*t:NAME1Bad Filename
Unit
Tests Passed
Build Status
Buildable 19304
Build 26090: Run Core Tests
Build 26089: arc lint + arc unit

Event Timeline

  • Create a temporary directory and write all the glob garbage to it instead.
amckinley added inline comments.
src/filesystem/__tests__/FileFinderTestCase.php
124–126

thumbsup.gif (320×300 px, 6 MB)

This revision is now accepted and ready to land.Jan 31 2018, 10:02 PM
This revision was automatically updated to reflect the committed changes.