display/testutil/mod.rs
1//! Utilities for writing tests that interact with the display.
2mod mockable_tui;
3mod mockcrossterm;
4mod state;
5
6pub use self::{
7 mockable_tui::{create_unexpected_error, MockableTui},
8 mockcrossterm::CrossTerm,
9 state::State,
10};
11use crate::Display;
12
13/// Assert the the content of the Display is an expected value.
14///
15/// # Panics
16///
17/// Will panic is the expected output does not match the rendered output.
18#[inline]
19#[allow(clippy::missing_assert_message)] // not sure why this is triggering
20pub fn assert_output(display: &Display<CrossTerm>, expected: &[&str]) {
21 assert_eq!(display.tui.get_output().join(""), format!("{}\n", expected.join("\n")));
22}