MCPcopy Create free account
hub / github.com/Lymia/enumset / test_sum

Function test_sum

enumset_test/tests/mixedset_basic_ops.rs:350–357  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

348
349#[test]
350fn test_sum() {
351 let parts = [EnumSet::from(Enum::A), EnumSet::from(Enum::B), EnumSet::from(Enum::C)];
352 let sum: MixedEnumSet<Enum> = parts.iter().copied().sum();
353 assert_eq!(sum, Enum::A | Enum::B | Enum::C);
354
355 let sum_ref: MixedEnumSet<Enum> = parts.iter().sum();
356 assert_eq!(sum_ref, Enum::A | Enum::B | Enum::C);
357}
358
359#[test]
360fn test_mixed_value_fmt() {

Callers

nothing calls this directly

Calls 2

sumMethod · 0.80
iterMethod · 0.45

Tested by

no test coverage detected