Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

find: Fix convert_arg_to_comparable_value() function parsing unexpected characters. #361

Merged
merged 2 commits into from
May 16, 2024

Conversation

hanbings
Copy link
Collaborator

convert_arg_to_comparable_value() as mentioned in #355 (comment) parses some strange characters.

The original regular expression was ([+-]?)(\d+)$ , which did a partial match and only included 1%2 of 2 as part of the match.
After adding the ^ limiter (^([+-]?)(\d+)$), the expression can be restricted to only match + - or 0-9.

Copy link

codecov bot commented Apr 23, 2024

Codecov Report

Attention: Patch coverage is 94.11765% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 58.88%. Comparing base (baa09ba) to head (c0b8cd0).

Files Patch % Lines
src/find/matchers/mod.rs 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #361      +/-   ##
==========================================
+ Coverage   58.34%   58.88%   +0.53%     
==========================================
  Files          30       30              
  Lines        3815     3831      +16     
  Branches      860      860              
==========================================
+ Hits         2226     2256      +30     
+ Misses       1257     1254       -3     
+ Partials      332      321      -11     

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

@sylvestre
Copy link
Contributor

please add integration tests too to trigger the error and make sure we are handling it correctly

@hanbings
Copy link
Collaborator Author

hanbings commented Apr 24, 2024

Thanks.
I added an command test for the -a/c/mtime directive in find_cmd_tests.rs.

But it may be that Codecov does not detect the diff because the PR only fixes regular expressions, so the coverage changes cannot be seen in the Codecov report.

@sylvestre sylvestre merged commit 70b7b36 into uutils:main May 16, 2024
18 checks passed
@hanbings hanbings deleted the fix-355 branch May 24, 2024 13:35
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.

2 participants