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

Function test_has_contents

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

Source from the content-addressed store, hash-verified

739
740 #[test]
741 fn test_has_contents() {
742 let store = MemoryChangeStore::new();
743
744 // Change with content
745 let with_content = create_test_change("Has content", b"data");
746 let hash1 = with_content.hash().unwrap();
747 store.insert(hash1, with_content);
748
749 // Change without content
750 let without_content = create_test_change("No content", b"");
751 let hash2 = without_content.hash().unwrap();
752 store.insert(hash2, without_content);
753
754 assert!(store.has_contents(&hash1));
755 assert!(!store.has_contents(&hash2));
756 assert!(!store.has_contents(&Hash::of(b"nonexistent")));
757 }
758
759 #[test]
760 fn test_get_header() {

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected