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

Function test_remove

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

Source from the content-addressed store, hash-verified

642
643 #[test]
644 fn test_remove() {
645 let store = MemoryChangeStore::new();
646 let change = create_test_change("To remove", b"bye");
647 let hash = change.hash().unwrap();
648
649 store.insert(hash, change);
650 assert!(store.has_change(&hash));
651
652 let removed = store.remove(&hash);
653 assert!(removed.is_some());
654 assert!(!store.has_change(&hash));
655 assert!(store.is_empty());
656 }
657
658 #[test]
659 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