fix(07-01): #06-01-1 align critical info with the yielded next value

- move targetInfo assignment into the damage < referenceDamage branch so the
  reported critical info matches the yielded next value
- un-skip the correct-expectation case in damage.test.ts (#06-01-1)
This commit is contained in:
unanmed 2026-09-15 16:53:50 +08:00
parent 7ae08c6920
commit 9e96df4c3b
2 changed files with 3 additions and 3 deletions

View File

@ -575,8 +575,8 @@ describe('DamageContext critical generation', () => {
expect(locatorResult.info).toHaveLength(0);
});
// 疑似 bug:产出的 info 应与 nextValue 对应,详见 06-TEST-FINDINGS.md #06-01-1,修复后取消 skip
it.skip('reports the damage info matching the yielded critical value', () => {
// 验证产出的 info 与 nextValue 同源,即临界点伤害信息对应该属性值
it('reports the damage info matching the yielded critical value', () => {
const fixture = createFixture();
const context = new modules.DamageContext(
fixture.context,

View File

@ -228,9 +228,9 @@ export class DamageContext<TEnemy, THero> implements IDamageContext<
if (middleInfo.damage < referenceDamage) {
right = middle;
targetInfo = middleInfo;
} else {
left = middle;
targetInfo = middleInfo;
}
if (right - left <= 1) break;
}