From fcd263b26b16d35b156a88934d440642bc4b89ef Mon Sep 17 00:00:00 2001 From: Freddie Ridell Date: Thu, 19 Mar 2026 09:26:29 +0000 Subject: [PATCH] py: bin-op-gt --- .../bin-op-gt/7d4cf48bbf98.mutation.json | 36 +++++++++++++++++++ corpus/python/bin-op-gt/7d4cf48bbf98.py | 3 ++ .../bin-op-gt/aaef01c73bf1.mutation.json | 36 +++++++++++++++++++ corpus/python/bin-op-gt/aaef01c73bf1.py | 3 ++ crates/bough-core/src/language/python.rs | 2 ++ 5 files changed, 80 insertions(+) create mode 100644 corpus/python/bin-op-gt/7d4cf48bbf98.mutation.json create mode 100644 corpus/python/bin-op-gt/7d4cf48bbf98.py create mode 100644 corpus/python/bin-op-gt/aaef01c73bf1.mutation.json create mode 100644 corpus/python/bin-op-gt/aaef01c73bf1.py diff --git a/corpus/python/bin-op-gt/7d4cf48bbf98.mutation.json b/corpus/python/bin-op-gt/7d4cf48bbf98.mutation.json new file mode 100644 index 00000000..0caebbf8 --- /dev/null +++ b/corpus/python/bin-op-gt/7d4cf48bbf98.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "BinaryOp": "Gt" + }, + "subst_span": { + "start": { + "line": 2, + "col": 6, + "byte": 18 + }, + "end": { + "line": 2, + "col": 7, + "byte": 19 + } + }, + "effect_span": { + "start": { + "line": 2, + "col": 4, + "byte": 16 + }, + "end": { + "line": 2, + "col": 9, + "byte": 21 + } + } + }, + "subst": ">=" +} \ No newline at end of file diff --git a/corpus/python/bin-op-gt/7d4cf48bbf98.py b/corpus/python/bin-op-gt/7d4cf48bbf98.py new file mode 100644 index 00000000..370ee203 --- /dev/null +++ b/corpus/python/bin-op-gt/7d4cf48bbf98.py @@ -0,0 +1,3 @@ +a = 1 +b = 2 +x = a >= b diff --git a/corpus/python/bin-op-gt/aaef01c73bf1.mutation.json b/corpus/python/bin-op-gt/aaef01c73bf1.mutation.json new file mode 100644 index 00000000..2b7e2ed5 --- /dev/null +++ b/corpus/python/bin-op-gt/aaef01c73bf1.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "BinaryOp": "Gt" + }, + "subst_span": { + "start": { + "line": 2, + "col": 6, + "byte": 18 + }, + "end": { + "line": 2, + "col": 7, + "byte": 19 + } + }, + "effect_span": { + "start": { + "line": 2, + "col": 4, + "byte": 16 + }, + "end": { + "line": 2, + "col": 9, + "byte": 21 + } + } + }, + "subst": "<=" +} \ No newline at end of file diff --git a/corpus/python/bin-op-gt/aaef01c73bf1.py b/corpus/python/bin-op-gt/aaef01c73bf1.py new file mode 100644 index 00000000..b4000ce3 --- /dev/null +++ b/corpus/python/bin-op-gt/aaef01c73bf1.py @@ -0,0 +1,3 @@ +a = 1 +b = 2 +x = a <= b diff --git a/crates/bough-core/src/language/python.rs b/crates/bough-core/src/language/python.rs index 61c13dc4..dea4fead 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -39,6 +39,7 @@ impl LanguageDriver for PythonDriver { let kind = match op_text { "==" => BinaryOpMutationKind::Eq, "!=" => BinaryOpMutationKind::Ne, + ">" => BinaryOpMutationKind::Gt, _ => return None, }; Some((MutantKind::BinaryOp(kind), span_from_node(&op_node), span_from_node(node))) @@ -77,6 +78,7 @@ impl LanguageDriver for PythonDriver { MutantKind::BinaryOp(BinaryOpMutationKind::Or) => vec!["and".into()], MutantKind::BinaryOp(BinaryOpMutationKind::Eq) => vec!["!=".into()], MutantKind::BinaryOp(BinaryOpMutationKind::Ne) => vec!["==".into()], + MutantKind::BinaryOp(BinaryOpMutationKind::Gt) => vec!["<=".into(), ">=".into()], _ => vec![], } } -- knotmirror 0.0.1