From 9fcaad0bdd625f480ba56775d1a2e62290f846fc Mon Sep 17 00:00:00 2001 From: Freddie Ridell Date: Thu, 19 Mar 2026 09:23:20 +0000 Subject: [PATCH] py: bin-op-shr --- .../bin-op-shr/ebd1fd8a07f1.mutation.json | 36 +++++++++++++++++++ corpus/python/bin-op-shr/ebd1fd8a07f1.py | 1 + crates/bough-core/src/language/python.rs | 2 ++ 3 files changed, 39 insertions(+) create mode 100644 corpus/python/bin-op-shr/ebd1fd8a07f1.mutation.json create mode 100644 corpus/python/bin-op-shr/ebd1fd8a07f1.py diff --git a/corpus/python/bin-op-shr/ebd1fd8a07f1.mutation.json b/corpus/python/bin-op-shr/ebd1fd8a07f1.mutation.json new file mode 100644 index 00000000..48d1a55d --- /dev/null +++ b/corpus/python/bin-op-shr/ebd1fd8a07f1.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "BinaryOp": "Shr" + }, + "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-shr/ebd1fd8a07f1.py b/corpus/python/bin-op-shr/ebd1fd8a07f1.py new file mode 100644 index 00000000..aa9b11bc --- /dev/null +++ b/corpus/python/bin-op-shr/ebd1fd8a07f1.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 2f5dca0e..08fcbeb8 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -28,6 +28,7 @@ impl LanguageDriver for PythonDriver { "|" => BinaryOpMutationKind::BitOr, "^" => BinaryOpMutationKind::BitXor, "<<" => BinaryOpMutationKind::Shl, + ">>" => BinaryOpMutationKind::Shr, _ => return None, }; Some((MutantKind::BinaryOp(kind), span_from_node(&op_node), span_from_node(node))) @@ -51,6 +52,7 @@ impl LanguageDriver for PythonDriver { MutantKind::BinaryOp(BinaryOpMutationKind::BitOr) => vec!["&".into(), "^".into()], MutantKind::BinaryOp(BinaryOpMutationKind::BitXor) => vec!["&".into(), "|".into()], MutantKind::BinaryOp(BinaryOpMutationKind::Shl) => vec![">>".into()], + MutantKind::BinaryOp(BinaryOpMutationKind::Shr) => vec!["<<".into()], _ => vec![], } } -- knotmirror 0.0.1