Rust unit testing: simplify your tests
Now that we understand the building blocks for writing unit tests in Rust, you probably feel the urge to apply that knowledge and fully cover your application with tests. Don't you? Well, I would ask you to hold your horses and apply it gradually. We still have a lot of ground to cover, but the next sections are probably going to simplify your life right away.
Again in this article, you have the final version of the supervillain.rs
file at the bottom and the repo with the
incremental commits is available here. In case of doubt, check the code or feel free to reach me through any of my
social media accounts.