summaryrefslogtreecommitdiff
path: root/alacritty_terminal/tests
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2019-10-05 02:29:26 +0200
committerGitHub <noreply@github.com>2019-10-05 02:29:26 +0200
commit729eef0c933831bccfeac6a355bdb410787fbe5f (patch)
tree35cdf2e6427ad18bc53efbab4cab34a0af2054d7 /alacritty_terminal/tests
parentb0c6fdff763f7271506d26d7e768e6377fdc691b (diff)
downloadalacritty-729eef0c933831bccfeac6a355bdb410787fbe5f.tar.gz
alacritty-729eef0c933831bccfeac6a355bdb410787fbe5f.zip
Update to winit/glutin EventLoop 2.0
This takes the latest glutin master to port Alacritty to the EventLoop 2.0 rework. This changes a big part of the event loop handling by pushing the event loop in a separate thread from the renderer and running both in parallel. Fixes #2796. Fixes #2694. Fixes #2643. Fixes #2625. Fixes #2618. Fixes #2601. Fixes #2564. Fixes #2456. Fixes #2438. Fixes #2334. Fixes #2254. Fixes #2217. Fixes #1789. Fixes #1750. Fixes #1125.
Diffstat (limited to 'alacritty_terminal/tests')
-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 {