January 2019
Beginner to intermediate
554 pages
13h 31m
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