-
Notifications
You must be signed in to change notification settings - Fork 961
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
muxers: Add test harness for
StreamMuxer
implementations (#2952)
- Loading branch information
1 parent
981d586
commit 4d4833f
Showing
9 changed files
with
426 additions
and
305 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
use libp2p_mplex::MplexConfig; | ||
|
||
#[async_std::test] | ||
async fn close_implies_flush() { | ||
let (alice, bob) = | ||
libp2p_muxer_test_harness::connected_muxers_on_memory_transport::<MplexConfig, _, _>() | ||
.await; | ||
|
||
libp2p_muxer_test_harness::close_implies_flush(alice, bob).await; | ||
} | ||
|
||
#[async_std::test] | ||
async fn dialer_can_receive() { | ||
let (alice, bob) = | ||
libp2p_muxer_test_harness::connected_muxers_on_memory_transport::<MplexConfig, _, _>() | ||
.await; | ||
|
||
libp2p_muxer_test_harness::dialer_can_receive(alice, bob).await; | ||
} | ||
|
||
#[async_std::test] | ||
async fn read_after_close() { | ||
let (alice, bob) = | ||
libp2p_muxer_test_harness::connected_muxers_on_memory_transport::<MplexConfig, _, _>() | ||
.await; | ||
|
||
libp2p_muxer_test_harness::read_after_close(alice, bob).await; | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "libp2p-muxer-test-harness" | ||
version = "0.1.0" | ||
edition = "2021" | ||
publish = false | ||
license = "MIT" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[dependencies] | ||
libp2p-core = { path = "../../core" } | ||
futures = "0.3.24" | ||
log = "0.4" | ||
futures-timer = "3.0.2" |
Oops, something went wrong.