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

Function test_branch_content_eq

atomic-core/src/crdt/branch.rs:611–629  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

609
610 #[test]
611 fn test_branch_content_eq() {
612 let mut branch1 = make_branch();
613 let mut branch2 = Branch::new(
614 BranchId::new(NodeId::new(2), 0),
615 TrunkId::new(NodeId::new(1), 0),
616 );
617
618 // Same default hash
619 assert!(branch1.content_eq(&branch2));
620
621 // Different hash
622 branch1.set_line_hash(111);
623 branch2.set_line_hash(222);
624 assert!(!branch1.content_eq(&branch2));
625
626 // Same hash again
627 branch2.set_line_hash(111);
628 assert!(branch1.content_eq(&branch2));
629 }
630
631 #[test]
632 fn test_branch_display() {

Callers

nothing calls this directly

Calls 2

make_branchFunction · 0.85
set_line_hashMethod · 0.80

Tested by

no test coverage detected