Skip to content

test: restore the engine coverage #3 dropped - #5

Merged
nerdstep merged 1 commit into
mainfrom
engine-coverage
Nov 25, 2026
Merged

nerdstep merged 1 commit into
mainfrom
engine-coverage

Conversation

@nerdstep

Copy link
Copy Markdown
Owner

Summary

#3 shrank two_peers.rs to a smoke test. Its commit said the removed checks were covered by the protocol tests, but most weren't. This adds them back on the in-memory network, as 9 tests in chat/protocol_tests.rs:

 protocol_tests.rs
+  edits_and_deletes_reach_the_other_side
+  a_reply_quotes_its_message_on_both_sides
+  clearing_one_side_leaves_the_other_and_numbering_carries_on
+  typing_reaches_the_other_side
+  nudges_are_rate_limited_each_way
+  away_by_hand_lasts_until_back_or_a_message
+  idle_is_away_until_input_and_ends_with_the_session
+  do_not_disturb_pauses_nudges_until_it_ends
+  do_not_disturb_ends_on_its_own

There are no changes to the app.

Evidence

  • Before: typing, nudges, away, idle and do not disturb had no engine test on main. Edits, deletes, replies and clearing were tested only at the Db level.
    After: 29 protocol tests pass in about 0.5 s, and passed 10 out of 10 runs.

  • I broke two rules on purpose, and each was caught:

    post() no longer calls back()      → away_by_hand_lasts_until_back_or_a_message FAILED
    nudged() no longer limits nudges   → nudges_are_rate_limited_each_way FAILED
    
  • cargo fmt --check, clippy -D warnings and cargo test all pass.

Merge Danger

Door: two-way

Blast Radius: none

These are tests only.

🤖 Generated with Claude Code

Shrinking two_peers in #3 removed checks that the protocol tests didn't
have, though the commit said they did. Back, on the in-memory network:

- edits and deletes reaching the other side, blanked on both; only the
  author can change a message
- a reply quoting its message on both sides
- clearing one side: the other keeps its copy, numbering carries on, and
  catch-up never sends the cleared messages again
- typing reaching the peer
- nudges limited each way, including from a build that doesn't limit them
- away by hand lasting until /back or a message; idle away ending with
  input; the peer's away ending with the session
- do not disturb refusing nudges, lasting across a restart, said again on
  reconnecting, and ending on its own

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nerdstep
nerdstep merged commit e931acc into main Nov 25, 2026
3 checks passed
@nerdstep
nerdstep deleted the engine-coverage branch November 25, 2026 19:14
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