test(06-14): register blocked delete/insert heterogeneous stream order (G-06-04-C) and map coverage

- add correct-expectation it.skip for the heterogeneous route after delete(1) (anchor #06-04-3)
- add correct-expectation it.skip for the heterogeneous route after insert(2, 9, [true, 5]) (anchor #06-04-4)
- add file-inline expectRouteStream helper (stream-only typed reads with index 1..N and terminal null)
- append the create-or-append 06-14 section to 06-COVERAGE-MAP.md; existing 5 skips unchanged
This commit is contained in:
unanmed 2026-09-15 11:50:30 +08:00
parent 2cffe3ef6c
commit 83dc4fdaf6
2 changed files with 60 additions and 0 deletions

View File

@ -336,3 +336,19 @@ D-40真实英雄操作经 `replay.route.add(...)`mover 方向步)录制
`restores the equipped mapping through the container across all compressions`(锚定 `#06-09-2`
既有 `#06-09-1..5` 的 skip 全部保持原样。
本计划**无新增码**`06-TEST-FINDINGS.md` 无新增 `#06-13-N` 缺陷条目。
## 06-14 录像读取流专项验证补齐D-46
本计划为 **G-06-04-CA + B** 的补测,**不引入新码**(复用既有可达码 148155其中 155 为
「变更后读过期流」的告警断言);阶段结构为 构件(仅流读复杂序列)→ 组合(既有流断言强化 +
变更后 `expired`)→ 完整(增删后流读次序正确预期 skip
| 缺口 | 用例 | 文件 | 计划 |
| --- | --- | --- | --- |
| G-06-04-C/A | `reads a heterogeneous route exclusively through a read stream`、`starts a complex route read stream at a middle index` | `data-common/src/replay/array.test.ts` | 06-14 |
| G-06-04-C/B | `expectHeterogeneousRead`helper 强化,服务 3 条既有用例)、`reads a sequence of steps through a read stream`、`expands buffers and still reads every step back`、`expires a read stream after the heterogeneous route is mutated` | `data-common/src/replay/array.test.ts` | 06-14 |
| G-06-04-C附带 | `reads the new order after deleting a middle step from a heterogeneous route``it.skip``#06-04-3`)、`reads the new order after inserting a step into a heterogeneous route``it.skip``#06-04-4` | `data-common/src/replay/array.test.ts` | 06-14 |
本计划**无新增码**;两条为受阻塞的正确预期 `it.skip`(锚定既有 `#06-04-3`/`#06-04-4`
并确认既有 `#06-04-1`/`#06-04-2` 两条 skip 不变);不削弱也不删除任何既有用例或跳过。
`06-TEST-FINDINGS.md` 无新增 `#06-14-N` 缺陷条目(受阻塞项复用既有锚点)。

View File

@ -154,6 +154,19 @@ function expectHeterogeneousRead(
expect(stream.read()).toBeNull();
}
// 仅经读取流逐条验证异质序列:每参数类型与值、流索引 1..N 递进,末尾断言 null 与索引等于步数
function expectRouteStream(
array: ReplayArray,
expectedSteps: ReadonlyArray<readonly [number, ReplayParamValue[]]>
): void {
const stream = array.createReadStream(0);
expectedSteps.forEach(([command, params], i) => {
expectStepTyped(stream.read()!, command, params, i + 1);
});
expect(stream.read()).toBeNull();
expect(stream.index).toBe(expectedSteps.length);
}
describe('ReplayArray single operations', () => {
// 验证 add 追加一条录像步并在原索引读回指令与参数
it('appends one step and reads it back at the original index', () => {
@ -494,6 +507,37 @@ describe('ReplayArray stream and buffer combination', () => {
expect(stream.read()).toEqual({ command: 3, params: [30], index: 3 });
});
// 疑似 bugdelete 中间步后索引数组未按删除位置回退,异质序列后续步骤读到错误参数,详见 06-TEST-FINDINGS.md #06-04-3修复后取消 skip
it.skip('reads the new order after deleting a middle step from a heterogeneous route', () => {
const array = createHeterogeneousArray();
array.delete(1);
expect(array.length).toBe(5);
const remaining = heterogeneousSteps.filter(
(_, stepIndex) => stepIndex !== 1
);
expectRouteStream(array, remaining);
});
// 疑似 buginsert 的参数缓冲区位移方向相反,异质序列新次序读流会读到错误参数,详见 06-TEST-FINDINGS.md #06-04-4修复后取消 skip
it.skip('reads the new order after inserting a step into a heterogeneous route', () => {
const array = createHeterogeneousArray();
array.insert(2, 9, [true, 5]);
expect(array.length).toBe(7);
const reordered: ReadonlyArray<readonly [number, ReplayParamValue[]]> =
[
heterogeneousSteps[0],
heterogeneousSteps[1],
[9, [true, 5]],
heterogeneousSteps[2],
heterogeneousSteps[3],
heterogeneousSteps[4],
heterogeneousSteps[5]
];
expectRouteStream(array, reordered);
});
// 验证 getCommandArray 与 getParamArray 暴露内部缓冲区的直接内容
it('exposes the underlying command and param buffers', () => {
const array = createArray();