assert_text_starts_with

Macro assert_text_starts_with 

Source
macro_rules! assert_text_starts_with {
    ($left: expr, $right: expr) => { ... };
}
Expand description

Asserts that the first text expression starts with the second text expression.

If the first text does not start with the second, it prints a GitHub-style diff of the differing prefix and panics.

§Arguments

  • $left - The text expression to check.
  • $right - The prefix to check against.

§Examples

use assert_text::assert_text_starts_with;
assert_text_starts_with!("hello world", "hello ");
use assert_text::assert_text_starts_with;
assert_text_starts_with!("hello world", "goodbye");