describeMismatch method Null safety

  1. @override
Description describeMismatch(
  1. covariant Spec item,
  2. Description mismatchDescription,
  3. Map matchState,
  4. bool verbose
)
override

Builds a textual description of a specific mismatch.

item is the value that was tested by matches; matchState is the Map that was passed to and supplemented by matches with additional information about the mismatch, and mismatchDescription is the Description that is being built to describe the mismatch.

A few matchers make use of the verbose flag to provide detailed information that is not typically included but can be of help in diagnosing failures, such as stack traces.

Implementation

@override
Description describeMismatch(
  covariant Spec item,
  Description mismatchDescription,
  matchState,
  verbose,
) {
  final actualSource = _dart(item, _emitter);
  return equals(_expectedSource).describeMismatch(
    actualSource,
    mismatchDescription,
    matchState,
    verbose,
  );
}