Add test that exercises ReentrantMutex
This commit is contained in:
parent
765050f302
commit
dca83d73cb
2 changed files with 19 additions and 0 deletions
17
tests/run-pass/reentrant-println.rs
Normal file
17
tests/run-pass/reentrant-println.rs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
use std::fmt::{Display, Error, Formatter};
|
||||
|
||||
// This test case exercises std::sys_common::remutex::ReentrantMutex
|
||||
// by calling println!() from inside fmt
|
||||
|
||||
struct InterruptingCow();
|
||||
|
||||
impl Display for InterruptingCow {
|
||||
fn fmt(&self, _f: &mut Formatter<'_>) -> Result<(), Error> {
|
||||
println!("Moo");
|
||||
Ok(())
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
println!("\"Knock knock\" \"Who's {} there?\"", InterruptingCow());
|
||||
}
|
||||
2
tests/run-pass/reentrant-println.stdout
Normal file
2
tests/run-pass/reentrant-println.stdout
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
"Knock knock" "Who's Moo
|
||||
there?"
|
||||
Loading…
Add table
Add a link
Reference in a new issue