Skip to content

Fix name filters for struct-field deletion mutants - #634

Open
P4suta wants to merge 3 commits into
sourcefrog:mainfrom
P4suta:struct-field-name-filters
Open

Fix name filters for struct-field deletion mutants#634
P4suta wants to merge 3 commits into
sourcefrog:mainfrom
P4suta:struct-field-name-filters

Conversation

@P4suta

@P4suta P4suta commented Aug 9, 2026

Copy link
Copy Markdown

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.

@P4suta
P4suta marked this pull request as ready for review August 9, 2026 12:46
@P4suta

P4suta commented Aug 15, 2026

Copy link
Copy Markdown
Author

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.

@sourcefrog

Copy link
Copy Markdown
Owner

Thanks for the PRs! I've had limited bandwidth, and had to fix some other things here first, but I will look.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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_mutant filtering to struct-field deletion mutants during discovery.
  • Add regression tests covering --re, --exclude-re, and a nonmatching --exclude-re control 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.

Comment thread src/visit.rs Outdated
Comment on lines +967 to +975
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");
Comment thread src/visit.rs Outdated
}

#[test]
fn struct_field_mutants_respect_examine_name_filter() {
Comment thread src/visit.rs Outdated
}

#[test]
fn struct_field_mutants_respect_exclude_name_filter() {
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.

Struct-field deletion mutants ignore --re and --exclude-re

3 participants