-
Notifications
You must be signed in to change notification settings - Fork 386
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
Multi-line lambda false negatives in 3.0.1 #1056
Comments
Okay, it's simply a multi-line lamba: public class SampleTest
{
[Fact]
public void T1()
{
Do(x => Console.WriteLine(x.GetType().Name));
Do(x => Console.WriteLine(x
.GetType()
.Name));
Do2(x => x.GetType().Name.Length);
Do2(x => x.GetType()
.Name
.Length);
}
private static void Do(Action<object> action)
{
action(new object());
}
private static object Do2(Func<object, object> func)
{
return func(new object());
}
} (Using latest ReportGenerator 4.8.4.) |
Thanks |
Nice. And btw. thanks for this great, great tool! |
We changed a bit the accounting alg because it was a mess, now we need to adjust a bit. Np we'll fix it. |
@ulrichb can you try the fix? |
Hmm, do you also have a prerelease .collector nuget package? |
It's a zip with all three packages inside. |
Yipee, just tested your build and my repro and my real code is 100% covered again. Thank you very much! |
@martincostello @JSkimming @Malivil @Dave-EMIS someone of you can try the package on your project and let us know if it's all ok? #1056 (comment) |
It's ok...lambda accounting it's a bit complex, coverlet uses sequence points(strong choice sometimes uncomfortable) and sometimes are "nested" i.e. sequence A hitted sequence B (lambda closure object) not hitted When we have an hit for A and not for B we account for covered line 1 and 4 from A but we use sequence B for 2 and 3. Thx @Malivil |
@MarcoRossignoli Results comparing different version of coverlet and OpenCover. SummaryAll looks good. Results
It looks like I incorrectly compared debug and release version when I stated coverlet was now giving comparable results as OpenCover, though the good news is, it already was 😃 |
I'm, not a big user of lambdas, I tend to use local functions or private methods for anything more complex than |
Thx for the test @JSkimming |
After midnight will be on nightly https://github.com/coverlet-coverage/coverlet/blob/master/Documentation/ConsumeNightlyBuild.md |
Just released new version https://github.com/coverlet-coverage/coverlet/releases/tag/v5.6.2 |
Okay, it got way better with 3.0.1 (after 3.0.0's #1037 has been fixed), but there are still false negatives (compared to coverlet.collector 1.3.0).
Example 1:
Example 2:
Originally posted by @ulrichb in #1037 (comment)
... I'm trying to create a repro sample.
The text was updated successfully, but these errors were encountered: