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

Function test_put_and_get_leaf

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

Source from the content-addressed store, hash-verified

800
801 #[test]
802 fn test_put_and_get_leaf() {
803 let mut txn = MockCrdtTxn::new();
804 let branch_id = BranchId::new(NodeId::new(1), 0);
805 let leaf_id = LeafId::new(NodeId::new(1), 0);
806 let leaf = Leaf::new(leaf_id, branch_id, TokenKind::Word, 0..5);
807
808 assert!(txn.put_leaf(&leaf, None).unwrap());
809 let retrieved = txn.get_leaf(leaf_id).unwrap().unwrap();
810 assert_eq!(retrieved.branch(), branch_id);
811 assert_eq!(retrieved.kind(), TokenKind::Word);
812 }
813
814 #[test]
815 fn test_list_leaves() {

Callers

nothing calls this directly

Calls 2

unwrapMethod · 0.45
get_leafMethod · 0.45

Tested by

no test coverage detected