Skip to content

Conversation

@max-sixty
Copy link
Collaborator

This is a small fix to PR #811 which introduced --test-runner-fallback and --no-test-runner-fallback flags.

Issue

The previous PR added require_equals = true to the clap argument configuration, which broke backward compatibility with the space syntax:

The old implementation accepted both syntaxes, so this was a regression.

Fix

Removed require_equals = true from the argument configuration to restore backward compatibility. This allows all syntaxes to work:

New ergonomic syntax:

  • --test-runner-fallback (no value)
  • --no-test-runner-fallback

Backward compatible syntax:

  • --test-runner-fallback true (with space) ✅ now fixed
  • --test-runner-fallback=true (with equals)
  • --test-runner-fallback false
  • --test-runner-fallback=false

Testing

  • Added new test test_runner_fallback_space_true to cover the space syntax
  • All 7 test_runner_fallback tests pass

Changes

  • Removed require_equals = true from cargo-insta/src/cli.rs
  • Added test for space syntax in cargo-insta/tests/functional/test_runner_fallback.rs

🤖 Generated with Claude Code

This is a small fix to PR mitsuhiko#811 which introduced `--test-runner-fallback`
and `--no-test-runner-fallback` flags.

## Issue

The previous PR added `require_equals = true` to the clap argument
configuration, which broke backward compatibility with the space syntax:

- ❌ `--test-runner-fallback true` (broke in mitsuhiko#811)
- ✅ `--test-runner-fallback=true` (still worked)

The old implementation accepted both syntaxes, so this was a regression.

## Fix

Removed `require_equals = true` from the argument configuration to restore
backward compatibility. This allows all syntaxes to work:

**New ergonomic syntax:**
- `--test-runner-fallback` (no value)
- `--no-test-runner-fallback`

**Backward compatible syntax:**
- `--test-runner-fallback true` (with space) ✅ now fixed
- `--test-runner-fallback=true` (with equals)
- `--test-runner-fallback false`
- `--test-runner-fallback=false`

## Testing

- Added new test `test_runner_fallback_space_true` to cover the space syntax
- All 7 test_runner_fallback tests pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@max-sixty max-sixty merged commit 90f6ad8 into mitsuhiko:master Nov 2, 2025
15 checks passed
@max-sixty max-sixty deleted the true branch November 2, 2025 22:07
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.

1 participant