diff --git a/corpus/python/mul-assign/536dc96876a9.mutation.json b/corpus/python/mul-assign/536dc96876a9.mutation.json new file mode 100644 index 00000000..8002a508 --- /dev/null +++ b/corpus/python/mul-assign/536dc96876a9.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/mul-assign/536dc96876a9.py b/corpus/python/mul-assign/536dc96876a9.py new file mode 100644 index 00000000..5d90f9e7 --- /dev/null +++ b/corpus/python/mul-assign/536dc96876a9.py @@ -0,0 +1,2 @@ +x -= 1 +x *= 1 diff --git a/corpus/python/mul-assign/650dfd5a1827.mutation.json b/corpus/python/mul-assign/650dfd5a1827.mutation.json new file mode 100644 index 00000000..aef46c94 --- /dev/null +++ b/corpus/python/mul-assign/650dfd5a1827.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/mul-assign/650dfd5a1827.py b/corpus/python/mul-assign/650dfd5a1827.py new file mode 100644 index 00000000..4fc85e8e --- /dev/null +++ b/corpus/python/mul-assign/650dfd5a1827.py @@ -0,0 +1,2 @@ +x += 1 +x *= 1 diff --git a/corpus/python/mul-assign/7df342030a6b.mutation.json b/corpus/python/mul-assign/7df342030a6b.mutation.json new file mode 100644 index 00000000..398a8480 --- /dev/null +++ b/corpus/python/mul-assign/7df342030a6b.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "Assign": "MulAssign" + }, + "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/mul-assign/7df342030a6b.py b/corpus/python/mul-assign/7df342030a6b.py new file mode 100644 index 00000000..ff0f7786 --- /dev/null +++ b/corpus/python/mul-assign/7df342030a6b.py @@ -0,0 +1,2 @@ +x = 1 +x /= 1 diff --git a/corpus/python/mul-assign/c8b4974bf59c.mutation.json b/corpus/python/mul-assign/c8b4974bf59c.mutation.json new file mode 100644 index 00000000..6034cd23 --- /dev/null +++ b/corpus/python/mul-assign/c8b4974bf59c.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "Assign": "MulAssign" + }, + "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/mul-assign/c8b4974bf59c.py b/corpus/python/mul-assign/c8b4974bf59c.py new file mode 100644 index 00000000..271991ef --- /dev/null +++ b/corpus/python/mul-assign/c8b4974bf59c.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 1c70552b..3e1694c8 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -59,6 +59,7 @@ impl LanguageDriver for PythonDriver { let kind = match op_text { "+=" => AssignMutationKind::AddAssign, "-=" => AssignMutationKind::SubAssign, + "*=" => AssignMutationKind::MulAssign, _ => return None, }; Some((MutantKind::Assign(kind), span_from_node(&op_node), span_from_node(node))) @@ -120,6 +121,7 @@ impl LanguageDriver for PythonDriver { MutantKind::Assign(AssignMutationKind::NormalAssign) => vec!["+=".into(), "-=".into()], MutantKind::Assign(AssignMutationKind::AddAssign) => vec!["-=".into(), "=".into()], MutantKind::Assign(AssignMutationKind::SubAssign) => vec!["+=".into(), "=".into()], + MutantKind::Assign(AssignMutationKind::MulAssign) => vec!["/=".into(), "=".into()], _ => vec![], } }