Fix name filters for struct-field deletion mutants - #634
Conversation
|
Hi @sourcefrog — gentle ping when you have a chance. This PR is still waiting for approval to run Actions, so CI hasn’t started yet. The change is intentionally small and includes regression coverage and a NEWS entry. Happy to adjust the approach if you’d prefer a different fix. |
|
Thanks for the PRs! I've had limited bandwidth, and had to fix some other things here first, but I will look. |
There was a problem hiding this comment.
Pull request overview
Fixes mutant-name filtering for struct-field deletion mutants so they respect the same --re / --exclude-re (and config equivalents) filtering path as other mutant genres, addressing #632.
Changes:
- Apply
Options::allows_mutantfiltering to struct-field deletion mutants during discovery. - Add regression tests covering
--re,--exclude-re, and a nonmatching--exclude-recontrol for struct-field deletion mutants. - Document the user-visible fix in
NEWS.md.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.
| File | Description |
|---|---|
| src/visit.rs | Applies name-filtering to struct-field deletion mutants and adds regression tests for --re / --exclude-re. |
| NEWS.md | Notes the fix in the changelog for users. |
Suppressed comments (1)
src/visit.rs:2048
- Test name doesn’t include the exercised flag name (
--exclude-re/exclude_re) and doesn’t read like an English assertion per the repository test-naming guideline. Consider renaming to make the exercised option literal in the name.
fn struct_field_mutants_survive_nonmatching_exclude_name_filter() {
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| if v.excluded_by_attr_re(&mutant.name) { | ||
| trace!( | ||
| name = mutant.name(false), | ||
| "skip mutant by exclude_re attribute" | ||
| ); | ||
| } else if v.options.allows_mutant(&mutant) { | ||
| v.mutants.push(mutant); | ||
| } else { | ||
| trace!(name = mutant.name(false), "skip mutant by options"); |
| } | ||
|
|
||
| #[test] | ||
| fn struct_field_mutants_respect_examine_name_filter() { |
| } | ||
|
|
||
| #[test] | ||
| fn struct_field_mutants_respect_exclude_name_filter() { |
Fixes #632.
Apply the existing mutant-name filters to struct-field deletions and add
regression coverage for
--re,--exclude-re, and a nonmatching control.NEWS is updated for the user-visible fix.