Skip to content

Commit

Permalink
Fix RFC-1014 test
Browse files Browse the repository at this point in the history
Use two printlns when testing that writing to a closed stdout does not
panic. Otherwise the test is ineffective, since the current implementation
silently ignores the error during first println regardless.
  • Loading branch information
tmiasko committed Aug 15, 2020
1 parent 55b9adf commit fa8d396
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/test/ui/rfcs/rfc-1014-2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ fn close_stdout() {
#[cfg(windows)]
fn main() {
close_stdout();
println!("hello world");
println!("hello");
println!("world");
}

#[cfg(not(windows))]
Expand Down
3 changes: 2 additions & 1 deletion src/test/ui/rfcs/rfc-1014.rs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,6 @@ fn close_stdout() {

fn main() {
close_stdout();
println!("hello world");
println!("hello");
println!("world");
}

0 comments on commit fa8d396

Please sign in to comment.