Skip to content

tests: fix "old" names in generated patch files#224

Draft
marc-hb wants to merge 1 commit intouutils:mainfrom
marc-hb:old-names
Draft

tests: fix "old" names in generated patch files#224
marc-hb wants to merge 1 commit intouutils:mainfrom
marc-hb:old-names

Conversation

@marc-hb
Copy link
Copy Markdown

@marc-hb marc-hb commented May 5, 2026

Fixes #223. Very simple reproduction

cd diffutils
mkdir a
touch a/alef  a/alefn  a/alef_  a/alefx  a/alefr  a/fuzz.file
cargo test

=> fail

https://www.gnu.org/software/diffutils/manual/html_node/Multiple-Patches.html states that the "old" file name has precedence over the "new" filename.

I hit this problem because some other (and unfortunately: unknown for now) test issue left bogus a/alef* file(s) behind in my workspace. I didn't bother cleaning them up because I assumed some test would keep recreating them and that cost me a lot of time.

This issue seems to have existed since the very first commit. Interestingly, there as a previous attempt in 2024 to fix this in commit a3a372f ! So I was apparently not the only affected. BUT that fix was immediately reverted by commit ba7cb0a in the same PR. Admittedly, that fix seemed somewhat off-topic in #33. So here it is again.

Fixes uutils#223. Very simple reproduction

```
cd diffutils
mkdir a
touch a/alef  a/alefn  a/alef_  a/alefx  a/alefr  a/fuzz.file
cargo test
```
 => fail

https://www.gnu.org/software/diffutils/manual/html_node/Multiple-Patches.html
states that the "old" file name has precedence over the "new" filename.

I hit this problem because some other (and unfortunately: unknown for
now) test issue left bogus `a/alef*` file(s) behind in my workspace. I
didn't bother cleaning them up because I assumed some test would keep
recreating them and that cost me a lot of time.

This issue seems to have existed since the very first commit.
Interestingly, there as a previous attempt in 2024 to fix this in commit
a3a372f ! So I was apparently not the only affected. BUT that
fix was immediately reverted by commit ba7cb0a in the same
PR. Admittedly, that fix seemed somewhat off-topic in
uutils#33. So here it is again.
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.

"Old" filename in patch files generated for testing does not exist and can cause failures

1 participant