pub struct TestChild { /* private fields */ }Expand description
The test’s side of the stand-in from LiveChild::for_tests: it plays the program.
Lines it says reach the application through
DetachedHandoff::on_line at the harness’s next step, such
as Harness::render; lines said before the handoff was answered
wait for it, as they would in a pipe.
Implementations§
Source§impl TestChild
impl TestChild
Sourcepub fn say(&self, line: impl Into<String>)
pub fn say(&self, line: impl Into<String>)
The program writes line on its standard output. Nothing is said after it ended.
Sourcepub fn exit(&self, code: Option<i32>)
pub fn exit(&self, code: Option<i32>)
The program ends with code (None for a signal): LiveChild::try_wait reports it
and ChildLine::Ended is delivered. Only the first end counts.
Sourcepub fn written(&self) -> Vec<String>
pub fn written(&self) -> Vec<String>
Every line the application wrote with LiveChild::write_line, oldest first.
Sourcepub fn stdin_open(&self) -> bool
pub fn stdin_open(&self) -> bool
Whether the program’s standard input is still open: false after
LiveChild::close_stdin and once every LiveChild clone was dropped.
Sourcepub fn killed(&self) -> bool
pub fn killed(&self) -> bool
Whether the application called LiveChild::kill.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TestChild
impl RefUnwindSafe for TestChild
impl Send for TestChild
impl Sync for TestChild
impl Unpin for TestChild
impl UnsafeUnpin for TestChild
impl UnwindSafe for TestChild
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more