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

Function test_clear

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

Source from the content-addressed store, hash-verified

666
667 #[test]
668 fn test_clear() {
669 let store = MemoryChangeStore::new();
670
671 for i in 0..5 {
672 let change = create_test_change(&format!("Change {}", i), &[i as u8]);
673 store.insert_change(change).unwrap();
674 }
675
676 assert_eq!(store.len(), 5);
677
678 store.clear();
679
680 assert!(store.is_empty());
681 assert_eq!(store.len(), 0);
682 }
683
684 #[test]
685 fn test_hashes() {

Callers

nothing calls this directly

Calls 4

create_test_changeFunction · 0.70
clearMethod · 0.65
unwrapMethod · 0.45
insert_changeMethod · 0.45

Tested by

no test coverage detected