commit | 97a1500defc24f719552fef3ab3447ade226b36d | [log] [tgz] |
---|---|---|
author | Nate Bosch <nbosch1@gmail.com> | Fri Jul 17 13:35:27 2020 -0700 |
committer | GitHub <noreply@github.com> | Fri Jul 17 13:35:27 2020 -0700 |
tree | f20e0c93a6bb3b0e013b4307f4e11b0a7bce651d | |
parent | 4776275a83b79f8d167c76bbe78ae9be8dcf0027 [diff] |
Fix check for predicate with typed argument (#152) In legacy Dart `Null` is a bottom type, so checking against `Function(Null)` is an arity check. In null safe Dart the only bottom type is `Never`. Without this fix when running with `--enable-experiment=non-nullable` and a predicate callback with an argument type other than `dynamic` or `Object?` the matcher wrapping would fall through to use `equals` instead of wrapping as a predicate. Add a regression test that previously fails as long as the test is run with the experiment enabled. Without the experiment (or when running with a predicate from opt-out code) the wrapping continued to work.
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.