MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_transfer_stats_with_values

Function test_transfer_stats_with_values

atomic-remote/src/streaming/tests.rs:606–621  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

604
605#[test]
606fn test_transfer_stats_with_values() {
607 let stats = TransferStats {
608 sections_transferred: 11,
609 chunks_transferred: 5,
610 chunks_skipped: 3,
611 bytes_transferred: 75000,
612 bytes_skipped: 60000,
613 elapsed_ms: 1200,
614 };
615
616 assert_eq!(stats.total_chunks(), 8);
617 assert_eq!(stats.total_bytes(), 135000);
618 let savings = stats.savings_pct();
619 assert!(savings > 44.0 && savings < 45.0);
620 assert!(stats.bytes_per_second() > 0);
621}
622
623#[test]
624fn test_transfer_stats_display_no_skipped() {

Callers

nothing calls this directly

Calls 1

savings_pctMethod · 0.45

Tested by

no test coverage detected