From 7401e6ff0b775ceae016073de170dd49dfdda711 Mon Sep 17 00:00:00 2001 From: Freddie Ridell Date: Thu, 19 Mar 2026 09:20:29 +0000 Subject: [PATCH] py: bin-op-mul --- .../bin-op-mul/2b5abe2e6cb7.mutation.json | 36 +++++++++++++++++++ corpus/python/bin-op-mul/2b5abe2e6cb7.py | 1 + .../bin-op-mul/2e7237a77b43.mutation.json | 36 +++++++++++++++++++ corpus/python/bin-op-mul/2e7237a77b43.py | 1 + crates/bough-core/src/language/python.rs | 2 ++ 5 files changed, 76 insertions(+) create mode 100644 corpus/python/bin-op-mul/2b5abe2e6cb7.mutation.json create mode 100644 corpus/python/bin-op-mul/2b5abe2e6cb7.py create mode 100644 corpus/python/bin-op-mul/2e7237a77b43.mutation.json create mode 100644 corpus/python/bin-op-mul/2e7237a77b43.py diff --git a/corpus/python/bin-op-mul/2b5abe2e6cb7.mutation.json b/corpus/python/bin-op-mul/2b5abe2e6cb7.mutation.json new file mode 100644 index 00000000..98675fa3 --- /dev/null +++ b/corpus/python/bin-op-mul/2b5abe2e6cb7.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "BinaryOp": "Mul" + }, + "subst_span": { + "start": { + "line": 0, + "col": 6, + "byte": 6 + }, + "end": { + "line": 0, + "col": 7, + "byte": 7 + } + }, + "effect_span": { + "start": { + "line": 0, + "col": 4, + "byte": 4 + }, + "end": { + "line": 0, + "col": 9, + "byte": 9 + } + } + }, + "subst": "+" +} \ No newline at end of file diff --git a/corpus/python/bin-op-mul/2b5abe2e6cb7.py b/corpus/python/bin-op-mul/2b5abe2e6cb7.py new file mode 100644 index 00000000..2a617067 --- /dev/null +++ b/corpus/python/bin-op-mul/2b5abe2e6cb7.py @@ -0,0 +1 @@ +x = 1 + 2 diff --git a/corpus/python/bin-op-mul/2e7237a77b43.mutation.json b/corpus/python/bin-op-mul/2e7237a77b43.mutation.json new file mode 100644 index 00000000..44a0f4ea --- /dev/null +++ b/corpus/python/bin-op-mul/2e7237a77b43.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "BinaryOp": "Mul" + }, + "subst_span": { + "start": { + "line": 0, + "col": 6, + "byte": 6 + }, + "end": { + "line": 0, + "col": 7, + "byte": 7 + } + }, + "effect_span": { + "start": { + "line": 0, + "col": 4, + "byte": 4 + }, + "end": { + "line": 0, + "col": 9, + "byte": 9 + } + } + }, + "subst": "/" +} \ No newline at end of file diff --git a/corpus/python/bin-op-mul/2e7237a77b43.py b/corpus/python/bin-op-mul/2e7237a77b43.py new file mode 100644 index 00000000..abfa8e02 --- /dev/null +++ b/corpus/python/bin-op-mul/2e7237a77b43.py @@ -0,0 +1 @@ +x = 1 / 2 diff --git a/crates/bough-core/src/language/python.rs b/crates/bough-core/src/language/python.rs index 6731262d..981c97a1 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -21,6 +21,7 @@ impl LanguageDriver for PythonDriver { let kind = match op_text { "+" => BinaryOpMutationKind::Add, "-" => BinaryOpMutationKind::Sub, + "*" => BinaryOpMutationKind::Mul, _ => return None, }; Some((MutantKind::BinaryOp(kind), span_from_node(&op_node), span_from_node(node))) @@ -37,6 +38,7 @@ impl LanguageDriver for PythonDriver { match kind { MutantKind::BinaryOp(BinaryOpMutationKind::Add) => vec!["-".into(), "*".into()], MutantKind::BinaryOp(BinaryOpMutationKind::Sub) => vec!["+".into(), "/".into()], + MutantKind::BinaryOp(BinaryOpMutationKind::Mul) => vec!["/".into(), "+".into()], _ => vec![], } } -- knotmirror 0.0.1