uutils / findutils

Rust implementation of findutils
MIT License
314 stars 38 forks source link

find: Fix `-newerXY` test code for Windows platform. #394

Closed hanbings closed 5 months ago

hanbings commented 6 months ago
  1. Using fs::remove_file in Windows platform tests may return an Ok() even if the file is not deleted immediately, which will cause an error in the code in the test that assumes the file is deleted.
  2. In another test code, some / separators were accidentally escaped as \\. Now it has been changed to use contains to determine whether the output contains a specific path and ignore the path separator problem.
codecov[bot] commented 6 months ago

Codecov Report

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

Project coverage is 58.88%. Comparing base (3badb05) to head (bd759d5).

Files Patch % Lines
src/find/matchers/time.rs 75.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #394 +/- ## ========================================== + Coverage 58.80% 58.88% +0.07% ========================================== Files 30 30 Lines 3855 3855 Branches 851 849 -2 ========================================== + Hits 2267 2270 +3 Misses 1254 1254 + Partials 334 331 -3 ```

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

sylvestre commented 6 months ago

please add tests to make sure we don't regress, thanks

cakebaker commented 6 months ago

@sylvestre: hm, what tests are you looking for? As far as I see it, this PR is about fixing the broken tests on Windows, so the tests are already there.

sylvestre commented 5 months ago

oups, sorry