Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(111)

Unified Diff: tests/html/element_test.dart

Issue 11777016: Fix some failures in html/element_test by changing where(...)[0] to where(...).first. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fix type check on .where(...) from List to Iterable. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« sdk/lib/core/list.dart ('K') | « sdk/lib/core/list.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/html/element_test.dart
diff --git a/tests/html/element_test.dart b/tests/html/element_test.dart
index d9916ba24ca0335e1ca9167a78eb13078df62737..834e83476b384a6aeb64b7dc6ef4a7dc4fbd7d3f 100644
--- a/tests/html/element_test.dart
+++ b/tests/html/element_test.dart
@@ -59,6 +59,8 @@ main() {
predicate((x) => x is AnchorElement, 'is an AnchorElement');
var isElementList =
predicate((x) => x is List<Element>, 'is a List<Element>');
+ var isElementIterable =
+ predicate((x) => x is Iterable<Element>, 'is an Iterable<Element>');
var isHeadingElement =
predicate((x) => x is HeadingElement, 'is a HeadingElement');
@@ -372,8 +374,8 @@ main() {
var filtered = makeElementWithChildren().children.
where((n) => n is ImageElement);
expect(1, filtered.length);
- expect(filtered[0], isImageElement);
- expect(filtered, isElementList);
+ expect(filtered.first, isImageElement);
+ expect(filtered, isElementIterable);
});
test('every', () {
@@ -593,8 +595,8 @@ main() {
test('where', () {
var filtered = makeElList().where((n) => n is ImageElement);
expect(filtered.length, 1);
- expect(filtered[0], isImageElement);
- expect(filtered, isElementList);
+ expect(filtered.first, isImageElement);
+ expect(filtered, isElementIterable);
});
test('getRange', () {
« sdk/lib/core/list.dart ('K') | « sdk/lib/core/list.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698