Skip to content

Add end-to-end regression test that {.} keeps the ./ prefix for dash-prefixed names - #2246

Merged
tmccombs merged 1 commit into
sharkdp:masterfrom
pei711:fix/exec-noext-dash-path-2236
Dec 2, 2026
Merged

tmccombs merged 1 commit into
sharkdp:masterfrom
pei711:fix/exec-noext-dash-path-2236

Conversation

@pei711

@pei711 pei711 commented Nov 30, 2026 •

Copy link
Copy Markdown

The fix for #2236 landed in #2243, so this PR is now test-only, as suggested in review.

It keeps the end-to-end CLI regression test: for a file named -rf.jpg, fd --extension jpg --exec printf '[%s]\n' {.} must output [./-rf], i.e. the {.} placeholder keeps the ./ prefix so the name is not passed to the command as an option. The unit-level cases from the original PR turned out to already be covered on master, so they are dropped.

Rebased on current master; the new test passes locally (cargo test --test tests test_exec_no_extension_placeholder_keeps_dash_prefix).

Refs #2236

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-30T21:08:29.701748Z 4c36581 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@atishay-kasliwal atishay-kasliwal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks already fixed on master by #2243. I built current master and this branch, and on a tree with -rf.jpg, --delete.jpg and sub/-x.jpg, {.}, {}, {/}, {/.}, {//} and -X {.} give identical output on both ({.} is ./-rf on master too), so this may only need the extra test and a rebase. Separately, {/} still passes -rf.jpg without a ./ prefix on both.

@tmccombs tmccombs left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs a rebase at the least. I'm also not sure there is much here worth adding since the issue has already been fixed in another PR.

…d names

The fix for sharkdp#2236 landed in sharkdp#2243; this keeps the end-to-end CLI
regression test from sharkdp#2246, rebased on current master.
@pei711
pei711 force-pushed the fix/exec-noext-dash-path-2236 branch from 4c36581 to b948f35 Compare December 1, 2026 16:26
@pei711 pei711 changed the title Preserve dash-prefixed paths in the {.} exec placeholder Add end-to-end regression test that {.} keeps the ./ prefix for dash-prefixed names Dec 1, 2026
@pei711

pei711 commented Dec 1, 2026

Copy link
Copy Markdown
Author

@tmccombs Rebased on current master and reduced this to test-only, as you and @atishay-kasliwal suggested. The fix itself landed in #2243, and the unit cases from the original PR are already covered on master, so the only remaining change is the end-to-end CLI regression test for {.} with a dash-prefixed filename. It passes locally. Happy to drop this entirely if you don't think the extra coverage is worth it.

@tmccombs
tmccombs merged commit 5ecf759 into sharkdp:master Dec 2, 2026
20 checks passed
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.

3 participants