Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
34 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,15 @@ | ||
// ignore_for_file: public_member_api_docs | ||
|
||
part of 'expect.dart'; | ||
|
||
/// Matchers for Maps | ||
extension MapExpectationX<Return, KeyParam, ValueParam> on ExpectationBase< | ||
Map<KeyParam, ValueParam>, Return, Map<KeyParam, ValueParam>> { | ||
Return containsPair(KeyParam key, ValueParam value) { | ||
return runMatcher(dart_test.containsPair(key, value)); | ||
} | ||
/// Returns a matcher which matches maps containing the key-value pair | ||
/// with [key] => [value]. | ||
Return containsPair(KeyParam key, ValueParam value) => | ||
runMatcher(dart_test.containsPair(key, value)); | ||
|
||
Return containsKey(KeyParam key) { | ||
return runMatcher(dart_test.containsPair(key, dart_test.anything)); | ||
} | ||
/// Returns a matcher which matches maps containing the [key] | ||
/// with any value. | ||
Return containsKey(KeyParam key) => | ||
runMatcher(dart_test.containsPair(key, dart_test.anything)); | ||
} |