diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2015-02-27 11:44:40 +0530 |
|---|---|---|
| committer | Manish Goregaokar <manishsmail@gmail.com> | 2015-02-27 22:07:04 +0530 |
| commit | 204adc9ab83ff7ab4873fa5ee7bd58190799c538 (patch) | |
| tree | d05fad031f19a1c089fefeedea6c90b152f126a0 | |
| parent | cf29aa5300bd4b4a458242fa92f43a557755fef6 (diff) | |
| parent | c9168cca72105297a5d66dee0beb0bb192cb01ad (diff) | |
| download | rust-204adc9ab83ff7ab4873fa5ee7bd58190799c538.tar.gz rust-204adc9ab83ff7ab4873fa5ee7bd58190799c538.zip | |
Rollup merge of #22836 - mahkoh:testflush, r=huonw
See https://github.com/rust-lang/rust/blob/41f8b1e89b5ca0c79d7bca782ca44085624d4564/src/libtest/lib.rs#L783-L788
| -rw-r--r-- | src/libtest/lib.rs | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/libtest/lib.rs b/src/libtest/lib.rs index 82c1a4b1195..7c7f1fd478a 100644 --- a/src/libtest/lib.rs +++ b/src/libtest/lib.rs @@ -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() + }, } } |
