coverlet
coverlet copied to clipboard
[BUG] Throw exception via method causes missing coverage
Describe the bug
After throwing an exception via a method the method ending }
is not being marked as covered.
To Reproduce
public static void EnsureNull(int? value)
{
if (!value.HasValue)
{
return;
}
CustomException.Throw(value.Value);
}
https://github.com/meggima/coverlet-reproductions/pull/5
Expected behavior All four lines are fully covered.
Actual behavior Last line is marked as not covered:
Configuration (please complete the following information):
Please provide more information on your .NET configuration:
* Which coverlet package and version was used? coverlet.msbuild 3.1.2
(also tried coverlet.msbuild 6.0.
)
* Which version of .NET is the code running on? .net 6
* What OS and version, and what distro if applicable? Windows 10, 22H2
* What is the architecture (x64, x86, ARM, ARM64)? x64
* Do you know whether it is specific to that configuration? not specific
Additional context Add any other context about the problem here.
:exclamation: Please also read Known Issues