Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug added in 0.11.4+5 #30

Merged
merged 1 commit into from
Mar 24, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.11.4+6

* Fix a bug introduced in 0.11.4+5 in which operator matchers broke when taking
lists of matchers.

## 0.11.4+5

* Fix all strong-mode warnings.
Expand Down
25 changes: 20 additions & 5 deletions lib/src/operator_matchers.dart
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,23 @@ class _AnyOf extends Matcher {
description.addAll('(', ' or ', ')', _matchers);
}

List<Matcher> _wrapArgs(arg0, arg1, arg2, arg3, arg4, arg5, arg6) =>
[arg0, arg1, arg2, arg3, arg4, arg5, arg6]
.where((e) => e != null)
.map((e) => wrapMatcher(e))
.toList();
List<Matcher> _wrapArgs(arg0, arg1, arg2, arg3, arg4, arg5, arg6) {
Iterable args;
if (arg0 is List) {
if (arg1 != null ||
arg2 != null ||
arg3 != null ||
arg4 != null ||
arg5 != null ||
arg6 != null) {
throw new ArgumentError('If arg0 is a List, all other arguments must be'
' null.');
}

args = arg0;
} else {
args = [arg0, arg1, arg2, arg3, arg4, arg5, arg6].where((e) => e != null);
}

return args.map((e) => wrapMatcher(e)).toList();
}
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: matcher
version: 0.11.4+5
version: 0.11.4+6
author: Dart Team <misc@dartlang.org>
description: Support for specifying test expectations
homepage: https://github.com/dart-lang/matcher
Expand Down