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

Function test_list_leaves

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

Source from the content-addressed store, hash-verified

813
814 #[test]
815 fn test_list_leaves() {
816 let mut txn = MockCrdtTxn::new();
817 let branch_id = BranchId::new(NodeId::new(1), 0);
818
819 let l1 = LeafId::new(NodeId::new(1), 0);
820 let l2 = LeafId::new(NodeId::new(1), 1);
821
822 txn.put_leaf(&Leaf::new(l1, branch_id, TokenKind::Word, 0..2), None)
823 .unwrap();
824 txn.put_leaf(
825 &Leaf::new(l2, branch_id, TokenKind::Whitespace, 2..3),
826 Some(l1),
827 )
828 .unwrap();
829
830 let leaves = txn.list_leaves(branch_id).unwrap();
831 assert_eq!(leaves.len(), 2);
832 }
833
834 #[test]
835 fn test_update_leaf_content() {

Callers

nothing calls this directly

Calls 3

unwrapMethod · 0.45
put_leafMethod · 0.45
list_leavesMethod · 0.45

Tested by

no test coverage detected