From e047f3efb2a61d5725533cb6cf0bee45c5859d0b Mon Sep 17 00:00:00 2001 From: Martin Pool Date: Fri, 15 Dec 2023 19:13:02 +1000 Subject: [PATCH] Update tests: no dupes! --- src/visit.rs | 2 +- ...li__list_mutants_in_all_trees_as_json.snap | 90 ------------------- ...li__list_mutants_in_all_trees_as_text.snap | 3 - ...ing_so_later_missed_mutants_are_found.snap | 7 +- 4 files changed, 3 insertions(+), 99 deletions(-) diff --git a/src/visit.rs b/src/visit.rs index 29611eeb..95978a4c 100644 --- a/src/visit.rs +++ b/src/visit.rs @@ -204,7 +204,7 @@ impl<'o> DiscoveryVisitor<'o> { // The original block has braces and the replacements don't, so put // them back for the comparison... let new_block = quote!( { #rep } ).to_token_stream().to_pretty_string(); - dbg!(&orig_block, &new_block); + // dbg!(&orig_block, &new_block); if orig_block == new_block { debug!("Replacement is the same as the function body; skipping"); } else { diff --git a/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_json.snap b/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_json.snap index f0af0799..fb7ed6b4 100644 --- a/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_json.snap +++ b/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_json.snap @@ -2440,36 +2440,6 @@ expression: buf } } }, - { - "file": "src/a.rs", - "function": { - "function_name": "one", - "return_type": "-> i32", - "span": { - "end": { - "column": 2, - "line": 3 - }, - "start": { - "column": 1, - "line": 1 - } - } - }, - "genre": "FnValue", - "package": "cargo-mutants-testdata-unapply", - "replacement": "1", - "span": { - "end": { - "column": 6, - "line": 2 - }, - "start": { - "column": 5, - "line": 2 - } - } - }, { "file": "src/a.rs", "function": { @@ -2530,36 +2500,6 @@ expression: buf } } }, - { - "file": "src/b.rs", - "function": { - "function_name": "one_untested", - "return_type": "-> i32", - "span": { - "end": { - "column": 2, - "line": 3 - }, - "start": { - "column": 1, - "line": 1 - } - } - }, - "genre": "FnValue", - "package": "cargo-mutants-testdata-unapply", - "replacement": "1", - "span": { - "end": { - "column": 6, - "line": 2 - }, - "start": { - "column": 5, - "line": 2 - } - } - }, { "file": "src/b.rs", "function": { @@ -2620,36 +2560,6 @@ expression: buf } } }, - { - "file": "src/c.rs", - "function": { - "function_name": "one", - "return_type": "-> i32", - "span": { - "end": { - "column": 2, - "line": 3 - }, - "start": { - "column": 1, - "line": 1 - } - } - }, - "genre": "FnValue", - "package": "cargo-mutants-testdata-unapply", - "replacement": "1", - "span": { - "end": { - "column": 6, - "line": 2 - }, - "start": { - "column": 5, - "line": 2 - } - } - }, { "file": "src/c.rs", "function": { diff --git a/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_text.snap b/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_text.snap index 78c8d26d..72bcdbc2 100644 --- a/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_text.snap +++ b/tests/cli/snapshots/cli__list_mutants_in_all_trees_as_text.snap @@ -234,13 +234,10 @@ src/lib.rs:6:5: replace try_value_coercion -> String with "xyzzy".into() ``` src/a.rs:2:5: replace one -> i32 with 0 -src/a.rs:2:5: replace one -> i32 with 1 src/a.rs:2:5: replace one -> i32 with -1 src/b.rs:2:5: replace one_untested -> i32 with 0 -src/b.rs:2:5: replace one_untested -> i32 with 1 src/b.rs:2:5: replace one_untested -> i32 with -1 src/c.rs:2:5: replace one -> i32 with 0 -src/c.rs:2:5: replace one -> i32 with 1 src/c.rs:2:5: replace one -> i32 with -1 ``` diff --git a/tests/cli/snapshots/cli__mutants_are_unapplied_after_testing_so_later_missed_mutants_are_found.snap b/tests/cli/snapshots/cli__mutants_are_unapplied_after_testing_so_later_missed_mutants_are_found.snap index 66c4ae69..a07a3545 100644 --- a/tests/cli/snapshots/cli__mutants_are_unapplied_after_testing_so_later_missed_mutants_are_found.snap +++ b/tests/cli/snapshots/cli__mutants_are_unapplied_after_testing_so_later_missed_mutants_are_found.snap @@ -2,12 +2,9 @@ source: tests/cli/main.rs expression: stdout --- -Found 9 mutants to test +Found 6 mutants to test Unmutated baseline ... ok -src/a.rs:2:5: replace one -> i32 with 1 ... NOT CAUGHT src/b.rs:2:5: replace one_untested -> i32 with 0 ... NOT CAUGHT -src/b.rs:2:5: replace one_untested -> i32 with 1 ... NOT CAUGHT src/b.rs:2:5: replace one_untested -> i32 with -1 ... NOT CAUGHT -src/c.rs:2:5: replace one -> i32 with 1 ... NOT CAUGHT -9 mutants tested: 5 missed, 4 caught +6 mutants tested: 2 missed, 4 caught