MCPcopy Create free account
hub / github.com/douchuan/algorithm / drop_with_delete

Function drop_with_delete

tests/test_bst_tree.rs:138–154  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

136
137#[test]
138fn drop_with_delete() {
139 use algo::common::drop::{self, Elem};
140 drop::with(|ctx| {
141 let mut tree = Tree::default();
142 for v in 0..100 {
143 tree.insert(v, Elem);
144 }
145
146 for v in 0..10 {
147 tree.delete(&v);
148 }
149 assert_eq!(10, ctx.get());
150
151 drop(tree);
152 assert_eq!(100, ctx.get());
153 });
154}

Callers

nothing calls this directly

Calls 3

withFunction · 0.85
insertMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected