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

Function test_insert_and_get

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

Source from the content-addressed store, hash-verified

616
617 #[test]
618 fn test_insert_and_get() {
619 let store = MemoryChangeStore::new();
620 let change = create_test_change("Test", b"content");
621 let hash = change.hash().unwrap();
622
623 store.insert(hash, change.clone());
624
625 assert!(!store.is_empty());
626 assert_eq!(store.len(), 1);
627 assert!(store.has_change(&hash));
628
629 let loaded = store.get_change(&hash).unwrap();
630 assert_eq!(loaded.message(), "Test");
631 }
632
633 #[test]
634 fn test_insert_change_computes_hash() {

Callers

nothing calls this directly

Calls 6

create_test_changeFunction · 0.70
unwrapMethod · 0.45
hashMethod · 0.45
insertMethod · 0.45
cloneMethod · 0.45
get_changeMethod · 0.45

Tested by

no test coverage detected