Skip to content
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

Example of missed coverage #218

Closed
DevJac opened this issue Mar 29, 2019 · 4 comments
Closed

Example of missed coverage #218

DevJac opened this issue Mar 29, 2019 · 4 comments

Comments

@DevJac
Copy link

DevJac commented Mar 29, 2019

Here is a short example where tarpaulin misses coverage of a line that should be considered covered:

use std::ops;

#[derive(Clone, Copy, Debug, PartialEq)]
pub struct Vec3(pub f64, pub f64, pub f64);

impl Vec3 {
    pub fn dot(self, rhs: Self) -> f64 {
        (self.0 * rhs.0) + (self.1 * rhs.1) + (self.2 * rhs.2)  // This line will show as uncovered.
    }
}

#[test]
fn test_dot() {
    assert_eq!(Vec3(1.0, 2.0, 3.0).dot(Vec3(1.0, 3.3, 0.0)), 7.6);
}

A comment indicates which line is missing coverage.

I understand there are some known cases where coverage is missed, but I thought this might possibly demonstrate a new case.

@DevJac
Copy link
Author

DevJac commented Oct 30, 2019

Because of other recent enhancements and bugfixes, I wondered if this was still a problem. I confirmed this is still happening with tarpaulin 0.9.0 and Rust 1.38.

@Ploppz
Copy link

Ploppz commented Jan 2, 2020

I wonder if my issue is also an example of this? Or something else?
It's about what I would call contradictory line coverage information:

ss

What does it mean that .join(..) is not covered, when the statement of which it is a part is considered covered?

@Ploppz
Copy link

Ploppz commented Jan 2, 2020

nvm it looks more like #270

@xd009642
Copy link
Owner

There's some improvements in coverage in the latest develop that solved some longstanding issues.

So I'm going to close this issue. But if you try again with that and if it's still an issue report it to my new missing/incorrect coverage issue #351 . This helps keep all the different missing coverage problems in one place. And hopefully makes it easier for me to work on

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants