-
Notifications
You must be signed in to change notification settings - Fork 385
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
Improve coverage of async/await state machine #698
Improve coverage of async/await state machine #698
Conversation
@@ -83,15 +102,87 @@ public static List<BranchPoint> GetBranchPoints(MethodDefinition methodDefinitio | |||
continue; | |||
} | |||
|
|||
/* | |||
If method is a generated MoveNext we'll skip first branches (could be a switch or a series of branches) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alg update
@@ -60,6 +60,25 @@ private static bool IsMoveNextInsideEnumerator(MethodDefinition methodDefinition | |||
return false; | |||
} | |||
|
|||
private static bool IsRecognizedMoveNextInsideAsyncStateMachineProlog(MethodDefinition methodDefinition) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Alg update
operand.DeclaringType.Scope.Name == "System.Runtime") | ||
( | ||
operand.DeclaringType.Scope.Name == "System.Runtime" || | ||
operand.DeclaringType.Scope.Name == "netstandard" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include netstandard
Fixes #669
Changed alg to recognize initial async/state machine branches used to check "state machine" state, some branch could not be covered due to true/false async nature of code.
Check comment of
CecilSymbolHelper.GetBranchPoints
for full explanationFixed is complete check adding netstandard scope, if we're testing netstandard project with ValueTask the scope is not System.Runtime but netstandard.
cc: @abbotware @LeMorrow @moikot