Skip to main content

ends_with

Function ends_with 

Source
pub fn ends_with<T>(suffix: impl Into<String>) -> impl Matcher<T>
where T: AsRef<str> + Debug + ?Sized,
Expand description

Matches a string that ends with suffix.

use test_better_core::TestResult;
use test_better_matchers::{ends_with, check};

fn main() -> TestResult {
    check!("hello, world").satisfies(ends_with("world"))?;
    Ok(())
}