(assign, read, expected, message)
| 76 | } |
| 77 | |
| 78 | function assertThrowsOrKeepsValue(assign, read, expected, message) { |
| 79 | let threw = false; |
| 80 | try { |
| 81 | assign(); |
| 82 | } catch { |
| 83 | threw = true; |
| 84 | } |
| 85 | assertSame( |
| 86 | expected, |
| 87 | read(), |
| 88 | `${message}${threw ? "(赋值抛出,值保持不变)" : ""}`, |
| 89 | ); |
| 90 | } |
| 91 | |
| 92 | async function test(name, fn) { |
| 93 | testResults.total++; |
no test coverage detected