toString method

  1. @override
String toString(
  1. {bool describeSelf = false}
)
override

A string representation of this finder or its results.

By default, this describes the results of the search in order to play nicely with expect and its output when a failure occurs. If you wish to get a string representation of the finder itself, pass describeSelf as true.

Implementation

@override
String toString({bool describeSelf = false}) {
  if (describeSelf) {
    return 'A finder that searches for ${describeMatch(Plurality.many)}.';
  } else {
    if (!hasFound) {
      evaluate();
    }
    return found.toString();
  }
}