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

Function test_has_contents

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

Source from the content-addressed store, hash-verified

715
716 #[test]
717 fn test_has_contents() {
718 let store = MemoryChangeStore::new();
719
720 // Change with content
721 let with_content = create_test_change("Has content", b"data");
722 let hash1 = with_content.hash().unwrap();
723 store.insert(hash1, with_content);
724
725 // Change without content
726 let without_content = create_test_change("No content", b"");
727 let hash2 = without_content.hash().unwrap();
728 store.insert(hash2, without_content);
729
730 assert!(store.has_contents(&hash1));
731 assert!(!store.has_contents(&hash2));
732 assert!(!store.has_contents(&Hash::of(b"nonexistent")));
733 }
734
735 #[test]
736 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