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

Function test_insert_and_get

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

Source from the content-addressed store, hash-verified

592
593 #[test]
594 fn test_insert_and_get() {
595 let store = MemoryChangeStore::new();
596 let change = create_test_change("Test", b"content");
597 let hash = change.hash().unwrap();
598
599 store.insert(hash, change.clone());
600
601 assert!(!store.is_empty());
602 assert_eq!(store.len(), 1);
603 assert!(store.has_change(&hash));
604
605 let loaded = store.get_change(&hash).unwrap();
606 assert_eq!(loaded.message(), "Test");
607 }
608
609 #[test]
610 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