pub struct TestBackend { /* private fields */ }Implementations§
Source§impl TestBackend
impl TestBackend
pub fn new(width: u32, height: u32) -> Self
Sourcepub fn render(&mut self, f: impl FnOnce(&mut Context))
pub fn render(&mut self, f: impl FnOnce(&mut Context))
Run a closure as if it were one frame, render to internal buffer
Sourcepub fn render_with_events(
&mut self,
events: Vec<Event>,
focus_index: usize,
prev_focus_count: usize,
f: impl FnOnce(&mut Context),
)
pub fn render_with_events( &mut self, events: Vec<Event>, focus_index: usize, prev_focus_count: usize, f: impl FnOnce(&mut Context), )
Render with specific events (for testing keyboard/mouse interaction)
pub fn run_with_events( &mut self, events: Vec<Event>, f: impl FnOnce(&mut Context), )
Sourcepub fn line(&self, y: u32) -> String
pub fn line(&self, y: u32) -> String
Get the rendered text content of row y (trimmed trailing spaces)
Sourcepub fn assert_line(&self, y: u32, expected: &str)
pub fn assert_line(&self, y: u32, expected: &str)
Assert that row y contains expected as a substring
Sourcepub fn assert_line_contains(&self, y: u32, expected: &str)
pub fn assert_line_contains(&self, y: u32, expected: &str)
Assert that row y contains expected as a substring
Sourcepub fn assert_contains(&self, expected: &str)
pub fn assert_contains(&self, expected: &str)
Assert that any line in the buffer contains expected
pub fn buffer(&self) -> &Buffer
pub fn width(&self) -> u32
pub fn height(&self) -> u32
Auto Trait Implementations§
impl Freeze for TestBackend
impl RefUnwindSafe for TestBackend
impl Send for TestBackend
impl Sync for TestBackend
impl Unpin for TestBackend
impl UnsafeUnpin for TestBackend
impl UnwindSafe for TestBackend
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