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

Function test_knows

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

Source from the content-addressed store, hash-verified

785
786 #[test]
787 fn test_knows() {
788 let store = MemoryChangeStore::new();
789
790 let known_hash = Hash::of(b"known");
791 let extra_hash = Hash::of(b"extra");
792 let unknown_hash = Hash::of(b"unknown");
793
794 let mut change = Change::empty(ChangeHeader::new("Knows test"));
795 change.hashed.dependencies = vec![known_hash];
796 change.hashed.extra_known = vec![extra_hash];
797
798 let hash = change.hash().unwrap();
799 store.insert(hash, change);
800
801 assert!(store.knows(&hash, &known_hash).unwrap());
802 assert!(store.knows(&hash, &extra_hash).unwrap());
803 assert!(!store.knows(&hash, &unknown_hash).unwrap());
804 }
805
806 // ------------------------------------------------------------------------
807 // Content Retrieval Tests

Callers

nothing calls this directly

Calls 3

unwrapMethod · 0.45
hashMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected