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

Function test_stats_serde_roundtrip

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

Source from the content-addressed store, hash-verified

913
914 #[test]
915 fn test_stats_serde_roundtrip() {
916 let mut stats = ApplyStats::new();
917 stats.add_trunk_created();
918 stats.add_branch_inserted();
919 stats.add_leaf_inserted();
920 stats.add_content_bytes(42);
921
922 let json = serde_json::to_string(&stats).unwrap();
923 let restored: ApplyStats = serde_json::from_str(&json).unwrap();
924
925 assert_eq!(stats, restored);
926 }
927
928 // ApplyContext Tests
929

Callers

nothing calls this directly

Calls 5

add_trunk_createdMethod · 0.80
add_branch_insertedMethod · 0.80
add_leaf_insertedMethod · 0.80
add_content_bytesMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected