#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 267/week @ 2024-04-09 169/week @ 2024-04-16 157/week @ 2024-04-23 344/week @ 2024-04-30 228/week @ 2024-05-07 280/week @ 2024-05-14 451/week @ 2024-05-21 483/week @ 2024-05-28 388/week @ 2024-06-04 531/week @ 2024-06-11 398/week @ 2024-06-18 499/week @ 2024-06-25 436/week @ 2024-07-02 558/week @ 2024-07-09 586/week @ 2024-07-16 582/week @ 2024-07-23

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