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

Function test_sequence_branch_ids

atomic-core/src/crdt/apply/order.rs:649–663  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

647
648 #[test]
649 fn test_sequence_branch_ids() {
650 let mut seq: OrderingSequence<BranchId> = OrderingSequence::new();
651
652 let id1 = BranchId::new(NodeId::new(1), 0);
653 let id2 = BranchId::new(NodeId::new(2), 0);
654 let id3 = BranchId::new(NodeId::new(3), 0);
655
656 seq.insert(id1, None);
657 seq.insert(id3, Some(id1));
658 seq.insert(id2, Some(id1)); // Goes between id1 and id3
659
660 assert_eq!(seq.get(0), Some(&id1));
661 assert_eq!(seq.get(1), Some(&id2));
662 assert_eq!(seq.get(2), Some(&id3));
663 }
664
665 #[test]
666 fn test_sequence_get_after() {

Callers

nothing calls this directly

Calls 1

insertMethod · 0.45

Tested by

no test coverage detected