Skip to content

Commit

Permalink
Merge pull request #30 from dart-lang/0.11.x-fix
Browse files Browse the repository at this point in the history
Fix a bug added in 0.11.4+5
  • Loading branch information
nex3 committed Mar 24, 2016
2 parents 72f0767 + 400e879 commit 1afd349
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
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

0 comments on commit 1afd349

Please sign in to comment.