//! Tests only: put stated answers in front of a spawned child's real [`OsChild`].
usesuper::OwnedChild;usecrate::os_process::fake::FakeProcess;implOwnedChild{/// Answer from the tables `script` gives a [`FakeProcess`] put over this child's own
/// [`OsChild`](crate::os_process::child::OsChild): a call a table has an answer for gets it, and
/// every other call, `os_handle` included, is the real one. The test keeps the returned fake to
/// read what the child asked of it.
pub(crate)fnscript_over(&mutself, script: impl FnOnce(FakeProcess) -> FakeProcess)-> FakeProcess{let real =std::mem::replace(&mutself.os,Box::new(FakeProcess::new([])));let fake =script(FakeProcess::over(real));self.os =Box::new(fake.clone());
fake
}}