Commit ef7589e
committed
test: close the gaps the self-review surfaced
Four targeted regression tests, each justified by what it would catch:
1. test_should_swallow_placeholder_clear_error_on_strict_adapter
(test_thread_faithful.py)
Closes the meaningful gap: the try/except wrap added in 8dd34d1
for adapters like Telegram that reject whitespace-only edit_message
was untested. Mock adapter now raises ValueError when the
placeholder-clear " " edit comes through; the test asserts (a)
thread.post() returns a SentMessage instead of propagating, (b)
exactly one clear attempt was made (no retry loop), and (c) the
warn log fires with the exact expected message.
Mutation-tested: narrowing the `except Exception` to
`except RuntimeError` makes this test fail, confirming the swallow
path is actually exercised.
2. test_should_rebind_adapter_when_data_is_already_a_channelimpl
(test_channel_faithful.py)
Symmetric with the ThreadImpl rebind regression in
test_serialization.py. ChannelImpl.from_json had the same
early-return-skips-rebinding bug fix in 1ce9cbf, but no test was
added for the channel path.
3. test_strips_gchat_custom_link_with_balanced_parens_in_url
(test_gchat_format_extended.py)
Pins the plain-text-extraction behavior for URLs containing `)`.
Worked already because the strip regex stops at `|`/`>`, but a
future regex tweak could regress this without failing any other
test.
4. test_gchat_multiple_custom_links_in_one_paragraph
(test_gchat_format_extended.py)
Asserts the exact (text, link, text, link, text, link, text)
sequence for a paragraph with three `<url|text>` tokens. Catches
off-by-one errors in the placeholder-substitution split logic
that would otherwise pass single-link tests but produce wrong
ordering or dropped fragments.
3450 tests pass.
https://claude.ai/code/session_01XE1bMoQ5BjCvgi1iLGKKhG1 parent d62e0e6 commit ef7589e
3 files changed
Lines changed: 123 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
669 | 669 | | |
670 | 670 | | |
671 | 671 | | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
672 | 696 | | |
673 | 697 | | |
674 | 698 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
130 | 169 | | |
131 | 170 | | |
132 | 171 | | |
| |||
425 | 464 | | |
426 | 465 | | |
427 | 466 | | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
| 476 | + | |
| 477 | + | |
428 | 478 | | |
429 | 479 | | |
430 | 480 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
416 | 416 | | |
417 | 417 | | |
418 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
| 463 | + | |
| 464 | + | |
| 465 | + | |
| 466 | + | |
| 467 | + | |
419 | 468 | | |
420 | 469 | | |
421 | 470 | | |
| |||
0 commit comments