use crate::ArcShift;
#[test]
#[should_panic(expected = "panic: B")]
#[cfg(not(all(miri, feature = "nostd_unchecked_panics")))] fn simple_panic() {
struct PanicOnDrop(char);
impl Drop for PanicOnDrop {
fn drop(&mut self) {
if self.0 == 'B' {
panic!("panic: {}", self.0)
}
}
}
let a = ArcShift::new(alloc::boxed::Box::new(PanicOnDrop('A')));
let mut b = a.clone();
b.update(alloc::boxed::Box::new(PanicOnDrop('B')));
drop(b); drop(a); }
#[test]
fn smoke_test() {
let mut x = ArcShift::new(45u64);
x.update(46);
x.rcu(|x| *x + 1);
assert_eq!(*x.get(), 47);
}