-
-
Notifications
You must be signed in to change notification settings - Fork 181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
else
lines are reported as not covered
#235
Comments
I have the same issue with a single else reporting not covered:
I do have another For my case, a unit test either sets the verbose option or doesn't. I did try to set, call, unset, call, but that did not change the coverage report. This is tarpaulin 0.8.3 |
I tried to reproduce it and it seem that when I made a small patch to update the current tests to fail. diff --git a/tests/data/structs/src/lib.rs b/tests/data/structs/src/lib.rs
index 497b77f..9767819 100644
--- a/tests/data/structs/src/lib.rs
+++ b/tests/data/structs/src/lib.rs
@@ -15,6 +15,14 @@ impl Foo {
z: None
}
}
+
+ fn is_even(x: u32) -> bool {
+ if x%2 == 0 {
+ true
+ } else {
+ false
+ }
+ }
}
#[test]
@@ -33,4 +41,7 @@ fn struct_exprs() {
x: 5,
..Default::default()
};
+
+ Foo::is_even(5);
+ Foo::is_even(6);
}
|
Can confirm the issue. Until resolved, I created this python script to remove these false positives from cobertura.xml files: https://gist.github.com/miehe-dup/68c87099d485e5f8fb347dad6b1c15be |
Can confirm with tarpaulin 0.8.5. |
This has already been reported in #136. |
Yeah I'm going to close this as duplicated, anyone who's a wizz at disassembly who wants to take a look is more than welcome also 😄 I've only made slight progress with these sort of issues and a compiler update can sometimes change results significantly 😞 |
I just setup tarpaulin with Travis CI + Codecov to monitor the coverage of my project. I noticed that one file that I was confident I had thoroughly tested was reported to only have around 85% coverage.
Here is the code coverage report for that file:
https://codecov.io/gh/rainvg/drop/src/b5d608e6e74df069676d9f04134c3de07c58cf8d/src/data/varint.rs
Lines 29, 53, and 59 are reported as not covered, but the only content of those lines is
and both branches of the
if
clause they belong to are fully covered.Am I missing something? Is it possible that I did something wrong with my configuration?
The text was updated successfully, but these errors were encountered: