While unit tests can test the private interface of your crate and individual modules, integration tests are kind of like black box tests that aim to test the end-to-end use of the public interface of your crate from a consumer's perspective. In terms of writing code, there is not a lot of difference between writing integration tests and unit tests. The only difference lies in the directory structure and that the items need to be made public, which is already exposed by the developer as per the design of the crate.
Integration tests
First integration test
As we stated previously, Rust expects all integration tests to live in the tests/ directory. Files within the tests/ directory are compiled as if they are separate binary...