From 37f25e563499399c7645bcffb6f4e47bba749514 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sun, 5 Dec 2021 21:55:56 -0500 Subject: add a binary to test vt100 state against a real terminal --- tests/helpers/mod.rs | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'tests') diff --git a/tests/helpers/mod.rs b/tests/helpers/mod.rs index c671684..a7eaadc 100644 --- a/tests/helpers/mod.rs +++ b/tests/helpers/mod.rs @@ -2,12 +2,20 @@ mod fixtures; pub use fixtures::fixture; pub use fixtures::FixtureScreen; +pub static mut QUIET: bool = false; + macro_rules! is { ($got:expr, $expected:expr) => { if ($got) != ($expected) { - eprintln!("{} != {}:", stringify!($got), stringify!($expected)); - eprintln!(" got: {:?}", $got); - eprintln!("expected: {:?}", $expected); + if !unsafe { QUIET } { + eprintln!( + "{} != {}:", + stringify!($got), + stringify!($expected) + ); + eprintln!(" got: {:?}", $got); + eprintln!("expected: {:?}", $expected); + } return false; } }; @@ -15,7 +23,9 @@ macro_rules! is { macro_rules! ok { ($e:expr) => { if !($e) { - eprintln!("!{}", stringify!($e)); + if !unsafe { QUIET } { + eprintln!("!{}", stringify!($e)); + } return false; } }; -- cgit v1.2.3-54-g00ecf