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. lib/
  2. test/
  3. .gitignore
  4. .test_config
  5. .travis.yml
  6. analysis_options.yaml
  7. CHANGELOG.md
  8. LICENSE
  9. pubspec.yaml
  10. README.md
README.md

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.