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

Function test_hashes

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

Source from the content-addressed store, hash-verified

659
660 #[test]
661 fn test_hashes() {
662 let store = MemoryChangeStore::new();
663 let change1 = create_test_change("One", b"1");
664 let change2 = create_test_change("Two", b"2");
665 let hash1 = change1.hash().unwrap();
666 let hash2 = change2.hash().unwrap();
667
668 store.insert(hash1, change1);
669 store.insert(hash2, change2);
670
671 let hashes = store.hashes();
672 assert_eq!(hashes.len(), 2);
673 assert!(hashes.contains(&hash1));
674 assert!(hashes.contains(&hash2));
675 }
676
677 #[test]
678 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