You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wrote a method in which there was an await statement in a finally block. The code was fully covered, but Coverlet reported an uncovered branch at the end of the finally block. I had a few things going on in that method -- ConfigureAwait was used in multiple places, there were multiple await statements in the finally block, including one in an if statement -- but I was able to narrow the problem down to something much simpler.
Suppose that we have these methods:
Suppose, also, that we have one test that calls into them, which should fully cover them, since there's no (user-written) branching logic in the code under test:
If I run that test under Coverlet 3.1.0 (in .NET 5 or .NET 6 RC 1), here's what I see:
The missing branch coverage is here (which turns out to be the curly brace closing the finally block):
This is the IL instruction that's left uncovered:
I will attach a repro solution, as well.
Many thanks!
The text was updated successfully, but these errors were encountered:
I wrote a method in which there was an
await
statement in afinally
block. The code was fully covered, but Coverlet reported an uncovered branch at the end of thefinally
block. I had a few things going on in that method --ConfigureAwait
was used in multiple places, there were multipleawait
statements in thefinally
block, including one in anif
statement -- but I was able to narrow the problem down to something much simpler.Suppose that we have these methods:
Suppose, also, that we have one test that calls into them, which should fully cover them, since there's no (user-written) branching logic in the code under test:
If I run that test under Coverlet 3.1.0 (in .NET 5 or .NET 6 RC 1), here's what I see:
The missing branch coverage is here (which turns out to be the curly brace closing the
finally
block):This is the IL instruction that's left uncovered:
I will attach a repro solution, as well.
Many thanks!
The text was updated successfully, but these errors were encountered: