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

Function test_knows

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

Source from the content-addressed store, hash-verified

761
762 #[test]
763 fn test_knows() {
764 let store = MemoryChangeStore::new();
765
766 let known_hash = Hash::of(b"known");
767 let extra_hash = Hash::of(b"extra");
768 let unknown_hash = Hash::of(b"unknown");
769
770 let mut change = Change::empty(ChangeHeader::new("Knows test"));
771 change.hashed.dependencies = vec![known_hash];
772 change.hashed.extra_known = vec![extra_hash];
773
774 let hash = change.hash().unwrap();
775 store.insert(hash, change);
776
777 assert!(store.knows(&hash, &known_hash).unwrap());
778 assert!(store.knows(&hash, &extra_hash).unwrap());
779 assert!(!store.knows(&hash, &unknown_hash).unwrap());
780 }
781
782 // ------------------------------------------------------------------------
783 // 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