diff options
author | Joe Wilm <joe@jwilm.com> | 2016-07-29 18:01:10 -0700 |
---|---|---|
committer | Joe Wilm <joe@jwilm.com> | 2016-07-29 18:01:10 -0700 |
commit | 970421fd0055a03f215efeb142b60e5cb29ef379 (patch) | |
tree | ef1f60ac388a01099bdec2830fda514c898fd968 /src/ansi.rs | |
parent | 3426f4a1a9394af01fe7c6319df5c4e1240f8a1f (diff) | |
download | alacritty-970421fd0055a03f215efeb142b60e5cb29ef379.tar.gz alacritty-970421fd0055a03f215efeb142b60e5cb29ef379.zip |
Fix tests in ansi
Switched to vendored Utf8Chars.
Diffstat (limited to 'src/ansi.rs')
-rw-r--r-- | src/ansi.rs | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/src/ansi.rs b/src/ansi.rs index 46f0b638..3df4cd34 100644 --- a/src/ansi.rs +++ b/src/ansi.rs @@ -1067,12 +1067,13 @@ impl Default for State { } } -/// Tests for parsing escape sequences -/// -/// Byte sequences used in these tests are recording of pty stdout. +// Tests for parsing escape sequences +// +// Byte sequences used in these tests are recording of pty stdout. #[cfg(test)] mod tests { - use std::io::{Cursor, Read}; + use std::io::{Read}; + use io::Utf8Chars; use index::{Line, Column}; use super::{Parser, Handler, Attr, TermInfo}; use ::Rgb; @@ -1104,11 +1105,10 @@ mod tests { 0x1b, 0x5b, 0x31, 0x6d ]; - let cursor = Cursor::new(BYTES); let mut parser = Parser::new(); let mut handler = AttrHandler::default(); - for c in cursor.chars() { + for c in Utf8Chars::new(&BYTES[..]) { parser.advance(&mut handler, c.unwrap()); } @@ -1122,11 +1122,10 @@ mod tests { 0x38, 0x3b, 0x36, 0x36, 0x3b, 0x32, 0x35, 0x35, 0x6d ]; - let cursor = Cursor::new(BYTES); let mut parser = Parser::new(); let mut handler = AttrHandler::default(); - for c in cursor.chars() { + for c in Utf8Chars::new(&BYTES[..]) { parser.advance(&mut handler, c.unwrap()); } @@ -1158,11 +1157,10 @@ mod tests { 0x6f, 0x64, 0x65 ]; - let cursor = Cursor::new(BYTES); let mut handler = AttrHandler::default(); let mut parser = Parser::new(); - for c in cursor.chars() { + for c in Utf8Chars::new(&BYTES[..]) { parser.advance(&mut handler, c.unwrap()); } } |