From 604678c1a7a67cc75cb64840c4de38c206dda244 Mon Sep 17 00:00:00 2001 From: Freddie Ridell Date: Thu, 19 Mar 2026 09:38:07 +0000 Subject: [PATCH] py: bit-xor-assign --- .../bit-xor-assign/4e74adb4ff73.mutation.json | 36 +++++++++++++++++++ corpus/python/bit-xor-assign/4e74adb4ff73.py | 2 ++ .../bit-xor-assign/c8b4974bf59c.mutation.json | 36 +++++++++++++++++++ corpus/python/bit-xor-assign/c8b4974bf59c.py | 2 ++ .../bit-xor-assign/cc179780b0ee.mutation.json | 36 +++++++++++++++++++ corpus/python/bit-xor-assign/cc179780b0ee.py | 2 ++ .../bit-xor-assign/fe4bf15b763c.mutation.json | 36 +++++++++++++++++++ corpus/python/bit-xor-assign/fe4bf15b763c.py | 2 ++ crates/bough-core/src/language/python.rs | 2 ++ 9 files changed, 154 insertions(+) create mode 100644 corpus/python/bit-xor-assign/4e74adb4ff73.mutation.json create mode 100644 corpus/python/bit-xor-assign/4e74adb4ff73.py create mode 100644 corpus/python/bit-xor-assign/c8b4974bf59c.mutation.json create mode 100644 corpus/python/bit-xor-assign/c8b4974bf59c.py create mode 100644 corpus/python/bit-xor-assign/cc179780b0ee.mutation.json create mode 100644 corpus/python/bit-xor-assign/cc179780b0ee.py create mode 100644 corpus/python/bit-xor-assign/fe4bf15b763c.mutation.json create mode 100644 corpus/python/bit-xor-assign/fe4bf15b763c.py diff --git a/corpus/python/bit-xor-assign/4e74adb4ff73.mutation.json b/corpus/python/bit-xor-assign/4e74adb4ff73.mutation.json new file mode 100644 index 00000000..aef46c94 --- /dev/null +++ b/corpus/python/bit-xor-assign/4e74adb4ff73.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-xor-assign/4e74adb4ff73.py b/corpus/python/bit-xor-assign/4e74adb4ff73.py new file mode 100644 index 00000000..3163aa83 --- /dev/null +++ b/corpus/python/bit-xor-assign/4e74adb4ff73.py @@ -0,0 +1,2 @@ +x += 1 +x ^= 1 diff --git a/corpus/python/bit-xor-assign/c8b4974bf59c.mutation.json b/corpus/python/bit-xor-assign/c8b4974bf59c.mutation.json new file mode 100644 index 00000000..4236457f --- /dev/null +++ b/corpus/python/bit-xor-assign/c8b4974bf59c.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "Assign": "BitXorAssign" + }, + "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-xor-assign/c8b4974bf59c.py b/corpus/python/bit-xor-assign/c8b4974bf59c.py new file mode 100644 index 00000000..271991ef --- /dev/null +++ b/corpus/python/bit-xor-assign/c8b4974bf59c.py @@ -0,0 +1,2 @@ +x = 1 +x = 1 diff --git a/corpus/python/bit-xor-assign/cc179780b0ee.mutation.json b/corpus/python/bit-xor-assign/cc179780b0ee.mutation.json new file mode 100644 index 00000000..511a2ea0 --- /dev/null +++ b/corpus/python/bit-xor-assign/cc179780b0ee.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "Assign": "BitXorAssign" + }, + "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-xor-assign/cc179780b0ee.py b/corpus/python/bit-xor-assign/cc179780b0ee.py new file mode 100644 index 00000000..e49212c2 --- /dev/null +++ b/corpus/python/bit-xor-assign/cc179780b0ee.py @@ -0,0 +1,2 @@ +x = 1 +x &= 1 diff --git a/corpus/python/bit-xor-assign/fe4bf15b763c.mutation.json b/corpus/python/bit-xor-assign/fe4bf15b763c.mutation.json new file mode 100644 index 00000000..8002a508 --- /dev/null +++ b/corpus/python/bit-xor-assign/fe4bf15b763c.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-xor-assign/fe4bf15b763c.py b/corpus/python/bit-xor-assign/fe4bf15b763c.py new file mode 100644 index 00000000..39d7ffa9 --- /dev/null +++ b/corpus/python/bit-xor-assign/fe4bf15b763c.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 f1936342..3b91d60d 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -64,6 +64,7 @@ impl LanguageDriver for PythonDriver { "%=" => AssignMutationKind::RemAssign, "&=" => AssignMutationKind::BitAndAssign, "|=" => AssignMutationKind::BitOrAssign, + "^=" => AssignMutationKind::BitXorAssign, _ => return None, }; Some((MutantKind::Assign(kind), span_from_node(&op_node), span_from_node(node))) @@ -130,6 +131,7 @@ impl LanguageDriver for PythonDriver { MutantKind::Assign(AssignMutationKind::RemAssign) => vec!["*=".into(), "=".into()], MutantKind::Assign(AssignMutationKind::BitAndAssign) => vec!["|=".into(), "=".into()], MutantKind::Assign(AssignMutationKind::BitOrAssign) => vec!["&=".into(), "=".into()], + MutantKind::Assign(AssignMutationKind::BitXorAssign) => vec!["&=".into(), "=".into()], _ => vec![], } } -- knotmirror 0.0.1