From 1c525efba5b99ad7fff168ac68bbe9b18a4dfee2 Mon Sep 17 00:00:00 2001 From: Freddie Ridell Date: Thu, 19 Mar 2026 09:37:36 +0000 Subject: [PATCH] py: bit-or-assign --- .../bit-or-assign/066ffcb4216f.mutation.json | 36 +++++++++++++++++++ corpus/python/bit-or-assign/066ffcb4216f.py | 2 ++ .../bit-or-assign/33095489c208.mutation.json | 36 +++++++++++++++++++ corpus/python/bit-or-assign/33095489c208.py | 2 ++ .../bit-or-assign/c8b4974bf59c.mutation.json | 36 +++++++++++++++++++ corpus/python/bit-or-assign/c8b4974bf59c.py | 2 ++ .../bit-or-assign/cc179780b0ee.mutation.json | 36 +++++++++++++++++++ corpus/python/bit-or-assign/cc179780b0ee.py | 2 ++ crates/bough-core/src/language/python.rs | 2 ++ 9 files changed, 154 insertions(+) create mode 100644 corpus/python/bit-or-assign/066ffcb4216f.mutation.json create mode 100644 corpus/python/bit-or-assign/066ffcb4216f.py create mode 100644 corpus/python/bit-or-assign/33095489c208.mutation.json create mode 100644 corpus/python/bit-or-assign/33095489c208.py create mode 100644 corpus/python/bit-or-assign/c8b4974bf59c.mutation.json create mode 100644 corpus/python/bit-or-assign/c8b4974bf59c.py create mode 100644 corpus/python/bit-or-assign/cc179780b0ee.mutation.json create mode 100644 corpus/python/bit-or-assign/cc179780b0ee.py diff --git a/corpus/python/bit-or-assign/066ffcb4216f.mutation.json b/corpus/python/bit-or-assign/066ffcb4216f.mutation.json new file mode 100644 index 00000000..aef46c94 --- /dev/null +++ b/corpus/python/bit-or-assign/066ffcb4216f.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "Assign": "NormalAssign" + }, + "subst_span": { + "start": { + "line": 0, + "col": 2, + "byte": 2 + }, + "end": { + "line": 0, + "col": 3, + "byte": 3 + } + }, + "effect_span": { + "start": { + "line": 0, + "col": 0, + "byte": 0 + }, + "end": { + "line": 0, + "col": 5, + "byte": 5 + } + } + }, + "subst": "+=" +} \ No newline at end of file diff --git a/corpus/python/bit-or-assign/066ffcb4216f.py b/corpus/python/bit-or-assign/066ffcb4216f.py new file mode 100644 index 00000000..f302a5da --- /dev/null +++ b/corpus/python/bit-or-assign/066ffcb4216f.py @@ -0,0 +1,2 @@ +x += 1 +x |= 1 diff --git a/corpus/python/bit-or-assign/33095489c208.mutation.json b/corpus/python/bit-or-assign/33095489c208.mutation.json new file mode 100644 index 00000000..8002a508 --- /dev/null +++ b/corpus/python/bit-or-assign/33095489c208.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "Assign": "NormalAssign" + }, + "subst_span": { + "start": { + "line": 0, + "col": 2, + "byte": 2 + }, + "end": { + "line": 0, + "col": 3, + "byte": 3 + } + }, + "effect_span": { + "start": { + "line": 0, + "col": 0, + "byte": 0 + }, + "end": { + "line": 0, + "col": 5, + "byte": 5 + } + } + }, + "subst": "-=" +} \ No newline at end of file diff --git a/corpus/python/bit-or-assign/33095489c208.py b/corpus/python/bit-or-assign/33095489c208.py new file mode 100644 index 00000000..b48c50c5 --- /dev/null +++ b/corpus/python/bit-or-assign/33095489c208.py @@ -0,0 +1,2 @@ +x -= 1 +x |= 1 diff --git a/corpus/python/bit-or-assign/c8b4974bf59c.mutation.json b/corpus/python/bit-or-assign/c8b4974bf59c.mutation.json new file mode 100644 index 00000000..54006498 --- /dev/null +++ b/corpus/python/bit-or-assign/c8b4974bf59c.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "Assign": "BitOrAssign" + }, + "subst_span": { + "start": { + "line": 1, + "col": 2, + "byte": 8 + }, + "end": { + "line": 1, + "col": 4, + "byte": 10 + } + }, + "effect_span": { + "start": { + "line": 1, + "col": 0, + "byte": 6 + }, + "end": { + "line": 1, + "col": 6, + "byte": 12 + } + } + }, + "subst": "=" +} \ No newline at end of file diff --git a/corpus/python/bit-or-assign/c8b4974bf59c.py b/corpus/python/bit-or-assign/c8b4974bf59c.py new file mode 100644 index 00000000..271991ef --- /dev/null +++ b/corpus/python/bit-or-assign/c8b4974bf59c.py @@ -0,0 +1,2 @@ +x = 1 +x = 1 diff --git a/corpus/python/bit-or-assign/cc179780b0ee.mutation.json b/corpus/python/bit-or-assign/cc179780b0ee.mutation.json new file mode 100644 index 00000000..ab9c3398 --- /dev/null +++ b/corpus/python/bit-or-assign/cc179780b0ee.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "Assign": "BitOrAssign" + }, + "subst_span": { + "start": { + "line": 1, + "col": 2, + "byte": 8 + }, + "end": { + "line": 1, + "col": 4, + "byte": 10 + } + }, + "effect_span": { + "start": { + "line": 1, + "col": 0, + "byte": 6 + }, + "end": { + "line": 1, + "col": 6, + "byte": 12 + } + } + }, + "subst": "&=" +} \ No newline at end of file diff --git a/corpus/python/bit-or-assign/cc179780b0ee.py b/corpus/python/bit-or-assign/cc179780b0ee.py new file mode 100644 index 00000000..e49212c2 --- /dev/null +++ b/corpus/python/bit-or-assign/cc179780b0ee.py @@ -0,0 +1,2 @@ +x = 1 +x &= 1 diff --git a/crates/bough-core/src/language/python.rs b/crates/bough-core/src/language/python.rs index aff18107..f1936342 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -63,6 +63,7 @@ impl LanguageDriver for PythonDriver { "/=" => AssignMutationKind::DivAssign, "%=" => AssignMutationKind::RemAssign, "&=" => AssignMutationKind::BitAndAssign, + "|=" => AssignMutationKind::BitOrAssign, _ => return None, }; Some((MutantKind::Assign(kind), span_from_node(&op_node), span_from_node(node))) @@ -128,6 +129,7 @@ impl LanguageDriver for PythonDriver { MutantKind::Assign(AssignMutationKind::DivAssign) => vec!["*=".into(), "=".into()], MutantKind::Assign(AssignMutationKind::RemAssign) => vec!["*=".into(), "=".into()], MutantKind::Assign(AssignMutationKind::BitAndAssign) => vec!["|=".into(), "=".into()], + MutantKind::Assign(AssignMutationKind::BitOrAssign) => vec!["&=".into(), "=".into()], _ => vec![], } } -- knotmirror 0.0.1