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

Side by Side Diff: tests/html/xmldocument_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 XMLDocumentTest; 5 library XMLDocumentTest;
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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 }); 95 });
96 96
97 test('iterator', () { 97 test('iterator', () {
98 final classes = <String>[]; 98 final classes = <String>[];
99 for (var doc in makeClassSet()) { 99 for (var doc in makeClassSet()) {
100 classes.add(doc); 100 classes.add(doc);
101 } 101 }
102 expect(classes, unorderedEquals(['foo', 'bar', 'baz'])); 102 expect(classes, unorderedEquals(['foo', 'bar', 'baz']));
103 }); 103 });
104 104
105 test('map', () { 105 test('mappedBy', () {
106 expect(makeClassSet().mappedBy((c) => c.toUpperCase()).toList(), 106 expect(makeClassSet().mappedBy((c) => c.toUpperCase()).toList(),
107 unorderedEquals(['FOO', 'BAR', 'BAZ'])); 107 unorderedEquals(['FOO', 'BAR', 'BAZ']));
108 }); 108 });
109 109
110 test('filter', () { 110 test('where', () {
111 expect(makeClassSet().where((c) => c.contains('a')), 111 expect(makeClassSet().where((c) => c.contains('a')).toSet(),
112 unorderedEquals(['bar', 'baz'])); 112 unorderedEquals(['bar', 'baz']));
113 }); 113 });
114 114
115 test('every', () { 115 test('every', () {
116 expect(makeClassSet().every((c) => c is String), isTrue); 116 expect(makeClassSet().every((c) => c is String), isTrue);
117 expect(makeClassSet().every((c) => c.contains('a')), isFalse); 117 expect(makeClassSet().every((c) => c.contains('a')), isFalse);
118 }); 118 });
119 119
120 test('some', () { 120 test('some', () {
121 expect(makeClassSet().some((c) => c.contains('a')), isTrue); 121 expect(makeClassSet().some((c) => c.contains('a')), isTrue);
(...skipping 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 test('manifest', () => expect(makeDocument().manifest), ''); 612 test('manifest', () => expect(makeDocument().manifest), '');
613 }); 613 });
614 614
615 test('unsupported operations', () { 615 test('unsupported operations', () {
616 expectUnsupported(() { makeDocument().body = new XMLElement.tag('xml'); }); 616 expectUnsupported(() { makeDocument().body = new XMLElement.tag('xml'); });
617 expectUnsupported(() => makeDocument().cookie); 617 expectUnsupported(() => makeDocument().cookie);
618 expectUnsupported(() { makeDocument().cookie = 'foo'; }); 618 expectUnsupported(() { makeDocument().cookie = 'foo'; });
619 expectUnsupported(() { makeDocument().manifest = 'foo'; }); 619 expectUnsupported(() { makeDocument().manifest = 'foo'; });
620 }); 620 });
621 } 621 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698