From 96f427a8b84129179e86f3914be8e4712a89f660 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Wed, 8 Jan 2025 14:08:41 +1100 Subject: [PATCH] units: Refactor Send/Sync api test The `api` test for types implementing `Send` and `Sync` is part of both C-SEND-SYNC and also C-GOOD-ERR (for error types). Refactor the Send/Sync tests in both `units` and `io` and improve comments. --- io/tests/api.rs | 6 +++--- units/tests/api.rs | 14 +++++++------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/io/tests/api.rs b/io/tests/api.rs index 426f427ad..608969c02 100644 --- a/io/tests/api.rs +++ b/io/tests/api.rs @@ -129,12 +129,12 @@ fn api_all_non_error_types_have_non_empty_debug() { assert!(!debug.is_empty()); } -// Types are `Send` and `Sync` where possible (C-SEND-SYNC). #[test] fn all_non_error_tyes_implement_send_sync() { fn assert_send() {} - assert_send::(); - fn assert_sync() {} + + // Types are `Send` and `Sync` where possible (C-SEND-SYNC). + assert_send::(); assert_sync::(); } diff --git a/units/tests/api.rs b/units/tests/api.rs index 63bdd7fe0..0fec691bd 100644 --- a/units/tests/api.rs +++ b/units/tests/api.rs @@ -221,16 +221,16 @@ fn api_all_non_error_types_have_non_empty_debug() { } #[test] -fn send() { +fn all_types_implement_send_sync() { fn assert_send() {} - assert_send::(); - assert_send::(); -} - -#[test] -fn sync() { fn assert_sync() {} + + // Types are `Send` and `Sync` where possible (C-SEND-SYNC). + assert_send::(); assert_sync::(); + + // Error types should implement the Send and Sync traits (C-GOOD-ERR). + assert_send::(); assert_sync::(); }