From d034e09ee1f72d2878592ec07f08fda746e0f3af Mon Sep 17 00:00:00 2001 From: Freddie Ridell Date: Thu, 19 Mar 2026 09:39:55 +0000 Subject: [PATCH] py: exp-assign --- .../exp-assign/2370e6f2a35f.mutation.json | 36 +++++++++++++++++++ corpus/python/exp-assign/2370e6f2a35f.py | 2 ++ .../exp-assign/2dfc430096c4.mutation.json | 36 +++++++++++++++++++ corpus/python/exp-assign/2dfc430096c4.py | 2 ++ .../exp-assign/8a28c27e8342.mutation.json | 36 +++++++++++++++++++ corpus/python/exp-assign/8a28c27e8342.py | 2 ++ .../exp-assign/eb8c6e1c91f7.mutation.json | 36 +++++++++++++++++++ corpus/python/exp-assign/eb8c6e1c91f7.py | 2 ++ crates/bough-core/src/language/javascript.rs | 2 ++ crates/bough-core/src/language/python.rs | 2 ++ crates/bough-core/src/language/typescript.rs | 2 ++ crates/bough-core/src/mutant.rs | 2 ++ 12 files changed, 160 insertions(+) create mode 100644 corpus/python/exp-assign/2370e6f2a35f.mutation.json create mode 100644 corpus/python/exp-assign/2370e6f2a35f.py create mode 100644 corpus/python/exp-assign/2dfc430096c4.mutation.json create mode 100644 corpus/python/exp-assign/2dfc430096c4.py create mode 100644 corpus/python/exp-assign/8a28c27e8342.mutation.json create mode 100644 corpus/python/exp-assign/8a28c27e8342.py create mode 100644 corpus/python/exp-assign/eb8c6e1c91f7.mutation.json create mode 100644 corpus/python/exp-assign/eb8c6e1c91f7.py diff --git a/corpus/python/exp-assign/2370e6f2a35f.mutation.json b/corpus/python/exp-assign/2370e6f2a35f.mutation.json new file mode 100644 index 00000000..aa0bf40a --- /dev/null +++ b/corpus/python/exp-assign/2370e6f2a35f.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "Assign": "ExpAssign" + }, + "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/exp-assign/2370e6f2a35f.py b/corpus/python/exp-assign/2370e6f2a35f.py new file mode 100644 index 00000000..65ce324f --- /dev/null +++ b/corpus/python/exp-assign/2370e6f2a35f.py @@ -0,0 +1,2 @@ +x = 2 +x *= 3 diff --git a/corpus/python/exp-assign/2dfc430096c4.mutation.json b/corpus/python/exp-assign/2dfc430096c4.mutation.json new file mode 100644 index 00000000..8002a508 --- /dev/null +++ b/corpus/python/exp-assign/2dfc430096c4.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/exp-assign/2dfc430096c4.py b/corpus/python/exp-assign/2dfc430096c4.py new file mode 100644 index 00000000..89c44114 --- /dev/null +++ b/corpus/python/exp-assign/2dfc430096c4.py @@ -0,0 +1,2 @@ +x -= 2 +x **= 3 diff --git a/corpus/python/exp-assign/8a28c27e8342.mutation.json b/corpus/python/exp-assign/8a28c27e8342.mutation.json new file mode 100644 index 00000000..aef46c94 --- /dev/null +++ b/corpus/python/exp-assign/8a28c27e8342.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/exp-assign/8a28c27e8342.py b/corpus/python/exp-assign/8a28c27e8342.py new file mode 100644 index 00000000..456cd73e --- /dev/null +++ b/corpus/python/exp-assign/8a28c27e8342.py @@ -0,0 +1,2 @@ +x += 2 +x **= 3 diff --git a/corpus/python/exp-assign/eb8c6e1c91f7.mutation.json b/corpus/python/exp-assign/eb8c6e1c91f7.mutation.json new file mode 100644 index 00000000..3a6d4f52 --- /dev/null +++ b/corpus/python/exp-assign/eb8c6e1c91f7.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "Assign": "ExpAssign" + }, + "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/exp-assign/eb8c6e1c91f7.py b/corpus/python/exp-assign/eb8c6e1c91f7.py new file mode 100644 index 00000000..fa4ca202 --- /dev/null +++ b/corpus/python/exp-assign/eb8c6e1c91f7.py @@ -0,0 +1,2 @@ +x = 2 +x = 3 diff --git a/crates/bough-core/src/language/javascript.rs b/crates/bough-core/src/language/javascript.rs index 6ff5aedf..350c985d 100644 --- a/crates/bough-core/src/language/javascript.rs +++ b/crates/bough-core/src/language/javascript.rs @@ -224,6 +224,8 @@ impl LanguageDriver for JavascriptDriver { MutantKind::Assign(AssignMutationKind::ShrAssign) => vec!["<<=".into(), "=".into()], MutantKind::Assign(AssignMutationKind::AndAssign) => vec!["||=".into(), "=".into()], MutantKind::Assign(AssignMutationKind::OrAssign) => vec!["&&=".into(), "=".into()], + MutantKind::Assign(AssignMutationKind::ExpAssign) => vec![], + MutantKind::Assign(AssignMutationKind::FloorDivAssign) => vec![], MutantKind::ArrayDecl(ArrayDeclKind::Inline) => vec!["[]".into()], MutantKind::ArrayDecl(ArrayDeclKind::Instance) => vec!["new Array()".into()], MutantKind::DictDecl => vec!["{}".into()], diff --git a/crates/bough-core/src/language/python.rs b/crates/bough-core/src/language/python.rs index 698e0576..5ce558c4 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -67,6 +67,7 @@ impl LanguageDriver for PythonDriver { "^=" => AssignMutationKind::BitXorAssign, "<<=" => AssignMutationKind::ShlAssign, ">>=" => AssignMutationKind::ShrAssign, + "**=" => AssignMutationKind::ExpAssign, _ => return None, }; Some((MutantKind::Assign(kind), span_from_node(&op_node), span_from_node(node))) @@ -136,6 +137,7 @@ impl LanguageDriver for PythonDriver { MutantKind::Assign(AssignMutationKind::BitXorAssign) => vec!["&=".into(), "=".into()], MutantKind::Assign(AssignMutationKind::ShlAssign) => vec![">>=".into(), "=".into()], MutantKind::Assign(AssignMutationKind::ShrAssign) => vec!["<<=".into(), "=".into()], + MutantKind::Assign(AssignMutationKind::ExpAssign) => vec!["*=".into(), "=".into()], _ => vec![], } } diff --git a/crates/bough-core/src/language/typescript.rs b/crates/bough-core/src/language/typescript.rs index ef16b55a..d095bca1 100644 --- a/crates/bough-core/src/language/typescript.rs +++ b/crates/bough-core/src/language/typescript.rs @@ -216,6 +216,8 @@ impl LanguageDriver for TypescriptDriver { MutantKind::Assign(AssignMutationKind::ShrAssign) => vec!["<<=".into(), "=".into()], MutantKind::Assign(AssignMutationKind::AndAssign) => vec!["||=".into(), "=".into()], MutantKind::Assign(AssignMutationKind::OrAssign) => vec!["&&=".into(), "=".into()], + MutantKind::Assign(AssignMutationKind::ExpAssign) => vec![], + MutantKind::Assign(AssignMutationKind::FloorDivAssign) => vec![], MutantKind::ArrayDecl(ArrayDeclKind::Inline) => vec!["[]".into()], MutantKind::ArrayDecl(ArrayDeclKind::Instance) => vec!["new Array()".into()], MutantKind::DictDecl => vec!["{}".into()], diff --git a/crates/bough-core/src/mutant.rs b/crates/bough-core/src/mutant.rs index 4699a5c1..b4471dcb 100644 --- a/crates/bough-core/src/mutant.rs +++ b/crates/bough-core/src/mutant.rs @@ -347,6 +347,8 @@ pub enum AssignMutationKind { BitOrAssign, BitXorAssign, DivAssign, + ExpAssign, + FloorDivAssign, MulAssign, NormalAssign, OrAssign, -- knotmirror 0.0.1