()
| 90 | |
| 91 | #[test] |
| 92 | fn drop_with_pop() { |
| 93 | use algo::common::drop::{self, Elem}; |
| 94 | drop::with(|ctx| { |
| 95 | let mut ll = LinkedList::default(); |
| 96 | ll.push_back(Elem); |
| 97 | ll.push_front(Elem); |
| 98 | ll.push_back(Elem); |
| 99 | ll.push_front(Elem); |
| 100 | |
| 101 | // do pop, and drop Elem |
| 102 | drop(ll.pop_front()); |
| 103 | drop(ll.pop_front()); |
| 104 | assert_eq!(2, ctx.get()); |
| 105 | |
| 106 | drop(ll); |
| 107 | assert_eq!(4, ctx.get()); |
| 108 | }); |
| 109 | } |
| 110 | |
| 111 | fn create_ll<T>(data: &[T]) -> LinkedList<T> |
| 112 | where |
nothing calls this directly
no test coverage detected