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

Function test_create_leaf

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

Source from the content-addressed store, hash-verified

915
916 #[test]
917 fn test_create_leaf() {
918 let mut txn = MockCrdtTxn::new();
919 let branch_id = BranchId::new(NodeId::new(1), 0);
920 let leaf_id = LeafId::new(NodeId::new(1), 0);
921
922 let leaf = txn
923 .create_leaf(leaf_id, branch_id, TokenKind::Word, 0..5, None)
924 .unwrap();
925
926 assert_eq!(leaf.id(), leaf_id);
927 assert_eq!(leaf.branch(), branch_id);
928 assert_eq!(leaf.kind(), TokenKind::Word);
929 assert!(txn.has_leaf(leaf_id).unwrap());
930 }
931
932 #[test]
933 fn test_mark_leaf_deleted() {

Callers

nothing calls this directly

Calls 2

create_leafMethod · 0.80
unwrapMethod · 0.45

Tested by

no test coverage detected