Function googletest::matchers::ends_with

source ·
pub fn ends_with<A: ?Sized, T>(expected: T) -> StrMatcher<A, T>
Expand description

Matches a string which ends with the given suffix.

Both the actual value and the expected suffix may be either a String or a string reference.

verify_that!("Some value", ends_with("value"))?;  // Passes
verify_that!("Some value", ends_with("other value"))?;   // Fails
verify_that!("Some value", ends_with("Some"))?;  // Fails
verify_that!("Some value".to_string(), ends_with("value"))?;   // Passes
verify_that!("Some value", ends_with("value".to_string()))?;   // Passes

See the StrMatcherConfigurator extension trait for more options on how the string is matched.