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

Function test_remove

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

Source from the content-addressed store, hash-verified

618
619 #[test]
620 fn test_remove() {
621 let store = MemoryChangeStore::new();
622 let change = create_test_change("To remove", b"bye");
623 let hash = change.hash().unwrap();
624
625 store.insert(hash, change);
626 assert!(store.has_change(&hash));
627
628 let removed = store.remove(&hash);
629 assert!(removed.is_some());
630 assert!(!store.has_change(&hash));
631 assert!(store.is_empty());
632 }
633
634 #[test]
635 fn test_remove_nonexistent() {

Callers

nothing calls this directly

Calls 5

create_test_changeFunction · 0.70
removeMethod · 0.65
unwrapMethod · 0.45
hashMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected