commit | 6a9b83bbd73e50df2058b3e8e4aa301df49569c6 | [log] [tgz] |
---|---|---|
author | Nate Bosch <nbosch@google.com> | Thu Sep 15 12:21:53 2022 -0700 |
committer | GitHub <noreply@github.com> | Thu Sep 15 12:21:53 2022 -0700 |
tree | a5c67b9cd7969c8cc66b31c79f56a6e154dc82eb | |
parent | 7e204b8e733aae2c18c12058429ccf29b59f2f51 [diff] |
Make FunctionMatcher private again (#196) Add a separate private constructor to satisfy the lint library_private_types_in_public_api
Support for specifying test expectations, such as for unit tests.
The matcher library provides a third-generation assertion mechanism, drawing inspiration from Hamcrest.
For more information, see Unit Testing with Dart.
Matchers which have knowledge of the semantics that are tested are able to emit more meaningful messages which don't require reading test source to understand why the test failed. For instance compare the failures between expect(someList.length, 1)
, and expect(someList, hasLength(1))
:
// expect(someList.length, 1); Expected: <1> Actual: <2>
// expect(someList, hasLength(1)); Expected: an object with length of <1> Actual: ['expected value', 'unexpected value'] Which: has length of <2>