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

Function test_hashes

atomic-core/src/change/store.rs:685–699  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

683
684 #[test]
685 fn test_hashes() {
686 let store = MemoryChangeStore::new();
687 let change1 = create_test_change("One", b"1");
688 let change2 = create_test_change("Two", b"2");
689 let hash1 = change1.hash().unwrap();
690 let hash2 = change2.hash().unwrap();
691
692 store.insert(hash1, change1);
693 store.insert(hash2, change2);
694
695 let hashes = store.hashes();
696 assert_eq!(hashes.len(), 2);
697 assert!(hashes.contains(&hash1));
698 assert!(hashes.contains(&hash2));
699 }
700
701 #[test]
702 fn test_clone() {

Callers

nothing calls this directly

Calls 5

create_test_changeFunction · 0.70
unwrapMethod · 0.45
hashMethod · 0.45
insertMethod · 0.45
hashesMethod · 0.45

Tested by

no test coverage detected