summaryrefslogtreecommitdiffstats
path: root/src/display/testutil.rs
blob: 2c986dd72ae5574dff7be8536e2517f901e30381 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//! Utilities for writing tests that interact with the display.
mod mockable_tui;
mod mockcrossterm;
mod state;

pub(crate) use self::{
	mockable_tui::{create_unexpected_error, MockableTui},
	mockcrossterm::CrossTerm,
	state::State,
};
use crate::display::Display;

/// Assert the the content of the Display is an expected value.
///
/// # Panics
///
/// Will panic is the expected output does not match the rendered output.
#[allow(clippy::missing_assert_message)] // not sure why this is triggering
pub(crate) fn assert_output(display: &Display<CrossTerm>, expected: &[&str]) {
	assert_eq!(display.tui.get_output().join(""), format!("{}\n", expected.join("\n")));
}