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

Function test_count_branches

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

Source from the content-addressed store, hash-verified

785
786 #[test]
787 fn test_count_branches() {
788 let mut txn = MockCrdtTxn::new();
789 let trunk_id = TrunkId::new(NodeId::new(1), 0);
790
791 assert_eq!(txn.count_branches(trunk_id).unwrap(), 0);
792
793 let b1 = BranchId::new(NodeId::new(1), 0);
794 txn.put_branch(&Branch::new(b1, trunk_id), None).unwrap();
795
796 assert_eq!(txn.count_branches(trunk_id).unwrap(), 1);
797 }
798
799 // Leaf Tests
800

Callers

nothing calls this directly

Calls 2

unwrapMethod · 0.45
put_branchMethod · 0.45

Tested by

no test coverage detected