Crates.io | assert_ng |
lib.rs | assert_ng |
version | 0.0.3 |
source | src |
created_at | 2014-11-21 00:10:11.842749 |
updated_at | 2015-12-11 23:57:25.953017 |
description | An extended assert macro that extends Rust’s built-in assert macro to give better messages on failure. |
homepage | https://github.com/P1start/assert_ng |
repository | https://github.com/P1start/assert_ng |
max_upload_size | |
id | 191 |
size | 9,801 |
assert_ng!
This provides an improved assert macro for the Rust programming language,
eliminating the need for assert_eq!
while also providing equivalents for !=
,
>
and so on.
The basic idea is that if the macro is provided a condition formatted like a == b
, it’ll do what assert_eq!
does, i.e., print out a
and b
if the
assertion fails. To avoid this functionality, simply surround the condition in
parentheses: assert!((a == b))
.