MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / topic_stats_test

Function topic_stats_test

nodedb/src/control/pubsub.rs:429–438  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

427
428 #[test]
429 fn topic_stats_test() {
430 let registry = TopicRegistry::new(1000);
431 registry.create_topic("stats").unwrap();
432 registry.publish("stats", "a".into(), "admin").unwrap();
433 registry.publish("stats", "b".into(), "admin").unwrap();
434
435 let stats = registry.topic_stats("stats").unwrap();
436 assert_eq!(stats.message_count, 2);
437 assert_eq!(stats.next_seq, 3);
438 }
439
440 #[tokio::test]
441 async fn consumer_group_round_robin() {

Callers

nothing calls this directly

Calls 3

create_topicMethod · 0.80
topic_statsMethod · 0.80
publishMethod · 0.45

Tested by

no test coverage detected