Skip to content

test: regression for #2234 empty positional arg after a flag#2328

Open
c-tonneslan wants to merge 1 commit into
urfave:mainfrom
c-tonneslan:empty-arg-with-flag-regression
Open

test: regression for #2234 empty positional arg after a flag#2328
c-tonneslan wants to merge 1 commit into
urfave:mainfrom
c-tonneslan:empty-arg-with-flag-regression

Conversation

@c-tonneslan
Copy link
Copy Markdown

@c-tonneslan c-tonneslan commented May 15, 2026

What type of PR is this?

  • bug

What this PR does / why we need it

Issue #2234 reported that an empty positional arg following a flag (e.g. app -f=val "" arg2 arg3) got dropped along with every arg after it. The bug isn't reproducible on current main (the existing TestEmptyPositionalArgs cases all pass), but there's no test that pins down the case where a flag and an empty positional are mixed, which is exactly what the issue described.

Adding a small regression test so the case doesn't quietly break again. Covers both -f=val and -f val forms.

Which issue(s) this PR fixes

Fixes #2234

Testing

go test -run TestEmptyPositionalArgs -v passes both the existing cases and the two new ones.

Release Notes

NONE

Signed-off-by: Charlie Tonneslan <cst0520@gmail.com>
@c-tonneslan c-tonneslan requested a review from a team as a code owner May 15, 2026 19:15
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.

An empty argument and all subsequent arguments are dropped

1 participant