From: Alex Crichton Date: Mon, 23 Jun 2014 16:44:00 +0000 (-0700) Subject: Fix a red test X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~978 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=8901563c0be07be8cbbddfe2676c78f54a4baf4f;p=cargo.git Fix a red test --- 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())); }); })