Commit 8423fae
committed
Fixing issue #907
First, I added a failing unit test, in two parts:
* A new AsyncAwaitValueTaskStateMachine class in Samples.cs
in coverlet.core.tests/Samples, in line with the existing
AsyncAwaitStateMachine class, but returning a completed
ValueTask instead of a completed Task.
* A new test in CecilSymbolHelperTests.cs in
coverlet.core.tests/Symbols that expects the "await" in
that sample class not to have a branch in it.
After it failed, I updated CecilSymbolHelper to include
get_IsCompleted from System.Runtime.CompilerServices.ValueTaskAwaiter,
as suggested by @a-jackson in issue #907. The test passed.
One open question is whether it might be worth adding a
ValueTask-based analogue for the Instrumentation.AsyncAwait.cs
samples.1 parent dd2237a commit 8423fae
File tree
3 files changed
+25
-0
lines changed- src/coverlet.core/Symbols
- test/coverlet.core.tests
- Samples
- Symbols
3 files changed
+25
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
175 | 176 | | |
176 | 177 | | |
177 | 178 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
192 | 200 | | |
193 | 201 | | |
194 | 202 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
294 | 294 | | |
295 | 295 | | |
296 | 296 | | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
297 | 313 | | |
298 | 314 | | |
299 | 315 | | |
| |||
0 commit comments