An assertion checks a condition during program execution and reports failure when the condition is false. Rust’s assert! macro validates a Boolean condition; a failed check panics the running thread. section 7.1
Checking a calculation
A test can calculate a result and verify it with assert_eq!(result, 4). If the values differ, the test fails and reports both values. Use assert! when the condition itself is Boolean, such as assert!(condition). section 7.1














