use super::teardown::{fake, PID};
use crate::child::owned::slot::ChildSlot;
use crate::child::owned::OwnedChild;
use crate::elevation::front::TrackedKind;
fn slot() -> ChildSlot {
ChildSlot::new(OwnedChild::new(Box::new(fake()), TrackedKind::Own))
}
#[skuld::test]
fn the_child_comes_out_once() {
let mut slot = slot();
assert_eq!(slot.pid(), Some(PID));
assert!(slot.take().is_some());
assert!(slot.take().is_none());
}
#[skuld::test]
#[should_panic(expected = "taken out of its slot")]
fn a_slot_that_gave_its_child_up_panics_on_use() {
let mut slot = slot();
drop(slot.take());
_ = slot.pid();
}