diff options
author | Joe Wilm <joe@jwilm.com> | 2016-12-04 15:48:30 -0800 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-12-11 20:23:41 -0800 |
commit | ed48d08c0398d5905398d48575884a0226e10dc1 (patch) | |
tree | b9b43167887f3d5ca47f13c359899520bfc8ae4a /tests | |
parent | 61c1e37c4652e3668546f4d332d31f24a8eea7bb (diff) | |
download | alacritty-ed48d08c0398d5905398d48575884a0226e10dc1.tar.gz alacritty-ed48d08c0398d5905398d48575884a0226e10dc1.zip |
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')
-rw-r--r-- | tests/ref.rs | 17 |
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()); |