diff --git a/tests/async_test.rs b/tests/async_test.rs index f8cd327..73c1b34 100644 --- a/tests/async_test.rs +++ b/tests/async_test.rs @@ -228,7 +228,7 @@ mod asyncs { }); list.push(c); } - r.close(); + r.close().unwrap(); for c in list { c.await.unwrap(); } @@ -255,7 +255,7 @@ mod asyncs { #[tokio::test] async fn recv_from_closed_channel() { let (tx, rx) = new::(Some(1)); - tx.close(); + tx.close().unwrap(); assert_eq!(rx.recv().await.err().unwrap(), ReceiveError::Closed); } @@ -263,7 +263,7 @@ mod asyncs { async fn recv_from_closed_channel_queue() { let (tx, rx) = new(Some(1)); tx.send(Box::new(1)).await.unwrap(); - tx.close(); + tx.close().unwrap(); // it's not possible to read data from queue of fully closed channel assert_eq!(rx.recv().await.err().unwrap(), ReceiveError::Closed); } @@ -281,7 +281,7 @@ mod asyncs { #[tokio::test] async fn send_to_closed_channel() { let (tx, rx) = new(Some(1)); - rx.close(); + rx.close().unwrap(); assert_eq!(tx.send(Box::new(1)).await.err().unwrap(), SendError::Closed); } @@ -304,7 +304,7 @@ mod asyncs { for c in list { c.abort(); } - r.close(); + r.close().unwrap(); } // Drop tests @@ -329,7 +329,7 @@ mod asyncs { } tokio::time::sleep(Duration::from_millis(500)).await; assert_eq!(counter.load(Ordering::SeqCst), 10_usize); - r.close(); + r.close().unwrap(); } #[tokio::test] @@ -349,7 +349,7 @@ mod asyncs { for c in list { c.await.unwrap(); } - r.close(); + r.close().unwrap(); assert_eq!(counter.load(Ordering::SeqCst), 10_usize); } @@ -362,14 +362,14 @@ mod asyncs { let counter = counter.clone(); drop(s.send(DropTester::new(counter, 1234))); } - r.close(); + r.close().unwrap(); assert_eq!(counter.load(Ordering::SeqCst), 10_usize); } #[tokio::test] async fn drop_test_send_to_closed() { let (s, r) = new(Some(10)); - r.close(); + r.close().unwrap(); let counter = Arc::new(AtomicUsize::new(0)); for _ in 0..10 { let counter = counter.clone(); diff --git a/tests/sync_test.rs b/tests/sync_test.rs index b8171b1..570d349 100644 --- a/tests/sync_test.rs +++ b/tests/sync_test.rs @@ -271,7 +271,7 @@ fn recv_from_half_closed_channel() { #[test] fn recv_from_closed_channel() { let (tx, rx) = new::(Some(1)); - tx.close(); + tx.close().unwrap(); assert_eq!(rx.recv().err().unwrap(), ReceiveError::Closed); } @@ -279,7 +279,7 @@ fn recv_from_closed_channel() { fn recv_from_closed_channel_queue() { let (tx, rx) = new(Some(1)); tx.send(Box::new(1)).unwrap(); - tx.close(); + tx.close().unwrap(); // it's not possible to read data from queue of fully closed channel assert_eq!(rx.recv().err().unwrap(), ReceiveError::Closed); } @@ -297,7 +297,7 @@ fn send_to_half_closed_channel() { #[test] fn send_to_closed_channel() { let (tx, rx) = new(Some(1)); - rx.close(); + rx.close().unwrap(); assert_eq!(tx.send(Box::new(1)).err().unwrap(), SendError::Closed); } @@ -316,7 +316,7 @@ fn drop_test_in_queue() { for _ in 0..10 { s.send(DropTester::new(counter.clone(), 1234)).unwrap(); } - r.close(); + r.close().unwrap(); assert_eq!(counter.load(Ordering::SeqCst), 10_usize); } @@ -324,7 +324,7 @@ fn drop_test_in_queue() { fn drop_test_send_to_closed() { let counter = Arc::new(AtomicUsize::new(0)); let (s, r) = new(Some(10)); - r.close(); + r.close().unwrap(); for _ in 0..10 { // will fail let _ = s.send(DropTester::new(counter.clone(), 1234)); @@ -360,7 +360,7 @@ fn drop_test_in_signal() { list.push(t); } std::thread::sleep(Duration::from_millis(1000)); - r.close(); + r.close().unwrap(); for t in list { t.join().unwrap(); }