- Notifications
You must be signed in to change notification settings - Fork 392
Closed
Labels
bugSomething isn't workingSomething isn't workingtenet-coverageIssue related to possible incorrect coverageIssue related to possible incorrect coveragewith reproIssue with reproIssue with repro
Description
Having the following code:
public class ExcludedLocalFunctionReproduction { public void SomethingThatIsUsingALocalFunction() { MethodThatTakesALambda(NewMethod()); [ExcludeFromCodeCoverage(Justification = "Not testable")] static Func<string, bool> NewMethod() { return myString => myString.Length == 10; } } private void MethodThatTakesALambda(Func<string, bool> function) { // Do something - the actual function is not invoked to show the issue bool _ = function != null; } }
Coverlet reports the line return myString => myString.Length == 10;
as uncovered even though the local method is excluded from code coverage:
I would expect the local function to be shown as excluded.
The full code (along with other reproductions for already reported issues) is here: https://github.com/meggima/coverlet-reproductions
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtenet-coverageIssue related to possible incorrect coverageIssue related to possible incorrect coveragewith reproIssue with reproIssue with repro