Skip to content

Glossary: Coding Interviews in Rust

assert_eq!

Also written: assert!, assert, asserts

A Rust macro that checks two values are equal. If they differ, the program panics and prints both values. `assert!(condition)` does the same for a single true-or-false check.

Where the book teaches it

Related terms

Panic#[test]