Skip to content

Commit 204adc9

Browse files
committed
2 parents cf29aa5 + c9168cc commit 204adc9

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/libtest/lib.rs

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -506,16 +506,25 @@ impl<T: Writer> ConsoleTestState<T> {
506506
if self.use_color {
507507
try!(term.reset());
508508
}
509-
Ok(())
509+
term.flush()
510+
}
511+
Raw(ref mut stdout) => {
512+
try!(stdout.write_all(word.as_bytes()));
513+
stdout.flush()
510514
}
511-
Raw(ref mut stdout) => stdout.write_all(word.as_bytes())
512515
}
513516
}
514517

515518
pub fn write_plain(&mut self, s: &str) -> old_io::IoResult<()> {
516519
match self.out {
517-
Pretty(ref mut term) => term.write_all(s.as_bytes()),
518-
Raw(ref mut stdout) => stdout.write_all(s.as_bytes())
520+
Pretty(ref mut term) => {
521+
try!(term.write_all(s.as_bytes()));
522+
term.flush()
523+
},
524+
Raw(ref mut stdout) => {
525+
try!(stdout.write_all(s.as_bytes()));
526+
stdout.flush()
527+
},
519528
}
520529
}
521530

0 commit comments

Comments
 (0)