Macro similar_asserts::assert_str_eq [−][src]
Asserts that two stringified expressions are equal to each other
(using PartialEq).
This works similar to assert_eq! but before comparing the values they
are stringified via ToString. This also uses a slightly different
comparison display that is better optimized for normal strings.
On panic, this macro will print the values of the expressions with their debug representations with a colorized diff of the changes in the debug output.
Like assert!, this macro has a second form, where a custom panic
message can be provided.
use similar_asserts::assert_str_eq; assert_str_eq!("foobarbaz".replace("z", "zzz"), "foobarbazzz");