diff options
Diffstat (limited to 'vendor/cov-mark/README.md')
-rw-r--r-- | vendor/cov-mark/README.md | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/vendor/cov-mark/README.md b/vendor/cov-mark/README.md new file mode 100644 index 000000000..81c1fcec0 --- /dev/null +++ b/vendor/cov-mark/README.md @@ -0,0 +1,21 @@ +# cov-mark + +Verify that your tests exercise the conditions you think they are exercising + +```rust +fn safe_divide(dividend: u32, divisor: u32) -> u32 { + if divisor == 0 { + cov_mark::hit!(save_divide_zero); + return 0; + } + dividend / divisor +} + +#[test] +fn test_safe_divide_by_zero() { + cov_mark::check!(save_divide_zero); + assert_eq!(safe_divide(92, 0), 0); +} +``` + +See [the docs](https://docs.rs/cov-mark) for details |