diff --git a/corpus/python/bit-and-assign/b1401e322dc6.mutation.json b/corpus/python/bit-and-assign/b1401e322dc6.mutation.json new file mode 100644 index 00000000..aef46c94 --- /dev/null +++ b/corpus/python/bit-and-assign/b1401e322dc6.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-and-assign/b1401e322dc6.py b/corpus/python/bit-and-assign/b1401e322dc6.py new file mode 100644 index 00000000..cb972121 --- /dev/null +++ b/corpus/python/bit-and-assign/b1401e322dc6.py @@ -0,0 +1,2 @@ +x += 1 +x &= 1 diff --git a/corpus/python/bit-and-assign/b52291bffd2a.mutation.json b/corpus/python/bit-and-assign/b52291bffd2a.mutation.json new file mode 100644 index 00000000..8002a508 --- /dev/null +++ b/corpus/python/bit-and-assign/b52291bffd2a.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-and-assign/b52291bffd2a.py b/corpus/python/bit-and-assign/b52291bffd2a.py new file mode 100644 index 00000000..ae0008fa --- /dev/null +++ b/corpus/python/bit-and-assign/b52291bffd2a.py @@ -0,0 +1,2 @@ +x -= 1 +x &= 1 diff --git a/corpus/python/bit-and-assign/c8b4974bf59c.mutation.json b/corpus/python/bit-and-assign/c8b4974bf59c.mutation.json new file mode 100644 index 00000000..9205755d --- /dev/null +++ b/corpus/python/bit-and-assign/c8b4974bf59c.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "Assign": "BitAndAssign" + }, + "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-and-assign/c8b4974bf59c.py b/corpus/python/bit-and-assign/c8b4974bf59c.py new file mode 100644 index 00000000..271991ef --- /dev/null +++ b/corpus/python/bit-and-assign/c8b4974bf59c.py @@ -0,0 +1,2 @@ +x = 1 +x = 1 diff --git a/corpus/python/bit-and-assign/f3a79fb0d292.mutation.json b/corpus/python/bit-and-assign/f3a79fb0d292.mutation.json new file mode 100644 index 00000000..1555e028 --- /dev/null +++ b/corpus/python/bit-and-assign/f3a79fb0d292.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "Assign": "BitAndAssign" + }, + "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-and-assign/f3a79fb0d292.py b/corpus/python/bit-and-assign/f3a79fb0d292.py new file mode 100644 index 00000000..5f9fe049 --- /dev/null +++ b/corpus/python/bit-and-assign/f3a79fb0d292.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 8cf1f7e6..aff18107 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -62,6 +62,7 @@ impl LanguageDriver for PythonDriver { "*=" => AssignMutationKind::MulAssign, "/=" => AssignMutationKind::DivAssign, "%=" => AssignMutationKind::RemAssign, + "&=" => AssignMutationKind::BitAndAssign, _ => return None, }; Some((MutantKind::Assign(kind), span_from_node(&op_node), span_from_node(node))) @@ -126,6 +127,7 @@ impl LanguageDriver for PythonDriver { MutantKind::Assign(AssignMutationKind::MulAssign) => vec!["/=".into(), "=".into()], MutantKind::Assign(AssignMutationKind::DivAssign) => vec!["*=".into(), "=".into()], MutantKind::Assign(AssignMutationKind::RemAssign) => vec!["*=".into(), "=".into()], + MutantKind::Assign(AssignMutationKind::BitAndAssign) => vec!["|=".into(), "=".into()], _ => vec![], } }