aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/tests/ref.rs
diff options
context:
space:
mode:
Diffstat (limited to 'alacritty_terminal/tests/ref.rs')
-rw-r--r--alacritty_terminal/tests/ref.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/alacritty_terminal/tests/ref.rs b/alacritty_terminal/tests/ref.rs
index b6efb6a8..1d59e700 100644
--- a/alacritty_terminal/tests/ref.rs
+++ b/alacritty_terminal/tests/ref.rs
@@ -1,5 +1,4 @@
-#[macro_use]
-extern crate serde_derive;
+use serde::Deserialize;
use serde_json as json;
use std::fs::File;
@@ -8,9 +7,9 @@ use std::path::Path;
use alacritty_terminal::ansi;
use alacritty_terminal::clipboard::Clipboard;
-use alacritty_terminal::config::Config;
+use alacritty_terminal::config::MockConfig;
+use alacritty_terminal::event::{Event, EventListener};
use alacritty_terminal::index::Column;
-use alacritty_terminal::message_bar::MessageBuffer;
use alacritty_terminal::term::cell::Cell;
use alacritty_terminal::term::SizeInfo;
use alacritty_terminal::Grid;
@@ -81,6 +80,11 @@ struct RefConfig {
history_size: u32,
}
+struct Mock;
+impl EventListener for Mock {
+ fn send_event(&self, _event: Event) {}
+}
+
fn ref_test(dir: &Path) {
let recording = read_u8(dir.join("alacritty.recording"));
let serialized_size = read_string(dir.join("size.json")).unwrap();
@@ -91,10 +95,10 @@ fn ref_test(dir: &Path) {
let grid: Grid<Cell> = json::from_str(&serialized_grid).unwrap();
let ref_config: RefConfig = json::from_str(&serialized_cfg).unwrap_or_default();
- let mut config: Config = Default::default();
+ let mut config = MockConfig::default();
config.scrolling.set_history(ref_config.history_size);
- let mut terminal = Term::new(&config, size, MessageBuffer::new(), Clipboard::new_nop());
+ let mut terminal = Term::new(&config, &size, Clipboard::new_nop(), Mock);
let mut parser = ansi::Processor::new();
for byte in recording {