Function googletest::matchers::starts_with
source ยท pub fn starts_with<T>(expected: T) -> StrMatcher<T>
Expand description
Matches a string which starts with the given prefix.
Both the actual value and the expected prefix may be either a String
or
a string reference.
verify_that!("Some value", starts_with("Some"))?; // Passes
verify_that!("Another value", starts_with("Some"))?; // Fails
verify_that!("Some value", starts_with("value"))?; // Fails
verify_that!("Some value".to_string(), starts_with("Some"))?; // Passes
verify_that!("Some value", starts_with("Some".to_string()))?; // Passes
See the StrMatcherConfigurator
extension trait for more options on how
the string is matched.