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

Function test_update_leaf_content

atomic-core/src/crdt/apply/traits.rs:835–846  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

833
834 #[test]
835 fn test_update_leaf_content() {
836 let mut txn = MockCrdtTxn::new();
837 let branch_id = BranchId::new(NodeId::new(1), 0);
838 let leaf_id = LeafId::new(NodeId::new(1), 0);
839 let leaf = Leaf::new(leaf_id, branch_id, TokenKind::Word, 0..5);
840
841 txn.put_leaf(&leaf, None).unwrap();
842 txn.update_leaf_content(leaf_id, 10..20).unwrap();
843
844 let retrieved = txn.get_leaf(leaf_id).unwrap().unwrap();
845 assert_eq!(retrieved.content_range(), 10..20);
846 }
847
848 // Extension Methods Tests
849

Callers

nothing calls this directly

Calls 4

unwrapMethod · 0.45
put_leafMethod · 0.45
update_leaf_contentMethod · 0.45
get_leafMethod · 0.45

Tested by

no test coverage detected