// Copyright 2024 The ChromiumOS Authors1// Use of this source code is governed by a BSD-style license that can be2// found in the LICENSE file.34#[cfg(test)]5mod tests {6use base::Tube;78use crate::TubeTokio;910#[tokio::test]11async fn recv_send() {12let (a, b) = Tube::pair().unwrap();13let mut b = TubeTokio::new(b).unwrap();1415let blocking_task = tokio::task::spawn_blocking(move || {16a.send(&5u8).unwrap();17a.recv::<u8>().unwrap()18});1920assert_eq!(b.recv::<u8>().await.unwrap(), 5u8);21b.send(&16u8).await.unwrap();22assert_eq!(blocking_task.await.unwrap(), 16u8);23}24}252627