Module lib::assert_starts_with::assert_starts_with

source ·
Expand description

Assert an expression (such as a string) starts with an expression (such as a string).

Pseudocode:
a.starts_with(b)

§Example

use assertables::*;

// String starts with substring?
let whole: &str = "alfa";
let part: &str = "al";
assert_starts_with!(sequence, x);

// Vector starts with element?
let whole = vec![1, 2, 3];
let part = [1];
assert_starts_with!(sequence, x);

§Module macros