pub enum Expect {
Success,
ExitCode(u8),
StdoutContains(&'static [&'static str]),
Json(&'static [&'static str]),
HttpReady(&'static str),
McpReady,
}Expand description
What an example’s run must show for the example to be true. Small on purpose: enough to prove that the command line printed in the documentation does what the documentation says, and no more. A new variant is a new kind of evidence, not a new test framework.
Variants§
Success
The command exits 0.
ExitCode(u8)
The command exits with exactly this code.
StdoutContains(&'static [&'static str])
The command exits 0 and its stdout contains every fragment.
Json(&'static [&'static str])
The command exits 0 and its stdout is one JSON document in which every JSON Pointer
resolves (RFC 6901, /registry/fingerprint).
HttpReady(&'static str)
A server: it starts, logs the address it bound, answers a GET on this path with a 2xx status, and exits 0 when it is asked to stop.
McpReady
The stdio MCP server: it starts, answers initialize and tools/list with JSON-RPC
frames on stdout and nothing else, and exits 0 at end of input.
Implementations§
Trait Implementations§
impl Copy for Expect
impl Eq for Expect
impl StructuralPartialEq for Expect
Auto Trait Implementations§
impl Freeze for Expect
impl RefUnwindSafe for Expect
impl Send for Expect
impl Sync for Expect
impl Unpin for Expect
impl UnsafeUnpin for Expect
impl UnwindSafe for Expect
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.