From 5d0d50ac6292e8459f8e18ac4e1c3e27191db8cf Mon Sep 17 00:00:00 2001 From: Freddie Ridell Date: Thu, 19 Mar 2026 09:22:55 +0000 Subject: [PATCH] py: bin-op-shl --- .../bin-op-shl/ea09dc3cd1bd.mutation.json | 36 +++++++++++++++++++ corpus/python/bin-op-shl/ea09dc3cd1bd.py | 1 + crates/bough-core/src/language/python.rs | 2 ++ 3 files changed, 39 insertions(+) create mode 100644 corpus/python/bin-op-shl/ea09dc3cd1bd.mutation.json create mode 100644 corpus/python/bin-op-shl/ea09dc3cd1bd.py diff --git a/corpus/python/bin-op-shl/ea09dc3cd1bd.mutation.json b/corpus/python/bin-op-shl/ea09dc3cd1bd.mutation.json new file mode 100644 index 00000000..38c23c2e --- /dev/null +++ b/corpus/python/bin-op-shl/ea09dc3cd1bd.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "BinaryOp": "Shl" + }, + "subst_span": { + "start": { + "line": 0, + "col": 6, + "byte": 6 + }, + "end": { + "line": 0, + "col": 8, + "byte": 8 + } + }, + "effect_span": { + "start": { + "line": 0, + "col": 4, + "byte": 4 + }, + "end": { + "line": 0, + "col": 10, + "byte": 10 + } + } + }, + "subst": ">>" +} \ No newline at end of file diff --git a/corpus/python/bin-op-shl/ea09dc3cd1bd.py b/corpus/python/bin-op-shl/ea09dc3cd1bd.py new file mode 100644 index 00000000..b7bb0d79 --- /dev/null +++ b/corpus/python/bin-op-shl/ea09dc3cd1bd.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 d198542c..2f5dca0e 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -27,6 +27,7 @@ impl LanguageDriver for PythonDriver { "&" => BinaryOpMutationKind::BitAnd, "|" => BinaryOpMutationKind::BitOr, "^" => BinaryOpMutationKind::BitXor, + "<<" => BinaryOpMutationKind::Shl, _ => return None, }; Some((MutantKind::BinaryOp(kind), span_from_node(&op_node), span_from_node(node))) @@ -49,6 +50,7 @@ impl LanguageDriver for PythonDriver { MutantKind::BinaryOp(BinaryOpMutationKind::BitAnd) => vec!["|".into(), "^".into()], MutantKind::BinaryOp(BinaryOpMutationKind::BitOr) => vec!["&".into(), "^".into()], MutantKind::BinaryOp(BinaryOpMutationKind::BitXor) => vec!["&".into(), "|".into()], + MutantKind::BinaryOp(BinaryOpMutationKind::Shl) => vec![">>".into()], _ => vec![], } } -- knotmirror 0.0.1