Rust unit testing: asynchronous code
So far, we have only tested synchronous code. I could postpone talking about asynchronous code, but I don't want you to wait for it. 😄
Asynchronous code, apart from being an inexhaustible source of dad jokes, can be painful to reason about its behavior and not always recommended. We tend to think that, in a given scope, the lines above are executed before the lines below. It really takes experience and discipline to realize that some parts of the code can be executed at a later time and that we may not have yet their results available. This is important when we write our asynchronous code, but even more when we debug it .
