Skip to content

Commit

Permalink
Add additional mutatation to > (resp. <)
Browse files Browse the repository at this point in the history
  • Loading branch information
nfrankel committed Feb 17, 2025
1 parent 7e3fa09 commit be96ac3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
8 changes: 8 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/mutant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ mod test {
"replace controlled_loop with ()",
"replace > with == in controlled_loop",
"replace > with < in controlled_loop",
"replace > with => in controlled_loop",
"replace * with + in controlled_loop",
"replace * with / in controlled_loop",
]
Expand Down
4 changes: 2 additions & 2 deletions src/visit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -540,8 +540,8 @@ impl<'ast> Visit<'ast> for DiscoveryVisitor<'_> {
BinOp::Ne(_) => vec![quote! { == }],
BinOp::And(_) => vec![quote! { || }],
BinOp::Or(_) => vec![quote! { && }],
BinOp::Lt(_) => vec![quote! { == }, quote! {>}],
BinOp::Gt(_) => vec![quote! { == }, quote! {<}],
BinOp::Lt(_) => vec![quote! { == }, quote! {>}, quote! { <= }],
BinOp::Gt(_) => vec![quote! { == }, quote! {<}, quote! { => }],
BinOp::Le(_) => vec![quote! {>}],
BinOp::Ge(_) => vec![quote! {<}],
BinOp::Add(_) => vec![quote! {-}, quote! {*}],
Expand Down
4 changes: 2 additions & 2 deletions tests/snapshots/main__check_tree_with_mutants_skip.snap
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
source: tests/main.rs
expression: stdout
---
Found 5 mutants to test
Found 6 mutants to test
ok Unmutated baseline
ok src/lib.rs:15:5: replace controlled_loop with ()
ok src/lib.rs:21:28: replace > with == in controlled_loop
ok src/lib.rs:21:28: replace > with < in controlled_loop
ok src/lib.rs:21:53: replace * with + in controlled_loop
ok src/lib.rs:21:53: replace * with / in controlled_loop
5 mutants tested: 5 succeeded
6 mutants tested: 1 unviable, 5 succeeded

0 comments on commit be96ac3

Please sign in to comment.