From 493e729c3866baba8f9f44d4e84333a99ddb0bd8 Mon Sep 17 00:00:00 2001 From: JavaZeroo <71128095+JavaZeroo@users.noreply.github.com> Date: Sat, 31 Oct 2026 18:09:29 +0800 Subject: [PATCH] test(shell): accept the workspace failure prefix in the clipboard case refs #73 The diagnostic prefix added earlier broke an exact-prefix assertion, so the regex now allows both shapes. --- experiments/shell/test_selection_bytes.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/experiments/shell/test_selection_bytes.py b/experiments/shell/test_selection_bytes.py index a3950559..a113e6f2 100644 --- a/experiments/shell/test_selection_bytes.py +++ b/experiments/shell/test_selection_bytes.py @@ -199,7 +199,10 @@ def test_owned_clipboard_contention_preserves_write_and_read_failures(self): with self.subTest(operation=operation): out = self.out / ("occupied-" + operation) with mock.patch.dict(os.environ, {"TERMFORGE_TEST_SELECTION_CLIPBOARD_HOLD": operation}): - with self.assertRaisesRegex(ValueError, "shell probe failed: OpenClipboard: 5"): + # Workspace scenarios prefix their failure with the scenario + # identity, so the message may carry that prefix (#73). + with self.assertRaisesRegex( + ValueError, "shell probe failed: (workspace-failure .*? what=)?OpenClipboard: 5"): execute(self.exe, "ui-copy-bytes-system", out) sample = json.loads((out / "sample.json").read_text(encoding="utf-8")) self.assertEqual(sample["exit_code"], 2)