Skip to content

Commit

Permalink
test: skipping methods by name
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcefrog committed Nov 18, 2024
1 parent 609d3aa commit c2903b0
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1013,4 +1013,27 @@ mod test {
// The main fn plus two mutations of the `*` expression.
assert_eq!(mutants.len(), 3);
}

#[test]
fn skip_method_calls_by_name() {
let options = Options::from_arg_strs(["mutants", "--skip-calls", "dont_touch_this"]);
let mutants = mutate_source_str(
indoc! {"
fn main() {
let mut v = V::new();
v.dont_touch_this(2 + 3);
}
"},
&options,
)
.unwrap();
dbg!(&mutants);
assert_eq!(
mutants
.iter()
.filter(|mutant| mutant.genre != Genre::FnValue)
.count(),
0
);
}
}

0 comments on commit c2903b0

Please sign in to comment.