test(subagent): tambah pengujian invarian read⊆write⊆full pada tool_scope

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
asepharyana
2026-07-14 10:55:05 +07:00
co-authored by Claude Sonnet 5
parent e023f2c5a8
commit 3e6f9a6a5f
+10
View File
@@ -88,4 +88,14 @@ mod tests {
assert!(!tools.contains(&"write".to_string()));
assert!(!tools.contains(&"delete".to_string()));
}
#[test]
fn read_tier_is_subset_of_write_tier_and_write_is_subset_of_full() {
use std::collections::HashSet;
let read: HashSet<_> = tools_for(READ).into_iter().collect();
let write: HashSet<_> = tools_for(WRITE).into_iter().collect();
let full: HashSet<_> = tools_for(FULL).into_iter().collect();
assert!(read.is_subset(&write), "read tier must be a subset of write tier");
assert!(write.is_subset(&full), "write tier must be a subset of full tier");
}
}