From f0486657754c485f8211c6d00f9bf5ba6953dd67 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Wed, 27 Apr 2016 01:01:35 -0400 Subject: process should actually take a byte array --- src/screen.rs | 2 +- tests/basic.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/screen.rs b/src/screen.rs index 69eb6f1..da96a6a 100644 --- a/src/screen.rs +++ b/src/screen.rs @@ -34,7 +34,7 @@ impl Screen { unsafe { ffi::vt100_screen_set_scrollback_length(screen_impl, rows) }; } - pub fn process(&mut self, s: &str) -> u64 { + pub fn process(&mut self, s: &[u8]) -> u64 { let Screen(screen_impl) = *self; unsafe { ffi::vt100_screen_process_string( diff --git a/tests/basic.rs b/tests/basic.rs index ec3a8d7..7312928 100644 --- a/tests/basic.rs +++ b/tests/basic.rs @@ -10,7 +10,7 @@ mod tests { assert_eq!(screen.rows(), 24); assert_eq!(screen.cols(), 80); - let input = "foo\x1b[31m\x1b[32mb\x1b[3;7;42ma\x1b[23mr"; + let input = b"foo\x1b[31m\x1b[32mb\x1b[3;7;42ma\x1b[23mr"; screen.process(input); assert_eq!(screen.window_contents(0, 0, 0, 50), "foobar\n"); } -- cgit v1.2.3