From 796cfb6911e6caed65f98eca7510f7a0f609b366 Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Mon, 1 Jan 2024 13:12:55 -0800 Subject: [PATCH] Drop other mutations of && and || --- NEWS.md | 2 +- src/visit.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index 8761c374..9198d2d4 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,7 +8,7 @@ - New: Mutate `+, -, *, /, %, &, ^, |, <<, >>` binary ops, and their corresponding assignment ops like `+=`. -- Changed: Stop generating mutations of `||` to `!=`, because it seems to raise too many low-value false positives, where the program does not need to care about the case where both operands are true. +- Changed: Stop generating mutations of `||` and `&&` to `!=` and `||`, because it seems to raise too many low-value false positives that may be hard to test. ## 23.12.1 diff --git a/src/visit.rs b/src/visit.rs index d827ac4f..19a4c4aa 100644 --- a/src/visit.rs +++ b/src/visit.rs @@ -362,8 +362,8 @@ impl<'ast> Visit<'ast> for DiscoveryVisitor<'_> { // because they require parenthesis for disambiguation in many expressions. BinOp::Eq(_) => vec![quote! { != }], BinOp::Ne(_) => vec![quote! { == }], - BinOp::And(_) => vec![quote! { || }, quote! {!=}], - BinOp::Or(_) => vec![quote! { && }, quote! {==}], + BinOp::And(_) => vec![quote! { || }], + BinOp::Or(_) => vec![quote! { && }], BinOp::Lt(_) => vec![quote! { == }, quote! {>}], BinOp::Gt(_) => vec![quote! { == }, quote! {<}], BinOp::Le(_) => vec![quote! {>}],