commit | df3e2f168061a64a6d5b23264ddf9674a6330851 | [log] [tgz] |
---|---|---|
author | Nate Bosch <nbosch@google.com> | Tue Oct 01 17:43:26 2024 -0700 |
committer | GitHub <noreply@github.com> | Tue Oct 01 17:43:26 2024 -0700 |
tree | 2a19a287a2b89b53ec16811400faee5b8b4d9706 | |
parent | d872cf8c8fca51b69a3d69241fce9a0e2f9192d9 [diff] |
Add containsMatchingInOrder containsEqualInOrder (#2284) The joined behavior in `containsInOrder` has some usability issues: - It mimics the arguments for `deepEquals`, but it doesn't have the same behavior for collection typed elements. Checking that a nested collection is contained in order requires a `Condition` callback that uses `.deepEquals` explicitly. - The `Object?` signature throws away inference on the `Condition` callback arguments. With a method that supports only conditions the argument type can be tightened and allow inference. Deprecate the old `containsInOrder` and plan to remove it before stable. This is a bit more restrictive, but it's not too noisy to fit a few `(it) => it.equals(foo)` in a collection that needs mixed behavior and the collection of two methods is less confusing to document than the joined behavior. Lean on the "Matches" verb for cases that check a `Condition` callback and rename `pairwiseComparesTo` as `pairwiseMatches`. Fix a type check when pretty printing `Condition` callbacks. Match more than `Condition<dynamic>` by checking `Condition<Never>`.
Welcome! package:test is the standard testing library for Dart and Flutter. If you have questions about Dart testing, please see the docs for package:test. package:test_api
and package:test_core
are implementation details and generally not user-facing.
package:checks is a relatively new library for expressing test expectations. It's a more modern version of package:matcher
and features a literate API.
Package | Description | Version |
---|---|---|
checks | A framework for checking values against expectations and building custom expectations. | |
test | A full featured library for writing and running Dart tests across platforms. | |
test_api | ||
test_core |