rust-libp2p/muxers/mplex/tests/compliance.rs
Thomas Eizinger 35132c4ab6
refactor(muxer): replace MemoryTransport with futures_ringbuf
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.
2023-04-26 12:55:06 +00:00

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;
}