#drop #test #rc

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

#470 in Testing

Download history 55/week @ 2024-03-12 54/week @ 2024-03-19 57/week @ 2024-03-26 103/week @ 2024-04-02 37/week @ 2024-04-09 69/week @ 2024-04-16 75/week @ 2024-04-23 45/week @ 2024-04-30 45/week @ 2024-05-07 47/week @ 2024-05-14 41/week @ 2024-05-21 58/week @ 2024-05-28 36/week @ 2024-06-04 28/week @ 2024-06-11 47/week @ 2024-06-18 28/week @ 2024-06-25

147 downloads per month
Used in 8 crates

MIT/Apache

9KB
138 lines

Droptest

A small crate to help test drop implementation

Build Status Build status

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