diff --git a/corpus/python/shr-assign/64102328b755.mutation.json b/corpus/python/shr-assign/64102328b755.mutation.json new file mode 100644 index 00000000..aef46c94 --- /dev/null +++ b/corpus/python/shr-assign/64102328b755.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/shr-assign/64102328b755.py b/corpus/python/shr-assign/64102328b755.py new file mode 100644 index 00000000..acd8b256 --- /dev/null +++ b/corpus/python/shr-assign/64102328b755.py @@ -0,0 +1,2 @@ +x += 1 +x >>= 1 diff --git a/corpus/python/shr-assign/a376103a568b.mutation.json b/corpus/python/shr-assign/a376103a568b.mutation.json new file mode 100644 index 00000000..8002a508 --- /dev/null +++ b/corpus/python/shr-assign/a376103a568b.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/shr-assign/a376103a568b.py b/corpus/python/shr-assign/a376103a568b.py new file mode 100644 index 00000000..8bb7ae77 --- /dev/null +++ b/corpus/python/shr-assign/a376103a568b.py @@ -0,0 +1,2 @@ +x -= 1 +x >>= 1 diff --git a/corpus/python/shr-assign/bd7ada5272ef.mutation.json b/corpus/python/shr-assign/bd7ada5272ef.mutation.json new file mode 100644 index 00000000..e045214f --- /dev/null +++ b/corpus/python/shr-assign/bd7ada5272ef.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "Assign": "ShrAssign" + }, + "subst_span": { + "start": { + "line": 1, + "col": 2, + "byte": 8 + }, + "end": { + "line": 1, + "col": 5, + "byte": 11 + } + }, + "effect_span": { + "start": { + "line": 1, + "col": 0, + "byte": 6 + }, + "end": { + "line": 1, + "col": 7, + "byte": 13 + } + } + }, + "subst": "<<=" +} \ No newline at end of file diff --git a/corpus/python/shr-assign/bd7ada5272ef.py b/corpus/python/shr-assign/bd7ada5272ef.py new file mode 100644 index 00000000..d59611d4 --- /dev/null +++ b/corpus/python/shr-assign/bd7ada5272ef.py @@ -0,0 +1,2 @@ +x = 1 +x <<= 1 diff --git a/corpus/python/shr-assign/c8b4974bf59c.mutation.json b/corpus/python/shr-assign/c8b4974bf59c.mutation.json new file mode 100644 index 00000000..3d7284a3 --- /dev/null +++ b/corpus/python/shr-assign/c8b4974bf59c.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "Assign": "ShrAssign" + }, + "subst_span": { + "start": { + "line": 1, + "col": 2, + "byte": 8 + }, + "end": { + "line": 1, + "col": 5, + "byte": 11 + } + }, + "effect_span": { + "start": { + "line": 1, + "col": 0, + "byte": 6 + }, + "end": { + "line": 1, + "col": 7, + "byte": 13 + } + } + }, + "subst": "=" +} \ No newline at end of file diff --git a/corpus/python/shr-assign/c8b4974bf59c.py b/corpus/python/shr-assign/c8b4974bf59c.py new file mode 100644 index 00000000..271991ef --- /dev/null +++ b/corpus/python/shr-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 ac66b43c..698e0576 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -66,6 +66,7 @@ impl LanguageDriver for PythonDriver { "|=" => AssignMutationKind::BitOrAssign, "^=" => AssignMutationKind::BitXorAssign, "<<=" => AssignMutationKind::ShlAssign, + ">>=" => AssignMutationKind::ShrAssign, _ => return None, }; Some((MutantKind::Assign(kind), span_from_node(&op_node), span_from_node(node))) @@ -134,6 +135,7 @@ impl LanguageDriver for PythonDriver { MutantKind::Assign(AssignMutationKind::BitOrAssign) => vec!["&=".into(), "=".into()], MutantKind::Assign(AssignMutationKind::BitXorAssign) => vec!["&=".into(), "=".into()], MutantKind::Assign(AssignMutationKind::ShlAssign) => vec![">>=".into(), "=".into()], + MutantKind::Assign(AssignMutationKind::ShrAssign) => vec!["<<=".into(), "=".into()], _ => vec![], } }