Add test that exercises ReentrantMutex

This commit is contained in:
David Cook 2020-02-20 22:19:51 -06:00
parent 765050f302
commit dca83d73cb
2 changed files with 19 additions and 0 deletions

View 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());
}

View File

@ -0,0 +1,2 @@
"Knock knock" "Who's Moo
there?"