Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/routes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use std::sync::{
};

use bytes::BytesMut;
use rstest::rstest;
use wireframe::{
Serializer,
app::WireframeApp,
Expand All @@ -24,6 +25,7 @@ struct TestEnvelope {
#[derive(bincode::Encode, bincode::BorrowDecode, PartialEq, Debug)]
struct Echo(u8);

#[rstest]
#[tokio::test]
async fn handler_receives_message_and_echoes_response() {
let called = Arc::new(AtomicUsize::new(0));
Expand Down
10 changes: 9 additions & 1 deletion tests/util.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use rstest::fixture;
use tokio::io::{self, AsyncReadExt, AsyncWriteExt, duplex};
use wireframe::app::WireframeApp;
use wireframe::{app::WireframeApp, frame::LengthPrefixedProcessor};

/// Feed a single frame into `app` and collect the response bytes.
///
Expand All @@ -13,6 +14,13 @@ use wireframe::app::WireframeApp;
/// Optional duplex buffer capacity for `run_app_with_frame`.
const DEFAULT_CAPACITY: usize = 4096;

/// Create a default length-prefixed frame processor for tests.
#[fixture]
#[rustfmt::skip]
pub fn processor() -> LengthPrefixedProcessor {
LengthPrefixedProcessor::default()
}

/// Run `app` with a single input `frame` using the default buffer capacity.
///
/// # Errors
Expand Down