Rollup merge of #22836 - mahkoh:testflush, r=huonw

See 41f8b1e89b/src/libtest/lib.rs (L783-L788)
This commit is contained in:
Manish Goregaokar 2015-02-27 11:44:40 +05:30
commit 204adc9ab8

View file

@ -506,16 +506,25 @@ impl<T: Writer> ConsoleTestState<T> {
if self.use_color {
try!(term.reset());
}
Ok(())
term.flush()
}
Raw(ref mut stdout) => {
try!(stdout.write_all(word.as_bytes()));
stdout.flush()
}
Raw(ref mut stdout) => stdout.write_all(word.as_bytes())
}
}
pub fn write_plain(&mut self, s: &str) -> old_io::IoResult<()> {
match self.out {
Pretty(ref mut term) => term.write_all(s.as_bytes()),
Raw(ref mut stdout) => stdout.write_all(s.as_bytes())
Pretty(ref mut term) => {
try!(term.write_all(s.as_bytes()));
term.flush()
},
Raw(ref mut stdout) => {
try!(stdout.write_all(s.as_bytes()));
stdout.flush()
},
}
}