You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Rust community thinks about tests in terms of two main categories: unit tests and integration tests.
Unit tests are small and more focused, testing one module in isolation at a time, and can test private interfaces.
Integration tests are entirely external to your library and use your code in the same way any other external code would, using only the public interface and potentially exercising multiple modules per test.
The text was updated successfully, but these errors were encountered:
The bodies of test functions typically perform these three actions:
Set up any needed data or state.
Run the code you want to test.
Assert the results are what you expect.
a test in Rust is a function that’s annotated with the test attribute.
To change a function into a test function, add #[test] on the line before fn.
When you run your tests with the cargo test command, Rust builds a test runner binary that runs the functions annotated with the test attribute and reports on whether each test function passes or fails.
The Rust community thinks about tests in terms of two main categories: unit tests and integration tests.
The text was updated successfully, but these errors were encountered: