Watch
0
0
Fork
You've already forked hyperhive
0

test the wake prompt and the Messaging permission after the tool removal

This commit is contained in:
damocles 2026-11-07 17:50:30 +01:00 • committed by mara
commit 9457f49684

View file

@ -110,3 +110,28 @@ pub fn build_row(args: TurnRowArgs<'_>) -> TurnStatRow {
session_id: bus.current_session_id(),
}
}
#[cfg(test)]
mod wake_prompt_tests {
use super::format_wake_prompt;
/// The prompt is the sender and body only: no `[msg #N]` tag and no
/// "N more pending, call recv" nudge, since the tools they pointed at
/// are gone.
#[test]
fn the_wake_prompt_carries_the_sender_and_body_only() {
let p = format_wake_prompt("todo", "you have todos", false, false);
assert_eq!(p, "Incoming message from `todo`:\n---\nyou have todos\n---");
assert!(!p.contains("[msg #") && !p.contains("recv"));
}
#[test]
fn a_banner_leads_the_prompt_and_redelivery_wins_over_interruption() {
let redelivered = format_wake_prompt("a", "b", true, true);
assert!(redelivered.starts_with(hive_sh4re::inbox::REDELIVERY_HINT));
let interrupted = format_wake_prompt("a", "b", false, true);
assert!(interrupted.starts_with(hive_sh4re::inbox::INTERRUPTED_HINT));
let plain = format_wake_prompt("a", "b", false, false);
assert!(plain.starts_with("Incoming message from `a`:"));
}
}