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

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

Issue 12086062: Rename mappedBy to map. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Undo change to test-script. Created 7 years, 10 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tests/corelib/set_test.dart ('k') | tests/html/element_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 ElementTest; 5 library ElementTest;
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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
60 60
61 test('iterator', () { 61 test('iterator', () {
62 final classes = <String>[]; 62 final classes = <String>[];
63 for (var el in makeClassSet()) { 63 for (var el in makeClassSet()) {
64 classes.add(el); 64 classes.add(el);
65 } 65 }
66 expect(classes, unorderedEquals(['foo', 'bar', 'baz'])); 66 expect(classes, unorderedEquals(['foo', 'bar', 'baz']));
67 }); 67 });
68 68
69 test('mappedBy', () { 69 test('mappedBy', () {
70 expect(makeClassSet().mappedBy((c) => c.toUpperCase()).toList(), 70 expect(makeClassSet().map((c) => c.toUpperCase()).toList(),
71 unorderedEquals(['FOO', 'BAR', 'BAZ'])); 71 unorderedEquals(['FOO', 'BAR', 'BAZ']));
72 }); 72 });
73 73
74 test('where', () { 74 test('where', () {
75 expect(makeClassSet().where((c) => c.contains('a')).toSet(), 75 expect(makeClassSet().where((c) => c.contains('a')).toSet(),
76 unorderedEquals(['bar', 'baz'])); 76 unorderedEquals(['bar', 'baz']));
77 }); 77 });
78 78
79 test('every', () { 79 test('every', () {
80 expect(makeClassSet().every((c) => c is String), isTrue); 80 expect(makeClassSet().every((c) => c is String), isTrue);
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 expect(classes.intersection(['foo', 'qux', 'baz']), 159 expect(classes.intersection(['foo', 'qux', 'baz']),
160 unorderedEquals(['foo', 'baz'])); 160 unorderedEquals(['foo', 'baz']));
161 }); 161 });
162 162
163 test('clear', () { 163 test('clear', () {
164 final classes = makeClassSet(); 164 final classes = makeClassSet();
165 classes.clear(); 165 classes.clear();
166 expect(classes, equals([])); 166 expect(classes, equals([]));
167 }); 167 });
168 } 168 }
OLDNEW
« no previous file with comments | « tests/corelib/set_test.dart ('k') | tests/html/element_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698