MCPcopy Create free account
hub / github.com/bytesize-rs/bytesize / test_sum

Function test_sum

src/lib.rs:573–585  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

571
572 #[test]
573 fn test_sum() {
574 let sizes = [ByteSize::kb(1), ByteSize::mb(1), ByteSize::mib(1)];
575
576 assert_eq!(
577 sizes.into_iter().sum::<ByteSize>(),
578 ByteSize::b(KB + MB + MIB)
579 );
580 assert_eq!(sizes.iter().sum::<ByteSize>(), ByteSize::b(KB + MB + MIB));
581 assert_eq!(
582 core::iter::empty::<ByteSize>().sum::<ByteSize>(),
583 ByteSize::b(0)
584 );
585 }
586
587 #[test]
588 fn test_comparison() {

Callers

nothing calls this directly

Calls 3

kbFunction · 0.85
mbFunction · 0.85
mibFunction · 0.85

Tested by

no test coverage detected