Repository navigation
test(dispatch): 补齐任务树标题截断与空标题回退的测试 - #2840
Merged
Merged
Conversation
补 deepcoldy#2778 复审列出的 4 处测试缺口,只加测试,不改功能代码: - 恰好 40 字的标题不截断(锁住 `>` 不被改成 `>=`) - 多段空白全部合并(`a\nb\nc` → `a b c`,锁住 `/\s+/g` 的 g) - 编排标题为空或纯空白时,卡片表头回退「编排任务」 - 同样情况下,`botmux dispatch tree` 文字版首行回退「编排任务」 Refs deepcoldy#2778 Co-Authored-By: Claude Opus 5.5 <[email protected]>
swtxbling
requested review from
47seek,
LucasIcarus,
deepcoldy,
xiaoxueSunn and
xiongz-c
as code owners
November 5, 2026 08:50
复审发现空标题回退用例只单向断言空/纯空白 → 「编排任务」:卡片 header 或文字版首行若恒退化成常量「编排任务」,现有 22 个用例全部仍绿(双引擎实证)。补一个非空标题用例,钉住两处渲染会显示真实编排标题;两个恒量化变异在新用例上双引擎咬红。 Refs deepcoldy#2778 Co-Authored-By: Claude Code <[email protected]>
Owner
|
已按复审建议追加一个 commit(aa2e5d5b9):补「非空编排标题」的正向断言。 原因:复审发现空标题回退用例只单向断言了空/纯空白 → 「编排任务」。把卡片 header( 新增用例 验证:
最终以维护者审阅为准。 🤖 Generated with Claude Code |
Owner
|
感谢贡献,已 squash 合入 master(11416c7d)。 复审补充的「非空编排标题正向断言」一并合入,四个缺口 + 回退正向覆盖现在都有双引擎变异证据。纯测试改动,无需额外操作。 🤖 Generated with Claude Code |
|
🚀 Released in v3.57.2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #2778
改了什么
补 #2778 合入时复审列出的 4 处测试缺口。只加测试,不改功能代码(只动了
test/dispatch-task-tree.test.ts,+19 行)。taskTreeDisplayTitle('a'.repeat(40))原样返回''和' \n '时,header.title.content === '编排任务'botmux dispatch tree文字版表头的同款回退没有覆盖编排任务(开头taskTreeDisplayTitle('a\nb\nc') === 'a b c'影响面
只改测试,生产代码没动,不影响任何 CLI、后端或会话类型。
验证
vitest run --project unit test/dispatch-task-tree.test.ts test/test-hygiene.test.ts:2 files / 48 tests passedbun test test/dispatch-task-tree.test.ts(bun 1.4.3):22 pass / 0 failtsc -p . --noEmit:0 错变异复验:把下面 4 处源码逐一临时改坏,每次都有对应的新用例变红(其余 21 个用例仍绿),之后已还原:
chars.length > max改成>=/\s+/g去掉g|| '编排任务'|| '编排任务'🤖 Generated with Claude Code