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.
2 files changed
tree: dbc88e45afd1a85a50f63dc31b388105fb6eddeb
  1. .gitignore
  2. .test_config
  3. .travis.yml
  7. analysis_options.yaml
  8. lib/
  9. pubspec.yaml
  10. test/

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.