Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
(WIP): Adding Stream mock to tokio-test #4463
(WIP): Adding Stream mock to tokio-test #4463
Changes from 10 commits
63e5fb3
6864246
13d740d
fa77e9f
e5b9c8a
553abd0
4115fef
238816d
e7ce82e
7d8eb26
29aee9d
0631ec5
f9e78fd
ab39083
bd3b767
24fad5c
b22f664
dac639d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically you need to return the next action from the list of actions, but if that action is a sleep, then you need to sleep instead. And if you are polled during a sleep, you need to keep sleeping until the sleep completes.
The other mock type implements this by having a loop, where the loop first checks if its currently sleeping, then if the
ready!
macro lets it get past the sleep (i.e. if the sleep has completed), then it pops the next item. If the next item is a sleep, then it sets up that new sleep and goes around the loop. Otherwise it returns the item.