Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tokio-test: extract assert_elapsed macro #3728

Merged
merged 3 commits into from
May 5, 2021
Merged

Conversation

rcoh
Copy link
Contributor

@rcoh rcoh commented Apr 25, 2021

The assert_elapsed macro is generally useful for Tokio users. This
commit extracts assert_elapsed into tokio-test.

It adapts the macro for general use by using std::time::Duration
instead of an integral millis value for time comparison.

Motivation

assert_elapsed is a generally very handy macro when interacting with tokio & time, especially because the 1ms tolerance is required.

Solution

Extract the macro into tokio-test in the two locations it was defined, refactor to use the slightly modified macro.

The `assert_elapsed` macro is generally useful for Tokio users. This
commit extracts `assert_elapsed` into `tokio-test`.

It adapts the macro for general use by using `std::time::Duration`
instead of an integral millis value for time comparison.
@Darksonn Darksonn added the A-tokio-test Area: The tokio-test crate label May 5, 2021
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

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

Thanks.

@Darksonn Darksonn merged commit 8ef39df into tokio-rs:master May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio-test Area: The tokio-test crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants