coverlet icon indicating copy to clipboard operation
coverlet copied to clipboard

[BUG] Throw exception via method causes missing coverage

Open manuel-rw opened this issue 3 months ago • 0 comments

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:

325590667-31c186ce-a057-4543-9252-67266e61d699

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

manuel-rw avatar Apr 25 '24 11:04 manuel-rw