tokio
tokio copied to clipboard
(WIP): Adding Stream mock to tokio-test
Motivation
This issue relates to #4106
Solution
Test the Stream with the mock as sugested in issue thread
This is a draft. I got stuck creating the solution, created this PR in hope that I could get some help
Let me know if there's any other help you need.
Sure! I'm trying to get to know Tokio code base and its patterns.
Should I create also a file just for io_stream ? also I'm not sure how I would implement stream in Mock and how I would test it if not by let val = stream.next().await as stream here would be building mock as stream ? like in the return of mock -> impl Stream<value = &str>
also I'm not sure how I would implement stream in Mock and how I would test it if not by
let val = stream.next().awaitas stream here would be building mock as stream
You would test it by calling next on the Mock value as you suggested.
Sorry, this PR appears to have gotten lost. Do you want to finish it? There are some CI failures.
Sorry, this PR appears to have gotten lost. Do you want to finish it? There are some CI failures.
Yeah, I Would love to finish. It has been some time since I haven't touched Rust but I can give it another try again guess this last note can help me :
I don't have any ideia why my mock.next.await is aways returning None for me. perhaps because of the cx ? Maybe I should use a mock Context too for using pool_next(cx) ? or keep with next() but change the way that I call Action it at io_steram ?
Hey, I'm really sorry that this got lost. Do you still want to work on it? If not, that's ok.
This has been superseded by #5915.