Skip to content

-name / should match /// - #508

Merged
hanbings merged 4 commits into
uutils:mainfrom
Every2:main
Mar 25, 2025
Merged

hanbings merged 4 commits into
uutils:mainfrom
Every2:main

Conversation

@Every2

@Every2 Every2 commented Mar 20, 2025

Copy link
Copy Markdown

Hi, I did some tests and the problem in #24 is because when we pass the './target/debug/find /// -maxdepth 0 -name /' it returns false.

impl Matcher for NameMatcher {
    fn matches(&self, file_info: &WalkEntry, _: &mut MatcherIO) -> bool {
         let name = file_info.file_name().to_string_lossy();
        self.pattern.matches(&name)
    }
}

I put an early return as an alternative solution, but I don't know if it's a good solution.

@codecov

codecov Bot commented Mar 21, 2025 •

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.51%. Comparing base (5d264c9) to head (c7b89d5).
Report is 5 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #508      +/-   ##
==========================================
+ Coverage   87.46%   87.51%   +0.05%     
==========================================
  Files          31       31              
  Lines        6692     6704      +12     
  Branches      299      300       +1     
==========================================
+ Hits         5853     5867      +14     
+ Misses        627      626       -1     
+ Partials      212      211       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sylvestre

Copy link
Copy Markdown
Contributor

Could you please add a test to make sure we don't regress? Thanks

@Every2

Every2 commented Mar 21, 2025

Copy link
Copy Markdown
Author

Could you please add a test to make sure we don't regress? Thanks

Of course!

@hanbings hanbings linked an issue Mar 21, 2025 that may be closed by this pull request
@Every2

Every2 commented Mar 22, 2025 •

Copy link
Copy Markdown
Author

@sylvestre Added the new test, can you review it? Thanks in advance.

@hanbings

Copy link
Copy Markdown
Collaborator

Hello, based on the Action logs, this RP seems to have caused a Windows test failure. Could you take a look?
Added: If this functionality doesn't work on Windows, you could add a suitable macro along with a comment explaining it.
Thanks!

@sylvestre

Copy link
Copy Markdown
Contributor

please also add a test in tests/find_cmd_tests.rs

@Every2

Every2 commented Mar 24, 2025

Copy link
Copy Markdown
Author

@sylvestre and @hanbings Could you review the tests? Thanks for the help and guidance of both. :)

@hanbings
hanbings merged commit 28b1c88 into uutils:main Mar 25, 2025
@hanbings

Copy link
Copy Markdown
Collaborator

Thanks!

Comment thread src/find/matchers/name.rs Resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

-name / should match ///

4 participants