()
| 413 | |
| 414 | #[test] |
| 415 | fn bounded_message_log() { |
| 416 | let registry = TopicRegistry::new(3); |
| 417 | registry.create_topic("bounded").unwrap(); |
| 418 | registry.publish("bounded", "1".into(), "a").unwrap(); |
| 419 | registry.publish("bounded", "2".into(), "a").unwrap(); |
| 420 | registry.publish("bounded", "3".into(), "a").unwrap(); |
| 421 | registry.publish("bounded", "4".into(), "a").unwrap(); // evicts "1" |
| 422 | |
| 423 | let (_, _, backlog) = registry.subscribe("bounded", 1).unwrap(); |
| 424 | assert_eq!(backlog.len(), 3); |
| 425 | assert_eq!(backlog[0].payload, "2"); |
| 426 | } |
| 427 | |
| 428 | #[test] |
| 429 | fn topic_stats_test() { |
nothing calls this directly
no test coverage detected