上QQ阅读APP看书,第一时间看更新
Writing tests and benchmarks
When we start developing, tests take a backseat more often than not. There are several reasons why this might be necessary at the time, but the inability to set up a testing framework and surroundings is not one of them. Unlike many languages, Rust supports testing right out of the box. This recipe covers how to use these tools.
Although we mostly talk about unit testing here, that is, tests on a function/struct level, the tools remain the same for integration tests.