1#[derive(Debug, Clone, PartialEq, Eq)]
4pub struct AgentId(pub String);
5
6#[derive(Debug, Clone, PartialEq, Eq)]
7pub struct InstanceId(pub String);
8
9#[cfg(test)]
10mod tests {
11 use super::*;
12
13 #[test]
14 fn ids_compare_by_value() {
15 assert_eq!(AgentId("a".into()), AgentId("a".into()));
16 assert_ne!(AgentId("a".into()), AgentId("b".into()));
17 assert_ne!(InstanceId("a".into()), InstanceId("b".into()));
18 }
19
20 #[test]
21 fn ids_debug_is_readable() {
22 assert_eq!(
23 format!("{:?}", AgentId("agent-1".into())),
24 "AgentId(\"agent-1\")"
25 );
26 }
27}