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

Function drop_with_delete

tests/test_rb_tree2.rs:137–153  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 3

withFunction · 0.85
insertMethod · 0.45
deleteMethod · 0.45

Tested by

no test coverage detected