From aeb22593a4f519cfae3af120884baa8073d07ba3 Mon Sep 17 00:00:00 2001 From: Steven Fackler Date: Wed, 11 Jan 2023 13:54:33 -0500 Subject: [PATCH] fix wasm build --- tokio/tests/sync_broadcast.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tokio/tests/sync_broadcast.rs b/tokio/tests/sync_broadcast.rs index 9eb2b1701b0..8028b645837 100644 --- a/tokio/tests/sync_broadcast.rs +++ b/tokio/tests/sync_broadcast.rs @@ -2,7 +2,7 @@ #![warn(rust_2018_idioms)] #![cfg(feature = "sync")] -#[cfg(tokio_wasm_not_wasi)] +#[cfg(any(not(tokio_wasm), tokio_wasi))] use wasm_bindgen_test::wasm_bindgen_test as test; use tokio::sync::broadcast; @@ -11,6 +11,7 @@ use tokio_test::{ assert_err, assert_ok, assert_pending, assert_ready, assert_ready_err, assert_ready_ok, }; +#[cfg(tokio_wasm_not_wasi)] use rand::Rng; use std::sync::Arc; @@ -563,6 +564,7 @@ fn sender_len() { } #[test] +#[cfg(any(not(tokio_wasm), tokio_wasi))] fn sender_len_random() { let (tx, mut rx1) = broadcast::channel(16); let mut rx2 = tx.subscribe();