1 parent b9bb8eb commit 7d1ee7fCopy full SHA for 7d1ee7f
1 file changed
clash-lib/src/app/dispatcher/statistics_manager.rs
@@ -308,3 +308,21 @@ pub struct Snapshot {
308
pub memory: usize,
309
pub connections: Vec<TrackerInfo>,
310
}
311
+
312
+#[cfg(test)]
313
+mod tests {
314
+ use super::StatisticsManager;
315
316
+ #[tokio::test]
317
+ async fn summary_reports_accumulated_totals() {
318
+ let manager = StatisticsManager::new();
319
+ manager.push_uploaded(7);
320
+ manager.push_downloaded(11);
321
322
+ let summary = manager.summary().await;
323
324
+ assert_eq!(summary.upload_total, 7);
325
+ assert_eq!(summary.download_total, 11);
326
+ assert_eq!(summary.connection_count, 0);
327
+ }
328
+}
0 commit comments