diff --git a/Cargo.toml b/Cargo.toml index dcbc3e7e..01749812 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -111,6 +111,7 @@ exclude = [ "testdata/tree/hang_when_mutated", "testdata/tree/insta", "testdata/tree/integration_tests", + "testdata/tree/missing_test", "testdata/tree/mut_ref", "testdata/tree/never_type", "testdata/tree/override_dependency", diff --git a/testdata/tree/missing_test/Cargo.toml b/testdata/tree/missing_test/Cargo.toml new file mode 100644 index 00000000..e12e89ca --- /dev/null +++ b/testdata/tree/missing_test/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "cargo-mutants-testdata-missing-test" +version = "0.0.0" +edition = "2018" +authors = ["Martin Pool"] +publish = false + diff --git a/testdata/tree/missing_test/src/lib.rs b/testdata/tree/missing_test/src/lib.rs new file mode 100644 index 00000000..bfb099d2 --- /dev/null +++ b/testdata/tree/missing_test/src/lib.rs @@ -0,0 +1,8 @@ +fn is_symlink(unix_mode: u32) -> bool { + unix_mode & 0o140000 != 0 +} + +#[test] +fn test_symlink() { + assert!(is_symlink(0o147777)); +} 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 33d28793..4496acff 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 @@ -357,6 +357,31 @@ expression: buf ] ``` +## testdata/tree/missing_test + +```json +[ + { + "package": "cargo-mutants-testdata-missing-test", + "file": "src/lib.rs", + "line": 1, + "function": "is_symlink", + "return_type": "-> bool", + "replacement": "true", + "genre": "FnValue" + }, + { + "package": "cargo-mutants-testdata-missing-test", + "file": "src/lib.rs", + "line": 1, + "function": "is_symlink", + "return_type": "-> bool", + "replacement": "false", + "genre": "FnValue" + } +] +``` + ## testdata/tree/mut_ref ```json 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 78027aaf..1dabb981 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 @@ -105,6 +105,13 @@ src/lib.rs:1: replace double -> u32 with 0 src/lib.rs:1: replace double -> u32 with 1 ``` +## testdata/tree/missing_test + +``` +src/lib.rs:1: replace is_symlink -> bool with true +src/lib.rs:1: replace is_symlink -> bool with false +``` + ## testdata/tree/mut_ref ```