commit | e0e20c99937618a059ab2b6f536b63915c77faed | [log] [tgz] |
---|---|---|
author | Nate Bosch <nbosch1@gmail.com> | Fri Jul 17 10:45:00 2020 -0700 |
committer | GitHub <noreply@github.com> | Fri Jul 17 10:45:00 2020 -0700 |
tree | dbc88e45afd1a85a50f63dc31b388105fb6eddeb | |
parent | 54eecf8bca4a9dd95045f9d5b3c6842c80267e4a [diff] |
Allow wrapping predicates which take dynamic (#150) The check against `_Predicate<Object>` was intended to be a top type, but the migration didn't add a `?` so the static type at the call to `predicate(x)` was `predicate<Object>(x)`. The predicate matcher first does a type check against it's `T` when matching values, and `null is Object` returns `false` in an opt-in library. The effect is that a `Function(dynamic)` gets unnecessarily limited to a `Function(Object)` and the type check is done artificially by the matcher instead of by the function itself. Check against `Object?` instead to make it a null safe top type. Add a regression test that fails before the fix is applied.
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.