Skip to content

Commit

Permalink
Add testdata that's missing coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
sourcefrog committed Sep 14, 2023
2 parents 4d2df60 + e23ae5e commit 2f1ff7c
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
7 changes: 7 additions & 0 deletions testdata/tree/missing_test/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[package]
name = "cargo-mutants-testdata-missing-test"
version = "0.0.0"
edition = "2018"
authors = ["Martin Pool"]
publish = false

8 changes: 8 additions & 0 deletions testdata/tree/missing_test/src/lib.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
fn is_symlink(unix_mode: u32) -> bool {
unix_mode & 0o140000 != 0
}

#[test]
fn test_symlink() {
assert!(is_symlink(0o147777));
}
25 changes: 25 additions & 0 deletions tests/cli/snapshots/cli__list_mutants_in_all_trees_as_json.snap
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

```
Expand Down

0 comments on commit 2f1ff7c

Please sign in to comment.