pub struct TestOutput { /* private fields */ }Expand description
Test output buffer that captures all output for assertions.
Implementations§
Source§impl TestOutput
impl TestOutput
Sourcepub fn new(mode: OutputMode) -> Self
pub fn new(mode: OutputMode) -> Self
Create a new test output buffer with specified mode.
Sourcepub fn with_width(mode: OutputMode, width: usize) -> Self
pub fn with_width(mode: OutputMode, width: usize) -> Self
Create with custom terminal width for width-dependent tests.
Sourcepub const fn mode(&self) -> OutputMode
pub const fn mode(&self) -> OutputMode
Get the current output mode.
Sourcepub const fn terminal_width(&self) -> usize
pub const fn terminal_width(&self) -> usize
Get configured terminal width.
Sourcepub fn push(&self, entry: OutputEntry)
pub fn push(&self, entry: OutputEntry)
Add an entry to the buffer (called by RichOutput facade).
Sourcepub fn captured(&self) -> String
pub fn captured(&self) -> String
Get all captured output as a single string (stripped of ANSI).
Sourcepub fn captured_raw(&self) -> String
pub fn captured_raw(&self) -> String
Get all captured output with ANSI codes preserved.
Sourcepub fn entries(&self) -> Vec<OutputEntry>
pub fn entries(&self) -> Vec<OutputEntry>
Get captured entries for detailed inspection.
Sourcepub fn count_by_level(&self, level: OutputLevel) -> usize
pub fn count_by_level(&self, level: OutputLevel) -> usize
Get count of entries by level.
Trait Implementations§
Source§impl Clone for TestOutput
impl Clone for TestOutput
Source§fn clone(&self) -> TestOutput
fn clone(&self) -> TestOutput
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TestOutput
impl !RefUnwindSafe for TestOutput
impl !Send for TestOutput
impl !Sync for TestOutput
impl Unpin for TestOutput
impl UnsafeUnpin for TestOutput
impl !UnwindSafe for TestOutput
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
Mutably borrows from an owned value. Read more