From ecb8d3436391ff2f485a6529499188da663fd83a Mon Sep 17 00:00:00 2001 From: Freddie Ridell Date: Thu, 19 Mar 2026 09:29:18 +0000 Subject: [PATCH] py: bin-op-floor-div --- .../1405b5b6bb6c.mutation.json | 36 +++++++++++++++++++ .../python/bin-op-floor-div/1405b5b6bb6c.py | 1 + .../cab108da51df.mutation.json | 36 +++++++++++++++++++ .../python/bin-op-floor-div/cab108da51df.py | 1 + crates/bough-core/src/language/python.rs | 2 ++ 5 files changed, 76 insertions(+) create mode 100644 corpus/python/bin-op-floor-div/1405b5b6bb6c.mutation.json create mode 100644 corpus/python/bin-op-floor-div/1405b5b6bb6c.py create mode 100644 corpus/python/bin-op-floor-div/cab108da51df.mutation.json create mode 100644 corpus/python/bin-op-floor-div/cab108da51df.py diff --git a/corpus/python/bin-op-floor-div/1405b5b6bb6c.mutation.json b/corpus/python/bin-op-floor-div/1405b5b6bb6c.mutation.json new file mode 100644 index 00000000..1af65ad7 --- /dev/null +++ b/corpus/python/bin-op-floor-div/1405b5b6bb6c.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "BinaryOp": "FloorDiv" + }, + "subst_span": { + "start": { + "line": 0, + "col": 6, + "byte": 6 + }, + "end": { + "line": 0, + "col": 8, + "byte": 8 + } + }, + "effect_span": { + "start": { + "line": 0, + "col": 4, + "byte": 4 + }, + "end": { + "line": 0, + "col": 10, + "byte": 10 + } + } + }, + "subst": "*" +} \ No newline at end of file diff --git a/corpus/python/bin-op-floor-div/1405b5b6bb6c.py b/corpus/python/bin-op-floor-div/1405b5b6bb6c.py new file mode 100644 index 00000000..b6960270 --- /dev/null +++ b/corpus/python/bin-op-floor-div/1405b5b6bb6c.py @@ -0,0 +1 @@ +x = 7 * 2 diff --git a/corpus/python/bin-op-floor-div/cab108da51df.mutation.json b/corpus/python/bin-op-floor-div/cab108da51df.mutation.json new file mode 100644 index 00000000..74ff60c4 --- /dev/null +++ b/corpus/python/bin-op-floor-div/cab108da51df.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "BinaryOp": "FloorDiv" + }, + "subst_span": { + "start": { + "line": 0, + "col": 6, + "byte": 6 + }, + "end": { + "line": 0, + "col": 8, + "byte": 8 + } + }, + "effect_span": { + "start": { + "line": 0, + "col": 4, + "byte": 4 + }, + "end": { + "line": 0, + "col": 10, + "byte": 10 + } + } + }, + "subst": "/" +} \ No newline at end of file diff --git a/corpus/python/bin-op-floor-div/cab108da51df.py b/corpus/python/bin-op-floor-div/cab108da51df.py new file mode 100644 index 00000000..83da1eac --- /dev/null +++ b/corpus/python/bin-op-floor-div/cab108da51df.py @@ -0,0 +1 @@ +x = 7 / 2 diff --git a/crates/bough-core/src/language/python.rs b/crates/bough-core/src/language/python.rs index 97753ed6..138ef3d2 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -30,6 +30,7 @@ impl LanguageDriver for PythonDriver { "<<" => BinaryOpMutationKind::Shl, ">>" => BinaryOpMutationKind::Shr, "**" => BinaryOpMutationKind::Exp, + "//" => BinaryOpMutationKind::FloorDiv, _ => return None, }; Some((MutantKind::BinaryOp(kind), span_from_node(&op_node), span_from_node(node))) @@ -87,6 +88,7 @@ impl LanguageDriver for PythonDriver { MutantKind::BinaryOp(BinaryOpMutationKind::Lt) => vec![">=".into(), "<=".into()], MutantKind::BinaryOp(BinaryOpMutationKind::Lte) => vec![">".into(), "<".into()], MutantKind::BinaryOp(BinaryOpMutationKind::Exp) => vec!["*".into(), "//".into()], + MutantKind::BinaryOp(BinaryOpMutationKind::FloorDiv) => vec!["/".into(), "*".into()], _ => vec![], } } -- knotmirror 0.0.1