Dart DocumentationmatcherTypeMatcher

TypeMatcher abstract class

abstract class TypeMatcher extends BaseMatcher {
 final String _name;
 const TypeMatcher(this._name);
 Description describe(Description description) =>
     description.add(_name);
}

Extends

BaseMatcher > TypeMatcher

Constructors

const TypeMatcher(String _name) #

const TypeMatcher(this._name);

Methods

Description describe(Description description) #

Creates a textual description of a matcher, by appending to mismatchDescription.

docs inherited from BaseMatcher
Description describe(Description description) =>
   description.add(_name);

Description describeMismatch(item, Description mismatchDescription, MatchState matchState, bool verbose) #

inherited from BaseMatcher

Generates a description of the matcher failed for a particular item, by appending the description to mismatchDescription. It does not check whether the item fails the match, as it is only called after a failed match. There may be additional info about the mismatch in matchState.

Description describeMismatch(item, Description mismatchDescription,
                            MatchState matchState, bool verbose) =>
 mismatchDescription.add('was ').addDescriptionOf(item);

abstract bool matches(item, MatchState matchState) #

inherited from BaseMatcher

Tests the matcher against a given item and return true if the match succeeds; false otherwise. matchState may be used to return additional info for the use of describeMismatch.