pub mod common;
use std::{cell::Cell, num::NonZero, ptr::NonNull};
use common::thread::Completed;
use dope_sys::thread;
#[test]
fn destruction_joins() {
let attrs = thread::raw::Attrs::with_stack(
NonZero::new(thread::STACK_MIN).expect("native stack minimum"),
)
.expect("thread attributes");
let mut done = Completed(Cell::new(false));
unsafe { attrs.spawn(NonNull::from(&mut done)) }.expect("native worker");
assert!(done.0.get());
}