#test #drop

dev testdrop

A utility to help test drop implementations

2 releases

Uses old Rust 2015

0.1.2 May 18, 2017
0.1.1 Oct 4, 2016
0.1.0 Oct 4, 2016

#318 in Testing

Download history 81/week @ 2022-08-11 35/week @ 2022-08-18 37/week @ 2022-08-25 54/week @ 2022-09-01 74/week @ 2022-09-08 37/week @ 2022-09-15 32/week @ 2022-09-22 83/week @ 2022-09-29 79/week @ 2022-10-06 21/week @ 2022-10-13 35/week @ 2022-10-20 71/week @ 2022-10-27 87/week @ 2022-11-03 73/week @ 2022-11-10 69/week @ 2022-11-17 17/week @ 2022-11-24

259 downloads per month
Used in fewer than 8 crates

MIT/Apache

9KB
138 lines

Droptest

A small crate to help test drop implementation

Build Status Build status Crates

Documentation

Example

Test if the std::rc::Rc drop implementation works.

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);

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

No runtime deps