summaryrefslogtreecommitdiffstats
path: root/tests/ref.rs
diff options
context:
space:
mode:
authorJoe Wilm <joe@jwilm.com>2016-12-04 15:48:30 -0800
committerJoe Wilm <joe@jwilm.com>2016-12-11 20:23:41 -0800
commited48d08c0398d5905398d48575884a0226e10dc1 (patch)
treeb9b43167887f3d5ca47f13c359899520bfc8ae4a /tests/ref.rs
parent61c1e37c4652e3668546f4d332d31f24a8eea7bb (diff)
Implement Handler::identify_terminal for Term
The identify_terminal function signature had to change to support writing to the terminal before processing additional input.
Diffstat (limited to 'tests/ref.rs')
-rw-r--r--tests/ref.rs17
1 files changed, 15 insertions, 2 deletions
diff --git a/tests/ref.rs b/tests/ref.rs
index 2859dba1..6fe4c665 100644
--- a/tests/ref.rs
+++ b/tests/ref.rs
@@ -4,7 +4,7 @@ extern crate serde_json;
/// ref tests
mod reference {
use std::fs::File;
- use std::io::Read;
+ use std::io::{self, Read};
use std::path::Path;
use serde_json as json;
@@ -15,6 +15,19 @@ mod reference {
use alacritty::term::SizeInfo;
use alacritty::ansi;
+ /// The /dev/null of io::Write
+ struct Void;
+
+ impl io::Write for Void {
+ fn write(&mut self, bytes: &[u8]) -> io::Result<usize> {
+ Ok(bytes.len())
+ }
+
+ fn flush(&mut self) -> io::Result<()> {
+ Ok(())
+ }
+ }
+
macro_rules! ref_file {
($ref_name:ident, $file:expr) => {
concat!(
@@ -59,7 +72,7 @@ mod reference {
let mut parser = ansi::Processor::new();
for byte in recording {
- parser.advance(&mut terminal, byte);
+ parser.advance(&mut terminal, byte, &mut Void);
}
assert_eq!(grid, *terminal.grid());