From a5558c265f2d33691d581a3531bfe4ff0ebc7319 Mon Sep 17 00:00:00 2001 From: Freddie Ridell Date: Thu, 19 Mar 2026 09:21:43 +0000 Subject: [PATCH] py: bin-op-bit-and --- .../bin-op-bit-and/5fc8b8c6413e.mutation.json | 36 +++++++++++++++++++ corpus/python/bin-op-bit-and/5fc8b8c6413e.py | 1 + .../bin-op-bit-and/afa22163f585.mutation.json | 36 +++++++++++++++++++ corpus/python/bin-op-bit-and/afa22163f585.py | 1 + crates/bough-core/src/language/python.rs | 2 ++ 5 files changed, 76 insertions(+) create mode 100644 corpus/python/bin-op-bit-and/5fc8b8c6413e.mutation.json create mode 100644 corpus/python/bin-op-bit-and/5fc8b8c6413e.py create mode 100644 corpus/python/bin-op-bit-and/afa22163f585.mutation.json create mode 100644 corpus/python/bin-op-bit-and/afa22163f585.py diff --git a/corpus/python/bin-op-bit-and/5fc8b8c6413e.mutation.json b/corpus/python/bin-op-bit-and/5fc8b8c6413e.mutation.json new file mode 100644 index 00000000..fdbd4421 --- /dev/null +++ b/corpus/python/bin-op-bit-and/5fc8b8c6413e.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "BinaryOp": "BitAnd" + }, + "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-bit-and/5fc8b8c6413e.py b/corpus/python/bin-op-bit-and/5fc8b8c6413e.py new file mode 100644 index 00000000..b8b87066 --- /dev/null +++ b/corpus/python/bin-op-bit-and/5fc8b8c6413e.py @@ -0,0 +1 @@ +x = 1 | 2 diff --git a/corpus/python/bin-op-bit-and/afa22163f585.mutation.json b/corpus/python/bin-op-bit-and/afa22163f585.mutation.json new file mode 100644 index 00000000..37c236dc --- /dev/null +++ b/corpus/python/bin-op-bit-and/afa22163f585.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "BinaryOp": "BitAnd" + }, + "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-bit-and/afa22163f585.py b/corpus/python/bin-op-bit-and/afa22163f585.py new file mode 100644 index 00000000..91b5b4c0 --- /dev/null +++ b/corpus/python/bin-op-bit-and/afa22163f585.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 3d9df389..275bb4c9 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -24,6 +24,7 @@ impl LanguageDriver for PythonDriver { "*" => BinaryOpMutationKind::Mul, "/" => BinaryOpMutationKind::Div, "%" => BinaryOpMutationKind::Rem, + "&" => BinaryOpMutationKind::BitAnd, _ => return None, }; Some((MutantKind::BinaryOp(kind), span_from_node(&op_node), span_from_node(node))) @@ -43,6 +44,7 @@ impl LanguageDriver for PythonDriver { MutantKind::BinaryOp(BinaryOpMutationKind::Mul) => vec!["/".into(), "+".into()], MutantKind::BinaryOp(BinaryOpMutationKind::Div) => vec!["*".into(), "-".into()], MutantKind::BinaryOp(BinaryOpMutationKind::Rem) => vec!["*".into(), "/".into()], + MutantKind::BinaryOp(BinaryOpMutationKind::BitAnd) => vec!["|".into(), "^".into()], _ => vec![], } } -- knotmirror 0.0.1