Skip to content

test(shell): 兼容 Workspace 失败前缀 (#73) - #281

Merged
JavaZeroo merged 1 commit into
mainfrom
fix/selection-prefix-assert
Oct 31, 2026
Merged

JavaZeroo merged 1 commit into
mainfrom
fix/selection-prefix-assert

Conversation

@JavaZeroo

Copy link
Copy Markdown
Owner

问题

我在 #275 给 Workspace 失败路径加了前缀 workspace-failure mode=… what=…,导致 experiments/shell/test_selection_bytes.py:202 的精确前缀断言失效:

AssertionError: "shell probe failed: OpenClipboard: 5" does not match
                "shell probe failed: workspace-failure mode=ui-copy-bytes-system what=OpenClipboard: 5 …"

这正是 PR #279 的两个 Windows 回归红项(shell / text_actions 之外的那条断言)。

修改

把断言改为允许可选前缀:

"shell probe failed: (workspace-failure .*? what=)?OpenClipboard: 5"

即两种形态都接受:Workspace 场景(带前缀)与 shell 直驱场景(无前缀)。

验证

python -m unittest experiments.shell.test_selection_bytes → 10 tests OK (skipped=2)。

边界

  • 只放宽断言前缀,不改任何判定与失败行为;
  • 我的诊断改动引入的测试失败由我修复。

Refs #73

…e refs #73

The diagnostic prefix added earlier broke an exact-prefix assertion, so the regex now allows both shapes.
@JavaZeroo
JavaZeroo merged commit 27a72b5 into main Oct 31, 2026
9 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant