From eb5caab2a029d8648082bf3d51d91e3101cce65e Mon Sep 17 00:00:00 2001 From: Freddie Ridell Date: Thu, 19 Mar 2026 09:30:50 +0000 Subject: [PATCH] py: bin-op-is-not --- .../bin-op-is-not/527be2f21228.mutation.json | 36 +++++++++++++++++++ corpus/python/bin-op-is-not/527be2f21228.py | 2 ++ crates/bough-core/src/language/python.rs | 2 ++ 3 files changed, 40 insertions(+) create mode 100644 corpus/python/bin-op-is-not/527be2f21228.mutation.json create mode 100644 corpus/python/bin-op-is-not/527be2f21228.py diff --git a/corpus/python/bin-op-is-not/527be2f21228.mutation.json b/corpus/python/bin-op-is-not/527be2f21228.mutation.json new file mode 100644 index 00000000..d1809cd7 --- /dev/null +++ b/corpus/python/bin-op-is-not/527be2f21228.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "BinaryOp": "IsNot" + }, + "subst_span": { + "start": { + "line": 1, + "col": 6, + "byte": 15 + }, + "end": { + "line": 1, + "col": 12, + "byte": 21 + } + }, + "effect_span": { + "start": { + "line": 1, + "col": 4, + "byte": 13 + }, + "end": { + "line": 1, + "col": 17, + "byte": 26 + } + } + }, + "subst": "is" +} \ No newline at end of file diff --git a/corpus/python/bin-op-is-not/527be2f21228.py b/corpus/python/bin-op-is-not/527be2f21228.py new file mode 100644 index 00000000..80c2835d --- /dev/null +++ b/corpus/python/bin-op-is-not/527be2f21228.py @@ -0,0 +1,2 @@ +a = None +x = a is None diff --git a/crates/bough-core/src/language/python.rs b/crates/bough-core/src/language/python.rs index 3886948a..9ea101c9 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -46,6 +46,7 @@ impl LanguageDriver for PythonDriver { "<" => BinaryOpMutationKind::Lt, "<=" => BinaryOpMutationKind::Lte, "is" => BinaryOpMutationKind::Is, + "is not" => BinaryOpMutationKind::IsNot, _ => return None, }; Some((MutantKind::BinaryOp(kind), span_from_node(&op_node), span_from_node(node))) @@ -91,6 +92,7 @@ impl LanguageDriver for PythonDriver { MutantKind::BinaryOp(BinaryOpMutationKind::Exp) => vec!["*".into(), "//".into()], MutantKind::BinaryOp(BinaryOpMutationKind::FloorDiv) => vec!["/".into(), "*".into()], MutantKind::BinaryOp(BinaryOpMutationKind::Is) => vec!["is not".into()], + MutantKind::BinaryOp(BinaryOpMutationKind::IsNot) => vec!["is".into()], _ => vec![], } } -- knotmirror 0.0.1