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

Function test_stats_merge

atomic-core/src/crdt/apply/context.rs:881–897  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

879
880 #[test]
881 fn test_stats_merge() {
882 let mut stats1 = ApplyStats::new();
883 stats1.add_trunk_created();
884 stats1.add_branch_inserted();
885
886 let mut stats2 = ApplyStats::new();
887 stats2.add_trunk_created();
888 stats2.add_leaf_inserted();
889 stats2.add_conflict();
890
891 stats1.merge(&stats2);
892
893 assert_eq!(stats1.trunks_created(), 2);
894 assert_eq!(stats1.branches_inserted(), 1);
895 assert_eq!(stats1.leaves_inserted(), 1);
896 assert_eq!(stats1.conflicts_detected(), 1);
897 }
898
899 #[test]
900 fn test_stats_display() {

Callers

nothing calls this directly

Calls 5

add_trunk_createdMethod · 0.80
add_branch_insertedMethod · 0.80
add_leaf_insertedMethod · 0.80
add_conflictMethod · 0.45
mergeMethod · 0.45

Tested by

no test coverage detected