提交 c9168cca 编写于 作者: J Julian Orth

libtest: flush output after every write

Useful for debugging tests that hang forever.
上级 41f8b1e8
......@@ -506,16 +506,25 @@ pub fn write_pretty(&mut self,
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()
},
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册