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

@ -184,6 +184,26 @@ impl From<Permission> for &'static str {
mod tests {
use super::*;
/// Agents message each other over matrix, so no permission grants a
/// hyperhive messaging tool any more. `Messaging` stays a valid stored
/// value, and it grants nothing.
#[test]
fn messaging_is_an_accepted_value_that_grants_no_tool() {
assert!(Permission::Messaging.tools().is_empty());
assert_eq!(
serde_json::from_str::<Permission>("\"messaging\"").expect("stored value decodes"),
Permission::Messaging
);
for p in Permission::ALL {
for tool in p.tools() {
assert!(
!["send", "recv", "ack_until"].contains(tool),
"{p:?} still grants the removed tool {tool}"
);
}
}
}
/// The `as_str` spelling of every variant. `ALL` is stable-ordered, so
/// a variant added to the enum but not to `ALL` or `as_str` shows here.
#[test]