From ed48d08c0398d5905398d48575884a0226e10dc1 Mon Sep 17 00:00:00 2001 From: Joe Wilm Date: Sun, 4 Dec 2016 15:48:30 -0800 Subject: Implement Handler::identify_terminal for Term The identify_terminal function signature had to change to support writing to the terminal before processing additional input. --- tests/ref.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'tests') 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 { + 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()); -- cgit