sahib / rmlint

Extremely fast tool to remove duplicates and other lint from your filesystem
http://rmlint.rtfd.org
GNU General Public License v3.0
1.87k stars 130 forks source link

Paranoia shell test does not check whether file still exists #454

Closed bkaestner closed 3 years ago

bkaestner commented 3 years ago

b9d328be2041e42813119d060c86893853b8e250 fixed an ignored -p in the shell script template. However, the current test_paranoia doesn't enforce that behaviour if I'm not mistaken:

https://github.com/sahib/rmlint/blob/27c026df37d46678eadb5b31a066cab77a9fe9e6/tests/test_formatters/test_sh.py#L91-L111

Before b9d328be2041e42813119d060c86893853b8e250, "files no longer identical" text was included in rmlint's output, but the file was still removed, as open("...", "w") creates the given file.

There should be a check whether a) c still exists and b) that its content is still xxxx to make sure that paranoid mode actually doesn't remove any files when the original has been changed.