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
5 changes: 5 additions & 0 deletions tests/push.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@ async fn push_queues_error_on_closed() {
}

/// A push beyond the configured rate is blocked.
/// Time is paused using [`tokio::time::pause`], so the test runs in a
/// virtual-time context.
#[rstest]
#[case::high(PushPriority::High)]
#[case::low(PushPriority::Low)]
Expand Down Expand Up @@ -107,6 +109,8 @@ async fn rate_limiter_allows_after_wait() {
}

/// The limiter counts pushes from all priority queues.
/// The token bucket is shared, so pushes from one priority reduce
/// the allowance for the other.
#[tokio::test]
async fn rate_limiter_shared_across_priorities() {
time::pause();
Expand Down Expand Up @@ -142,6 +146,7 @@ async fn unlimited_queues_do_not_block() {
}

/// A burst up to capacity succeeds and further pushes are blocked.
/// The maximum burst size equals the configured `capacity` parameter.
#[tokio::test]
async fn rate_limiter_allows_burst_within_capacity_and_blocks_excess() {
time::pause();
Expand Down
4 changes: 3 additions & 1 deletion wireframe_testing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
//! with in-memory streams during tests.
//!
//! These helpers spawn the application on a `tokio::io::duplex` stream and
//! return all bytes written by the app for easy assertions.
//! return all bytes written by the app for easy assertions. They work with any
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue: The documentation now references bincode::Encode, which is not a real trait.

bincode::Encode is not a valid trait; bincode relies on serde::Serialize for encoding. Please update the reference to serde::Serialize to prevent confusion.

//! message implementing [`bincode::Encode`] – the example uses a simple `u8`
//! value so no generics are required.
//!
//! ```rust
//! use wireframe::app::WireframeApp;
Expand Down
4 changes: 2 additions & 2 deletions wireframe_testing/src/logging.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ impl LoggerHandle {
///
/// ```no_run
/// use wireframe_testing::LoggerHandle;
/// # use log::info;
/// # use log::warn;
///
/// let mut log = LoggerHandle::new();
/// info!("init");
/// warn!("warned");
/// assert!(log.pop().is_some());
/// assert!(log.pop().is_none());
/// ```
Expand Down