From 84f04ac0819e80c829db25f558b66843424f8c48 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Fri, 11 Mar 2022 21:02:24 -0500 Subject: use tokio::test --- tests/basic.rs | 6 ++---- tests/behavior.rs | 12 ++++-------- tests/pipe.rs | 3 +-- tests/split.rs | 9 +++------ tests/winch.rs | 3 +-- 5 files changed, 11 insertions(+), 22 deletions(-) diff --git a/tests/basic.rs b/tests/basic.rs index fd74463..f6faa2e 100644 --- a/tests/basic.rs +++ b/tests/basic.rs @@ -22,8 +22,7 @@ fn test_cat_blocking() { } #[cfg(feature = "async")] -#[tokio::main] -#[test] +#[tokio::test] async fn test_cat_async() { use futures::stream::StreamExt as _; use tokio::io::AsyncWriteExt as _; @@ -47,8 +46,7 @@ async fn test_cat_async() { } #[cfg(feature = "async")] -#[tokio::main] -#[test] +#[tokio::test] async fn test_yes_async() { use tokio::io::AsyncReadExt as _; diff --git a/tests/behavior.rs b/tests/behavior.rs index bb40e35..ee51cb4 100644 --- a/tests/behavior.rs +++ b/tests/behavior.rs @@ -29,8 +29,7 @@ fn test_multiple() { } #[cfg(feature = "async")] -#[tokio::main] -#[test] +#[tokio::test] async fn test_multiple_async() { use futures::stream::StreamExt as _; @@ -133,8 +132,7 @@ fn test_multiple_configured() { } #[cfg(feature = "async")] -#[tokio::main] -#[test] +#[tokio::test] async fn test_multiple_configured_async() { use futures::stream::StreamExt as _; use std::os::unix::io::FromRawFd as _; @@ -245,8 +243,7 @@ fn test_controlling_terminal() { } #[cfg(feature = "async")] -#[tokio::main] -#[test] +#[tokio::test] async fn test_controlling_terminal_async() { use futures::stream::StreamExt as _; @@ -287,8 +284,7 @@ fn test_session_leader() { } #[cfg(feature = "async")] -#[tokio::main] -#[test] +#[tokio::test] async fn test_session_leader_async() { use futures::stream::StreamExt as _; diff --git a/tests/pipe.rs b/tests/pipe.rs index cbe42ad..c3d7b9f 100644 --- a/tests/pipe.rs +++ b/tests/pipe.rs @@ -60,8 +60,7 @@ fn test_pipe_blocking() { } #[cfg(feature = "async")] -#[tokio::main] -#[test] +#[tokio::test] async fn test_pipe_async() { use std::os::unix::io::FromRawFd as _; use tokio::io::AsyncReadExt as _; diff --git a/tests/split.rs b/tests/split.rs index fc9b9d0..4799c13 100644 --- a/tests/split.rs +++ b/tests/split.rs @@ -1,8 +1,7 @@ mod helpers; #[cfg(feature = "async")] -#[tokio::main] -#[test] +#[tokio::test] async fn test_split() { use futures::stream::StreamExt as _; use tokio::io::AsyncWriteExt as _; @@ -42,8 +41,7 @@ async fn test_split() { } #[cfg(feature = "async")] -#[tokio::main] -#[test] +#[tokio::test] async fn test_into_split() { use tokio::io::{AsyncBufReadExt as _, AsyncWriteExt as _}; @@ -111,8 +109,7 @@ async fn test_into_split() { } #[cfg(feature = "async")] -#[tokio::main] -#[test] +#[tokio::test] async fn test_into_split_error() { let pty1 = pty_process::Pty::new().unwrap(); let pty2 = pty_process::Pty::new().unwrap(); diff --git a/tests/winch.rs b/tests/winch.rs index 63455e9..ae3c1a4 100644 --- a/tests/winch.rs +++ b/tests/winch.rs @@ -27,8 +27,7 @@ fn test_winch_std() { } #[cfg(feature = "async")] -#[tokio::main] -#[test] +#[tokio::test] async fn test_winch_async() { use futures::stream::StreamExt as _; use tokio::io::AsyncWriteExt as _; -- cgit v1.2.3