Utility to help test drop implementations


#1

Today I published my first crate: testdrop.

It is useful to help test drop implementations of objects that manages the lifetime of other objects, like smart pointers or containers. Here is a simple usage example:

extern crate testdrop;

use testdrop::TestDrop;
use std::rc::Rc;

let td = TestDrop::new();
let (id, item) = td.new_item();
let item = Rc::new(item);
let item_clone = item.clone();

// Decrease the reference counter, but do not drop.
drop(item_clone);
td.assert_no_drop(id);

// Decrease the reference counter and then drop.
drop(item);
td.assert_drop(id);

Comments are most welcome!