diff options
author | Christian Duerr <chrisduerr@users.noreply.github.com> | 2018-12-08 01:50:01 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-08 01:50:01 +0000 |
commit | 6b61e967390b2fa4a24f962c4771cdd82e0e9de3 (patch) | |
tree | dae938e6be436ebc0f87b8e80eb43e690f4ae6ff /tests | |
parent | a6764ba05fee785186166c0710b08eb2a5ae302c (diff) | |
download | alacritty-6b61e967390b2fa4a24f962c4771cdd82e0e9de3.tar.gz alacritty-6b61e967390b2fa4a24f962c4771cdd82e0e9de3.zip |
Fix recording of ref tests
Due to the lazy initialization of lines in the Alacritty history, the
recording of ref tests was broken. Because a WM would often resize the
ref test window after it was spawned, some additional lines were
initialized in the stored ref test.
To make sure lazy initialization does not play any role in the recording
and replaying of reftests, before recording and replaying the tests, the
complete grid is initialized and then truncated. This should make sure
that only the relevant lines are kept.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/ref.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tests/ref.rs b/tests/ref.rs index 74cac6fa..0e059670 100644 --- a/tests/ref.rs +++ b/tests/ref.rs @@ -99,12 +99,13 @@ fn ref_test(dir: &Path) { // Truncate invisible lines from the grid let mut term_grid = terminal.grid().clone(); + term_grid.initialize_all(&Cell::default()); term_grid.truncate(); if grid != term_grid { for i in 0..grid.len() { for j in 0..grid.num_cols().0 { - let cell = terminal.grid()[i][Column(j)]; + let cell = term_grid[i][Column(j)]; let original_cell = grid[i][Column(j)]; if original_cell != cell { println!("[{i}][{j}] {original:?} => {now:?}", |