diff --git a/corpus/python/walrus-operator/c66467d6b73b.mutation.json b/corpus/python/walrus-operator/044a68c08b1e.mutation.json similarity index 62% rename from corpus/python/walrus-operator/c66467d6b73b.mutation.json rename to corpus/python/walrus-operator/044a68c08b1e.mutation.json index af2c1f8c..d36d26b4 100644 --- a/corpus/python/walrus-operator/c66467d6b73b.mutation.json +++ b/corpus/python/walrus-operator/044a68c08b1e.mutation.json @@ -4,19 +4,17 @@ "twig": [ "src/a.py" ], - "kind": { - "Assign": "NormalAssign" - }, + "kind": "Condition", "subst_span": { "start": { "line": 0, - "col": 2, - "byte": 2 + "col": 3, + "byte": 3 }, "end": { "line": 0, - "col": 3, - "byte": 3 + "col": 14, + "byte": 14 } }, "effect_span": { @@ -26,11 +24,11 @@ "byte": 0 }, "end": { - "line": 0, - "col": 13, - "byte": 13 + "line": 1, + "col": 8, + "byte": 24 } } }, - "subst": "+=" + "subst": "False" } \ No newline at end of file diff --git a/corpus/python/walrus-operator/044a68c08b1e.py b/corpus/python/walrus-operator/044a68c08b1e.py new file mode 100644 index 00000000..d5141585 --- /dev/null +++ b/corpus/python/walrus-operator/044a68c08b1e.py @@ -0,0 +1,2 @@ +if False: + pass diff --git a/corpus/python/walrus-operator/1a02a0861ad2.mutation.json b/corpus/python/walrus-operator/1a02a0861ad2.mutation.json deleted file mode 100644 index e0004612..00000000 --- a/corpus/python/walrus-operator/1a02a0861ad2.mutation.json +++ /dev/null @@ -1,36 +0,0 @@ -{ - "mutant": { - "lang": "py", - "twig": [ - "src/a.py" - ], - "kind": { - "BinaryOp": "Gt" - }, - "subst_span": { - "start": { - "line": 1, - "col": 17, - "byte": 31 - }, - "end": { - "line": 1, - "col": 18, - "byte": 32 - } - }, - "effect_span": { - "start": { - "line": 1, - "col": 3, - "byte": 17 - }, - "end": { - "line": 1, - "col": 20, - "byte": 34 - } - } - }, - "subst": ">=" -} \ No newline at end of file diff --git a/corpus/python/walrus-operator/1a02a0861ad2.py b/corpus/python/walrus-operator/1a02a0861ad2.py deleted file mode 100644 index 7157d75f..00000000 --- a/corpus/python/walrus-operator/1a02a0861ad2.py +++ /dev/null @@ -1,3 +0,0 @@ -x = [1, 2, 3] -if (n := len(x)) >= 0: - pass diff --git a/corpus/python/walrus-operator/7e4d13b6276c.py b/corpus/python/walrus-operator/7e4d13b6276c.py deleted file mode 100644 index 0a803e8c..00000000 --- a/corpus/python/walrus-operator/7e4d13b6276c.py +++ /dev/null @@ -1,3 +0,0 @@ -x = [1, 2, 3] -if (n := len(x)) <= 0: - pass diff --git a/corpus/python/walrus-operator/c150e3b341b0.mutation.json b/corpus/python/walrus-operator/a795a1c62f13.mutation.json similarity index 62% rename from corpus/python/walrus-operator/c150e3b341b0.mutation.json rename to corpus/python/walrus-operator/a795a1c62f13.mutation.json index f9ba7b01..db1f00e6 100644 --- a/corpus/python/walrus-operator/c150e3b341b0.mutation.json +++ b/corpus/python/walrus-operator/a795a1c62f13.mutation.json @@ -4,19 +4,17 @@ "twig": [ "src/a.py" ], - "kind": { - "Assign": "NormalAssign" - }, + "kind": "Condition", "subst_span": { "start": { "line": 0, - "col": 2, - "byte": 2 + "col": 3, + "byte": 3 }, "end": { "line": 0, - "col": 3, - "byte": 3 + "col": 14, + "byte": 14 } }, "effect_span": { @@ -26,11 +24,11 @@ "byte": 0 }, "end": { - "line": 0, - "col": 13, - "byte": 13 + "line": 1, + "col": 8, + "byte": 24 } } }, - "subst": "-=" + "subst": "True" } \ No newline at end of file diff --git a/corpus/python/walrus-operator/a795a1c62f13.py b/corpus/python/walrus-operator/a795a1c62f13.py new file mode 100644 index 00000000..858e6409 --- /dev/null +++ b/corpus/python/walrus-operator/a795a1c62f13.py @@ -0,0 +1,2 @@ +if True: + pass diff --git a/corpus/python/walrus-operator/b37c42b2b014.mutation.json b/corpus/python/walrus-operator/b37c42b2b014.mutation.json new file mode 100644 index 00000000..fb39ef72 --- /dev/null +++ b/corpus/python/walrus-operator/b37c42b2b014.mutation.json @@ -0,0 +1,36 @@ +{ + "mutant": { + "lang": "py", + "twig": [ + "src/a.py" + ], + "kind": { + "Literal": "BoolTrue" + }, + "subst_span": { + "start": { + "line": 0, + "col": 9, + "byte": 9 + }, + "end": { + "line": 0, + "col": 13, + "byte": 13 + } + }, + "effect_span": { + "start": { + "line": 0, + "col": 9, + "byte": 9 + }, + "end": { + "line": 0, + "col": 13, + "byte": 13 + } + } + }, + "subst": "False" +} \ No newline at end of file diff --git a/corpus/python/walrus-operator/b37c42b2b014.py b/corpus/python/walrus-operator/b37c42b2b014.py new file mode 100644 index 00000000..c0cb62f5 --- /dev/null +++ b/corpus/python/walrus-operator/b37c42b2b014.py @@ -0,0 +1,2 @@ +if (n := False): + pass diff --git a/corpus/python/walrus-operator/base.py b/corpus/python/walrus-operator/base.py index 36598770..59185d25 100644 --- a/corpus/python/walrus-operator/base.py +++ b/corpus/python/walrus-operator/base.py @@ -1,3 +1,2 @@ -x = [1, 2, 3] -if (n := len(x)) > 0: +if (n := True): pass diff --git a/corpus/python/walrus-operator/c150e3b341b0.py b/corpus/python/walrus-operator/c150e3b341b0.py deleted file mode 100644 index 7ddd3c0a..00000000 --- a/corpus/python/walrus-operator/c150e3b341b0.py +++ /dev/null @@ -1,3 +0,0 @@ -x -= [1, 2, 3] -if (n := len(x)) > 0: - pass diff --git a/corpus/python/walrus-operator/c66467d6b73b.py b/corpus/python/walrus-operator/c66467d6b73b.py deleted file mode 100644 index f1f03d57..00000000 --- a/corpus/python/walrus-operator/c66467d6b73b.py +++ /dev/null @@ -1,3 +0,0 @@ -x += [1, 2, 3] -if (n := len(x)) > 0: - pass diff --git a/corpus/python/walrus-operator/7e4d13b6276c.mutation.json b/corpus/python/walrus-operator/ce02bbc79693.mutation.json similarity index 59% rename from corpus/python/walrus-operator/7e4d13b6276c.mutation.json rename to corpus/python/walrus-operator/ce02bbc79693.mutation.json index 05547d56..722fc4e5 100644 --- a/corpus/python/walrus-operator/7e4d13b6276c.mutation.json +++ b/corpus/python/walrus-operator/ce02bbc79693.mutation.json @@ -4,33 +4,31 @@ "twig": [ "src/a.py" ], - "kind": { - "BinaryOp": "Gt" - }, + "kind": "StatementBlock", "subst_span": { "start": { "line": 1, - "col": 17, - "byte": 31 + "col": 4, + "byte": 20 }, "end": { "line": 1, - "col": 18, - "byte": 32 + "col": 8, + "byte": 24 } }, "effect_span": { "start": { "line": 1, - "col": 3, - "byte": 17 + "col": 4, + "byte": 20 }, "end": { "line": 1, - "col": 20, - "byte": 34 + "col": 8, + "byte": 24 } } }, - "subst": "<=" + "subst": "pass" } \ No newline at end of file diff --git a/corpus/python/walrus-operator/ce02bbc79693.py b/corpus/python/walrus-operator/ce02bbc79693.py new file mode 100644 index 00000000..59185d25 --- /dev/null +++ b/corpus/python/walrus-operator/ce02bbc79693.py @@ -0,0 +1,2 @@ +if (n := True): + pass diff --git a/crates/bough-core/src/language/python.rs b/crates/bough-core/src/language/python.rs index f6b66e27..51ff0827 100644 --- a/crates/bough-core/src/language/python.rs +++ b/crates/bough-core/src/language/python.rs @@ -251,6 +251,6 @@ mod tests { #[test] #[ignore] fn debug_tree() { - dump_tree("list(x for x in [1, 2, 3])"); + dump_tree("x = [1, 2, 3]\nif (n := len(x)) > 0:\n pass"); } }