Overview
Explore automated testing in Rust through this 23-minute video tutorial. Learn the fundamental tools for writing effective tests, including test function anatomy, assertion macros, custom failure messages, and panic checks. Discover how to use Result in tests, run tests in parallel or consecutively, and manage test output. Gain insights into organizing tests, creating submodules for integration testing, and implementing tests for binary crates. Practice writing robust automated tests to ensure your Rust programs function as intended beyond basic compiler checks.
Syllabus
intro
Anatomy of a Test Function
Checking Results with the assert! Macro
Testing Equality with the assert_eq! and assert_ne! Macros
Adding Custom Failure Messages
Checking for Panics with should_panic
Using Result in Tests
Running Tests in Parallel or Consecutively
Showing Function Output
Running a Subset of Tests by Name
Ignoring Some Tests Unless Specifically Requested
Test Organization
Submodules in Integration Tests
Integration Tests for Binary Crates
Taught by
The Dev Method