From 2f2e9f3d49c0fee62aa16c57df0846682ba40bad Mon Sep 17 00:00:00 2001 From: Freddie Ridell Date: Thu, 19 Mar 2026 09:27:15 +0000 Subject: [PATCH] py: bin-op-lt --- .../bin-op-lt/7d4cf48bbf98.mutation.json | 36 +++++++++++++++++++ corpus/python/bin-op-lt/7d4cf48bbf98.py | 3 ++ .../bin-op-lt/aaef01c73bf1.mutation.json | 36 +++++++++++++++++++ corpus/python/bin-op-lt/aaef01c73bf1.py | 3 ++ crates/bough-core/src/language/python.rs | 2 ++ 5 files changed, 80 insertions(+) create mode 100644 corpus/python/bin-op-lt/7d4cf48bbf98.mutation.json create mode 100644 corpus/python/bin-op-lt/7d4cf48bbf98.py create mode 100644 corpus/python/bin-op-lt/aaef01c73bf1.mutation.json create mode 100644 corpus/python/bin-op-lt/aaef01c73bf1.py diff --git a/corpus/python/bin-op-lt/7d4cf48bbf98.mutation.json b/corpus/python/bin-op-lt/7d4cf48bbf98.mutation.json new file mode 100644 index 00000000..2e989921 --- /dev/null +++ b/corpus/python/bin-op-lt/7d4cf48bbf98.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "BinaryOp": "Lt" + }, + "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-lt/7d4cf48bbf98.py b/corpus/python/bin-op-lt/7d4cf48bbf98.py new file mode 100644 index 00000000..370ee203 --- /dev/null +++ b/corpus/python/bin-op-lt/7d4cf48bbf98.py @@ -0,0 +1,3 @@ +a = 1 +b = 2 +x = a >= b diff --git a/corpus/python/bin-op-lt/aaef01c73bf1.mutation.json b/corpus/python/bin-op-lt/aaef01c73bf1.mutation.json new file mode 100644 index 00000000..3f046abb --- /dev/null +++ b/corpus/python/bin-op-lt/aaef01c73bf1.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "BinaryOp": "Lt" + }, + "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-lt/aaef01c73bf1.py b/corpus/python/bin-op-lt/aaef01c73bf1.py new file mode 100644 index 00000000..b4000ce3 --- /dev/null +++ b/corpus/python/bin-op-lt/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 3b50f79a..49b2857f 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -41,6 +41,7 @@ impl LanguageDriver for PythonDriver { "!=" => BinaryOpMutationKind::Ne, ">" => BinaryOpMutationKind::Gt, ">=" => BinaryOpMutationKind::Gte, + "<" => BinaryOpMutationKind::Lt, _ => return None, }; Some((MutantKind::BinaryOp(kind), span_from_node(&op_node), span_from_node(node))) @@ -81,6 +82,7 @@ impl LanguageDriver for PythonDriver { MutantKind::BinaryOp(BinaryOpMutationKind::Ne) => vec!["==".into()], MutantKind::BinaryOp(BinaryOpMutationKind::Gt) => vec!["<=".into(), ">=".into()], MutantKind::BinaryOp(BinaryOpMutationKind::Gte) => vec!["<".into(), ">".into()], + MutantKind::BinaryOp(BinaryOpMutationKind::Lt) => vec![">=".into(), "<=".into()], _ => vec![], } } -- knotmirror 0.0.1