Skip to content
This repository has been archived by the owner on Oct 22, 2024. It is now read-only.

Commit

Permalink
More phrasing tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
natebosch committed Nov 21, 2023
1 parent 20b0c69 commit 5c16866
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,10 @@ why the test failed. For instance compare the failures between
### Prefer TypeMatcher to predicate if the match can fail in multiple ways

The `predicate` utility is a convenient shortcut for testing an arbitrary
(synchronous) property of a value, but it discards context and the failures are
opaque. If a value could be rejected by the matcher for more than one reason the
different failure modes cannot be distinguished in the output. Using
`isA<SomeType>()` and the `TypeMatcher.having` API to extract and test derived
properties in a structured way brings the context of that structure through to
failure messages, and failures for differing reasons will have more specific
output.
(synchronous) property of a value, but it discards context and failures are
opaque. Different failure modes cannot be distinguished in the output which is
determined by a single "description" argument. Using `isA<SomeType>()` and the
`TypeMatcher.having` API to extract and test derived properties in a structured
way brings the context of that structure through to failure messages, so
failures for different reasons will have distinguishable and actionable failure
messages.
2 changes: 1 addition & 1 deletion lib/src/core_matchers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ class _In<T> extends FeatureMatcher<T> {
///
/// Using an explicit generict argument allows a passed function literal to have
/// an inferred argument type of [T], and values of the wrong type will be
/// rejected with an informative meessage.
/// rejected with an informative message.
Matcher predicate<T>(bool Function(T) f,
[String description = 'satisfies function']) =>
_Predicate(f, description);
Expand Down

0 comments on commit 5c16866

Please sign in to comment.