diff options
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ref.rs | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/tests/ref.rs b/tests/ref.rs index 98f1ed4a..7a78ec73 100644 --- a/tests/ref.rs +++ b/tests/ref.rs @@ -7,9 +7,11 @@ use std::path::Path; use alacritty::Grid; use alacritty::Term; +use alacritty::ansi; +use alacritty::index::{Line, Column}; use alacritty::term::Cell; use alacritty::term::SizeInfo; -use alacritty::ansi; +use alacritty::util::fmt::{Red, Green}; macro_rules! ref_tests { ($($name:ident)*) => { @@ -71,5 +73,19 @@ fn ref_test(dir: &Path) { parser.advance(&mut terminal, byte, &mut io::sink()); } + if grid != *terminal.grid() { + for (i, row) in terminal.grid().iter_rows().enumerate() { + for (j, cell) in row.iter().enumerate() { + let original_cell = &grid[Line(i)][Column(j)]; + if *original_cell != *cell { + println!("[{i}][{j}] {original:?} => {now:?}", + i=i, j=j, original=Green(original_cell), now=Red(cell)); + } + } + } + + panic!("Ref test failed; grid doesn't match"); + } + assert_eq!(grid, *terminal.grid()); } |