From a4e926daeeaedc9178846711daf1f4cb6ce505fb Mon Sep 17 00:00:00 2001 From: Lzu Tao Date: Thu, 27 Aug 2020 13:45:01 +0000 Subject: std: move "mod tests/benches" to separate files Also doing fmt inplace as requested. --- library/std/src/io/stdio.rs | 54 +++------------------------------------------ 1 file changed, 3 insertions(+), 51 deletions(-) (limited to 'library/std/src/io/stdio.rs') diff --git a/library/std/src/io/stdio.rs b/library/std/src/io/stdio.rs index 3943c66aad5..9974b65f1e1 100644 --- a/library/std/src/io/stdio.rs +++ b/library/std/src/io/stdio.rs @@ -1,5 +1,8 @@ #![cfg_attr(test, allow(unused))] +#[cfg(test)] +mod tests; + use crate::io::prelude::*; use crate::cell::RefCell; @@ -920,54 +923,3 @@ pub fn _eprint(args: fmt::Arguments<'_>) { #[cfg(test)] pub use realstd::io::{_eprint, _print}; - -#[cfg(test)] -mod tests { - use super::*; - use crate::panic::{RefUnwindSafe, UnwindSafe}; - use crate::thread; - - #[test] - fn stdout_unwind_safe() { - assert_unwind_safe::(); - } - #[test] - fn stdoutlock_unwind_safe() { - assert_unwind_safe::>(); - assert_unwind_safe::>(); - } - #[test] - fn stderr_unwind_safe() { - assert_unwind_safe::(); - } - #[test] - fn stderrlock_unwind_safe() { - assert_unwind_safe::>(); - assert_unwind_safe::>(); - } - - fn assert_unwind_safe() {} - - #[test] - #[cfg_attr(target_os = "emscripten", ignore)] - fn panic_doesnt_poison() { - thread::spawn(|| { - let _a = stdin(); - let _a = _a.lock(); - let _a = stdout(); - let _a = _a.lock(); - let _a = stderr(); - let _a = _a.lock(); - panic!(); - }) - .join() - .unwrap_err(); - - let _a = stdin(); - let _a = _a.lock(); - let _a = stdout(); - let _a = _a.lock(); - let _a = stderr(); - let _a = _a.lock(); - } -} -- cgit 1.4.1-3-g733a5