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

Function test_list_branches

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

Source from the content-addressed store, hash-verified

769
770 #[test]
771 fn test_list_branches() {
772 let mut txn = MockCrdtTxn::new();
773 let trunk_id = TrunkId::new(NodeId::new(1), 0);
774
775 let b1 = BranchId::new(NodeId::new(1), 0);
776 let b2 = BranchId::new(NodeId::new(1), 1);
777
778 txn.put_branch(&Branch::new(b1, trunk_id), None).unwrap();
779 txn.put_branch(&Branch::new(b2, trunk_id), Some(b1))
780 .unwrap();
781
782 let branches = txn.list_branches(trunk_id).unwrap();
783 assert_eq!(branches.len(), 2);
784 }
785
786 #[test]
787 fn test_count_branches() {

Callers

nothing calls this directly

Calls 3

unwrapMethod · 0.45
put_branchMethod · 0.45
list_branchesMethod · 0.45

Tested by

no test coverage detected