Chromium Code Reviews| Index: pkg/unittest/lib/src/core_matchers.dart |
| diff --git a/pkg/unittest/lib/src/core_matchers.dart b/pkg/unittest/lib/src/core_matchers.dart |
| index 449990b0b1518710fb892a4e00bfe0dfc361cfb8..ce24e047afe88588fad9d3e04dbc834950459ab6 100644 |
| --- a/pkg/unittest/lib/src/core_matchers.dart |
| +++ b/pkg/unittest/lib/src/core_matchers.dart |
| @@ -12,7 +12,7 @@ const Matcher isEmpty = const _Empty(); |
| class _Empty extends BaseMatcher { |
| const _Empty(); |
| bool matches(item, MatchState matchState) { |
| - if (item is Map || item is Collection) { |
| + if (item is Map || item is Iterable) { |
| return item.isEmpty; |
| } else if (item is String) { |
| return item.length == 0; |
| @@ -587,11 +587,11 @@ class _Contains extends BaseMatcher { |
| bool matches(item, MatchState matchState) { |
| if (item is String) { |
| return item.indexOf(_expected) >= 0; |
| - } else if (item is Collection) { |
| + } else if (item is Iterable) { |
| if (_expected is Matcher) { |
| return item.any((e) => _expected.matches(e, matchState)); |
| } else { |
| - return item.any((e) => e == _expected); |
| + return item.contains(_expected); |
|
butlermatt
2013/02/07 15:30:28
I changed this to contains(), to allow Iterables t
|
| } |
| } else if (item is Map) { |
| return item.containsKey(_expected); |