From 8901563c0be07be8cbbddfe2676c78f54a4baf4f Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Mon, 23 Jun 2014 09:44:00 -0700 Subject: [PATCH] Fix a red test --- tests/test_shell.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/test_shell.rs b/tests/test_shell.rs index 6a83dd7aa..908ebaf39 100644 --- a/tests/test_shell.rs +++ b/tests/test_shell.rs @@ -34,12 +34,13 @@ test!(color_explicitly_disabled { test!(colored_shell { let config = ShellConfig { color: true, verbose: true, tty: true }; - let mut buf: Vec = Vec::from_elem(22, 0 as u8); + let mut buf: Vec = Vec::from_elem(100, 0 as u8); Shell::create(writer(buf.as_mut_slice()), config).tap(|shell| { shell.say("Hey Alex", color::RED).assert(); - assert_that(buf.as_slice(), shell_writes(colored_output("Hey Alex\n", - color::RED).assert())); + let buf = buf.as_slice().slice_to(buf.iter().position(|a| *a == 0).unwrap()); + assert_that(buf, shell_writes(colored_output("Hey Alex\n", + color::RED).assert())); }); }) -- 2.30.2