uutils / findutils

Rust implementation of findutils
MIT License
280 stars 36 forks source link

find: Fix unexpectedly accepted empty expression. #353

Closed hanbings closed 2 months ago

hanbings commented 3 months ago

fix: https://github.com/uutils/findutils/issues/29

This commit modifies a test function build_top_level_matcher_too_many_brackets outside of my code, which tests that find -true \( \) \) will return a too many ')' error.

But in GNU find, this instruction will first cause an empty parentheses are not allowed error, so it is changed to find . -type f \( -name "*.txt" \) \) to maintain compatibility.

codecov[bot] commented 3 months ago

Codecov Report

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

Project coverage is 59.41%. Comparing base (d8e2ce2) to head (0febdac).

Files Patch % Lines
src/find/matchers/mod.rs 66.66% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #353 +/- ## ========================================== + Coverage 59.34% 59.41% +0.06% ========================================== Files 30 30 Lines 3822 3831 +9 Branches 867 871 +4 ========================================== + Hits 2268 2276 +8 Misses 1218 1218 - Partials 336 337 +1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

sylvestre commented 3 months ago

could you please add a test here: https://github.com/uutils/findutils/blob/main/tests/find_cmd_tests.rs thanks

hanbings commented 3 months ago

could you please add a test here: https://github.com/uutils/findutils/blob/main/tests/find_cmd_tests.rs thanks

OK, it's included in the latest commit.

cakebaker commented 2 months ago

Thanks!