use std::{cell::RefCell, vec::Vec};
use with_drop::{with_drop, WithDrop};
#[test]
fn test_drop_with() {
let drops = RefCell::new(Vec::new());
{
let mut a = WithDrop::new(23, |x| drops.borrow_mut().push(x));
let b = with_drop(32, |x| drops.borrow_mut().push(x));
let c = a.clone();
assert!(a != b);
assert!(a == c);
assert!(a < b);
assert!(b > a);
*a += 42;
assert!(*a == 65);
assert!(drops.borrow().is_empty());
};
assert!(*drops.borrow() == [23, 32, 65]);
}