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

Function test_leaf_value_encoding_roundtrip

atomic-core/src/crdt/tables.rs:1022–1036  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1020
1021 #[test]
1022 fn test_leaf_value_encoding_roundtrip() {
1023 let data = SerializedLeaf {
1024 branch_id: BranchId::new(NodeId::new(42), 5),
1025 kind: TokenKind::Word,
1026 state: LeafState::Alive,
1027 content_start: 100,
1028 content_end: 200,
1029 };
1030
1031 let bytes = encode_leaf_value(&data);
1032 assert_eq!(bytes.len(), 22);
1033
1034 let decoded = decode_leaf_value(&bytes);
1035 assert_eq!(data, decoded);
1036 }
1037
1038 #[test]
1039 fn test_leaf_value_encoding_all_token_kinds() {

Callers

nothing calls this directly

Calls 2

encode_leaf_valueFunction · 0.85
decode_leaf_valueFunction · 0.85

Tested by

no test coverage detected