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

Side by Side Diff: tests/html/xmlelement_test.dart

Issue 11412086: Make 'where' lazy. (Closed) Base URL: https://dart.googlecode.com/svn/experimental/lib_v2/dart
Patch Set: FilteredIterable/Iterator -> WhereIterable/Iterator. Created 8 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library XMLElementTest; 5 library XMLElementTest;
6 import '../../pkg/unittest/lib/unittest.dart'; 6 import '../../pkg/unittest/lib/unittest.dart';
7 import '../../pkg/unittest/lib/html_config.dart'; 7 import '../../pkg/unittest/lib/html_config.dart';
8 import 'dart:html'; 8 import 'dart:html';
9 9
10 main() { 10 main() {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 }); 108 });
109 109
110 test('iterator', () { 110 test('iterator', () {
111 final classes = <String>[]; 111 final classes = <String>[];
112 for (var el in makeClassSet()) { 112 for (var el in makeClassSet()) {
113 classes.add(el); 113 classes.add(el);
114 } 114 }
115 expect(classes, unorderedEquals(['foo', 'bar', 'baz'])); 115 expect(classes, unorderedEquals(['foo', 'bar', 'baz']));
116 }); 116 });
117 117
118 test('map', () { 118 test('mappedBy', () {
119 expect(makeClassSet().mappedBy((c) => c.toUpperCase()).toList(), 119 expect(makeClassSet().mappedBy((c) => c.toUpperCase()).toList(),
120 unorderedEquals(['FOO', 'BAR', 'BAZ'])); 120 unorderedEquals(['FOO', 'BAR', 'BAZ']));
121 }); 121 });
122 122
123 test('filter', () { 123 test('where', () {
124 expect(makeClassSet().where((c) => c.contains('a')), 124 expect(makeClassSet().where((c) => c.contains('a')).toSet(),
125 unorderedEquals(['bar', 'baz'])); 125 unorderedEquals(['bar', 'baz']));
126 }); 126 });
127 127
128 test('every', () { 128 test('every', () {
129 expect(makeClassSet().every((c) => c is String), isTrue); 129 expect(makeClassSet().every((c) => c is String), isTrue);
130 expect(makeClassSet().every((c) => c.contains('a')), isFalse); 130 expect(makeClassSet().every((c) => c.contains('a')), isFalse);
131 }); 131 });
132 132
133 test('some', () { 133 test('some', () {
134 expect(makeClassSet().some((c) => c.contains('a')), isTrue); 134 expect(makeClassSet().some((c) => c.contains('a')), isTrue);
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
573 makeElement().rect.then( 573 makeElement().rect.then(
574 expectAsync1(ElementRect rect) { 574 expectAsync1(ElementRect rect) {
575 expectEmptyRect(rect.client); 575 expectEmptyRect(rect.client);
576 expectEmptyRect(rect.offset); 576 expectEmptyRect(rect.offset);
577 expectEmptyRect(rect.scroll); 577 expectEmptyRect(rect.scroll);
578 expectEmptyRect(rect.bounding); 578 expectEmptyRect(rect.bounding);
579 expect(rect.clientRects.isEmpty, isTrue); 579 expect(rect.clientRects.isEmpty, isTrue);
580 })); 580 }));
581 }); 581 });
582 } 582 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698