May 2019
Intermediate to advanced
698 pages
17h 21m
English
In testing, when given a test case, we try to assert the expected behavior of our software component on a given range of inputs. Languages usually provide functions called assertion functions to perform these assertions. Rust provides us with assertion functions, implemented as macros, that help us achieve the same thing. Let's take a look at some of the commonly used ones:
assert!(true); assert!(a == b, "{} was not equal to {}", a, b);
Read now
Unlock full access