Module googletest::matchers

source ·
Expand description

All built-in matchers of this crate are in submodules of this module.

Macros

  • Matches a value which all of the given matchers match.
  • Matches a value which at least one of the given matchers match.
  • Matches a container containing elements matched by the given matchers.
  • Matches a container’s elements to each matcher in order.
  • Matches a structure or enum with a given field which is matched by a given matcher.
  • Matches a container all of whose elements are matched by the given matchers.
  • Matches a value according to a pattern of matchers.
  • An alias for matches_pattern.
  • Generates a matcher which matches a container each of whose elements match the given matcher name applied respectively to each element of the given container.
  • Matches an object which, upon calling the given method on it with the given arguments, produces a value matched by the given inner matcher.
  • Matches a container whose elements in any order have a 1:1 correspondence with the provided element matchers.

Structs

  • A matcher which matches a container containing one or more elements a given inner Matcher matches.
  • A matcher which matches a value equal to expected.
  • A matcher which matches floating-point numbers approximately equal to its expected value.
  • A matcher which applies predicate on the value.
  • A matcher which matches equality or containment of a string-like value in a configurable way.

Traits

Functions

  • Matches anything. This matcher always succeeds.
  • Matches a value approximately equal to expected.
  • Matches a string whose number of Unicode scalars matches expected.
  • Matches a container equal (in the sense of ==) to expected.
  • Matches an iterable type whose elements contain a value matched by inner.
  • Matches a string containing a substring which matches the given regular expression.
  • Matches a string containing a given substring.
  • Matches the string representation of types that implement Display.
  • Matches a container all of whose elements are matched by the matcher inner.
  • Matches an empty container.
  • Matches a string which ends with the given suffix.
  • Matches a value equal (in the sense of ==) to expected.
  • Matches a value equal (in the sense of ==) to the dereferenced value of expected.
  • Matches a Result containing Err with a value matched by inner.
  • Matches a value greater than or equal to (in the sense of >=) expected.
  • Matches a value greater (in the sense of >) than expected.
  • Matches a HashMap containing the given key whose value is matched by the matcher inner.
  • Matches a floating point value which is NaN.
  • Matches a byte sequence which is a UTF-8 encoded string matched by inner.
  • Matches a value less than or equal to (in the sense of <=) expected.
  • Matches a container whose number of elements matches expected.
  • Matches a value less (in the sense of <) than expected.
  • Matches a string the entirety of which which matches the given regular expression.
  • Matches a value equal within max_abs_error of expected.
  • Matches an Option containing None.
  • Matches the actual value exactly when the inner matcher does not match.
  • Matches a Result containing Ok with a value matched by inner.
  • Matches a (smart) pointer pointing to a value matched by the Matcher expected.
  • Creates a matcher based on the predicate provided.
  • Matches an Option containing a value matched by inner.
  • Matches a string which starts with the given prefix.
  • Matches a container all of whose items are in the given container superset.
  • Matches a container containing all of the items in the given container subset.