diff --git a/corpus/python/bin-op-in/7a7f579a69a7.mutation.json b/corpus/python/bin-op-in/7a7f579a69a7.mutation.json new file mode 100644 index 00000000..681bae20 --- /dev/null +++ b/corpus/python/bin-op-in/7a7f579a69a7.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "BinaryOp": "In" + }, + "subst_span": { + "start": { + "line": 1, + "col": 6, + "byte": 20 + }, + "end": { + "line": 1, + "col": 8, + "byte": 22 + } + }, + "effect_span": { + "start": { + "line": 1, + "col": 4, + "byte": 18 + }, + "end": { + "line": 1, + "col": 10, + "byte": 24 + } + } + }, + "subst": "not in" +} \ No newline at end of file diff --git a/corpus/python/bin-op-in/7a7f579a69a7.py b/corpus/python/bin-op-in/7a7f579a69a7.py new file mode 100644 index 00000000..7d041e9e --- /dev/null +++ b/corpus/python/bin-op-in/7a7f579a69a7.py @@ -0,0 +1,2 @@ +a = [1, 2, 3] +x = 1 not in a diff --git a/crates/bough-core/src/language/javascript.rs b/crates/bough-core/src/language/javascript.rs index 13a97771..6ff5aedf 100644 --- a/crates/bough-core/src/language/javascript.rs +++ b/crates/bough-core/src/language/javascript.rs @@ -200,6 +200,7 @@ impl LanguageDriver for JavascriptDriver { MutantKind::BinaryOp(BinaryOpMutationKind::In) => vec![], MutantKind::BinaryOp(BinaryOpMutationKind::Is) => vec![], MutantKind::BinaryOp(BinaryOpMutationKind::IsNot) => vec![], + MutantKind::BinaryOp(BinaryOpMutationKind::NotIn) => vec![], MutantKind::BinaryOp(BinaryOpMutationKind::Eq) => vec!["!=".into()], MutantKind::BinaryOp(BinaryOpMutationKind::StrictEq) => vec!["!==".into()], MutantKind::BinaryOp(BinaryOpMutationKind::Ne) => vec!["==".into()], diff --git a/crates/bough-core/src/language/python.rs b/crates/bough-core/src/language/python.rs index 9ea101c9..612ddf68 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -47,6 +47,7 @@ impl LanguageDriver for PythonDriver { "<=" => BinaryOpMutationKind::Lte, "is" => BinaryOpMutationKind::Is, "is not" => BinaryOpMutationKind::IsNot, + "in" => BinaryOpMutationKind::In, _ => return None, }; Some((MutantKind::BinaryOp(kind), span_from_node(&op_node), span_from_node(node))) @@ -93,6 +94,7 @@ impl LanguageDriver for PythonDriver { MutantKind::BinaryOp(BinaryOpMutationKind::FloorDiv) => vec!["/".into(), "*".into()], MutantKind::BinaryOp(BinaryOpMutationKind::Is) => vec!["is not".into()], MutantKind::BinaryOp(BinaryOpMutationKind::IsNot) => vec!["is".into()], + MutantKind::BinaryOp(BinaryOpMutationKind::In) => vec!["not in".into()], _ => vec![], } } diff --git a/crates/bough-core/src/language/typescript.rs b/crates/bough-core/src/language/typescript.rs index 4cef2f33..ef16b55a 100644 --- a/crates/bough-core/src/language/typescript.rs +++ b/crates/bough-core/src/language/typescript.rs @@ -192,6 +192,7 @@ impl LanguageDriver for TypescriptDriver { MutantKind::BinaryOp(BinaryOpMutationKind::In) => vec![], MutantKind::BinaryOp(BinaryOpMutationKind::Is) => vec![], MutantKind::BinaryOp(BinaryOpMutationKind::IsNot) => vec![], + MutantKind::BinaryOp(BinaryOpMutationKind::NotIn) => vec![], MutantKind::BinaryOp(BinaryOpMutationKind::Eq) => vec!["!=".into()], MutantKind::BinaryOp(BinaryOpMutationKind::StrictEq) => vec!["!==".into()], MutantKind::BinaryOp(BinaryOpMutationKind::Ne) => vec!["==".into()], diff --git a/crates/bough-core/src/mutant.rs b/crates/bough-core/src/mutant.rs index 33a2b258..4699a5c1 100644 --- a/crates/bough-core/src/mutant.rs +++ b/crates/bough-core/src/mutant.rs @@ -322,6 +322,7 @@ pub enum BinaryOpMutationKind { In, Is, IsNot, + NotIn, Gte, Lt, Lte,