aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2021-12-05 21:55:56 -0500
committerJesse Luehrs <doy@tozt.net>2021-12-06 01:17:49 -0500
commit37f25e563499399c7645bcffb6f4e47bba749514 (patch)
tree3b72a70b96e463036672069cf2103cb9b17654d5 /tests
parent2e7a43fd0f68f4469927a032f5f77a52b664d276 (diff)
downloadvt100-rust-37f25e563499399c7645bcffb6f4e47bba749514.tar.gz
vt100-rust-37f25e563499399c7645bcffb6f4e47bba749514.zip
add a binary to test vt100 state against a real terminal
Diffstat (limited to 'tests')
-rw-r--r--tests/helpers/mod.rs18
1 files changed, 14 insertions, 4 deletions
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;
}
};