[−][src]Struct unsegen::base::terminal::test::FakeTerminal
A fake terminal that can be used in tests to create windows and compare the resulting contents to the expected contents of windows.
Implementations
impl FakeTerminal
[src]
pub fn with_size((w, h): (u32, u32)) -> Self
[src]
Create a window with the specified (width, height).
pub fn from_str(
(w, h): (u32, u32),
description: &str
) -> Result<Self, ShapeError>
[src]
(w, h): (u32, u32),
description: &str
) -> Result<Self, ShapeError>
Create a fake terminal from a format string that looks roughly like this:
"1 1 2 2 3 3 4 4"
Spaces and newlines are ignored and the string is coerced into the specified size.
pub fn assert_looks_like(&self, string_description: &str)
[src]
Test if the terminal contents look like the given format string. The rows are separated by a "|".
Examples:
use unsegen::base::terminal::test::FakeTerminal; use unsegen::base::GraphemeCluster; let mut term = FakeTerminal::with_size((2,3)); { let mut win = term.create_root_window(); win.fill(GraphemeCluster::try_from('_').unwrap()); } term.assert_looks_like("__|__|__");
pub fn create_root_window(&mut self) -> Window<'_>
[src]
Create a root window that covers the whole terminal grid.
Trait Implementations
impl Debug for FakeTerminal
[src]
impl PartialEq<FakeTerminal> for FakeTerminal
[src]
fn eq(&self, other: &FakeTerminal) -> bool
[src]
fn ne(&self, other: &FakeTerminal) -> bool
[src]
impl StructuralPartialEq for FakeTerminal
[src]
Auto Trait Implementations
impl RefUnwindSafe for FakeTerminal
impl Send for FakeTerminal
impl Sync for FakeTerminal
impl Unpin for FakeTerminal
impl UnwindSafe for FakeTerminal
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,