Crate assert_str

Source
Expand description

Macros for asserting of multiline strings String and &str. The API is very similar to the API provided by the stdlib’s own assert_eq! or assert_ne!. Left and right expression could be different types.

§Examples

Some examples are provided in the docs for each individual macro.

Macros§

assert_str_eq
Asserts that multiline strings(&str or String) are identical. It ignores different new line characters for different OSes: \n or \r\n.
assert_str_ne
Asserts that multiline strings(&str or String) are not identical. It ignores different new line characters for different OSes: \n or \r\n.
assert_str_trim_all_eq
Asserts that multiline strings(&str or String) are identical when every line is trimmed and new lines are removed.
assert_str_trim_all_ne
Asserts that multiline strings(&str or String) are identical when every line is trimmed and new lines are removed.
assert_str_trim_eq
Asserts that multiline strings(&str or String) are identical when every line is trimmed and empty lines are removed. It ignores different new line characters for different OSes: \n or \r\n.
assert_str_trim_ne
Asserts that multiline strings(&str or String) are identical. It ignores different new line characters for different OSes: \n or \r\n