#stream #testing #macro #assertions #api

dev streamassert

宏简化基于 Stream 的 API 测试

2 个版本

0.1.1 2023 年 9 月 6 日
0.1.0 2023 年 5 月 30 日

1896Rust 模式

Download history · Rust 包仓库 267/week @ 2024-04-09 · Rust 包仓库 169/week @ 2024-04-16 · Rust 包仓库 157/week @ 2024-04-23 · Rust 包仓库 344/week @ 2024-04-30 · Rust 包仓库 228/week @ 2024-05-07 · Rust 包仓库 280/week @ 2024-05-14 · Rust 包仓库 451/week @ 2024-05-21 · Rust 包仓库 483/week @ 2024-05-28 · Rust 包仓库 388/week @ 2024-06-04 · Rust 包仓库 531/week @ 2024-06-11 · Rust 包仓库 398/week @ 2024-06-18 · Rust 包仓库 499/week @ 2024-06-25 · Rust 包仓库 436/week @ 2024-07-02 · Rust 包仓库 558/week @ 2024-07-09 · Rust 包仓库 586/week @ 2024-07-16 · Rust 包仓库 582/week @ 2024-07-23 · Rust 包仓库

2,250 每月下载量
8 crates 中使用

MPL-2.0 许可证

8KB
77

stream_assert

宏简化基于 Stream 的 API 测试。

提供以下断言宏

// Assert that the next value is ready and equal to the given expression.
assert_next_eq!(stream, expression);

// Assert that the next value is ready and matches the given pattern.
assert_next_matches!(stream, Enum::Variant { field: 1, .. });

// Assert that the stream is not ready (`poll_next` returns `Pending`).
assert_pending!(stream);

// Assert that the stream is closed (`poll_next` returns `Ready(None)`).
assert_closed!(stream);

依赖关系

~530–710KB
~14K SLoC