mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-05-28 18:21:20 +00:00
Instead of relying on the `MemoryTransport` to provide us with a duplex stream, we use the `futures_ringbuf` crate. This saves us several lines of code and removes the dependency on `libp2p_core::upgrade::apply`. Related #3748. Pull-Request: #3772.
20 lines
557 B
Rust
20 lines
557 B
Rust
use libp2p_mplex::MplexConfig;
|
|
|
|
#[async_std::test]
|
|
async fn close_implies_flush() {
|
|
let (alice, bob) =
|
|
libp2p_muxer_test_harness::connected_muxers_on_memory_ring_buffer::<MplexConfig, _, _>()
|
|
.await;
|
|
|
|
libp2p_muxer_test_harness::close_implies_flush(alice, bob).await;
|
|
}
|
|
|
|
#[async_std::test]
|
|
async fn read_after_close() {
|
|
let (alice, bob) =
|
|
libp2p_muxer_test_harness::connected_muxers_on_memory_ring_buffer::<MplexConfig, _, _>()
|
|
.await;
|
|
|
|
libp2p_muxer_test_harness::read_after_close(alice, bob).await;
|
|
}
|