| OLD | NEW |
| 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:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:html'; | 9 import 'dart:html'; |
| 10 | 10 |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 } | 66 } |
| 67 expect(classes, orderedEquals(['foo', 'bar', 'baz'])); | 67 expect(classes, orderedEquals(['foo', 'bar', 'baz'])); |
| 68 }); | 68 }); |
| 69 | 69 |
| 70 test('map', () { | 70 test('map', () { |
| 71 expect(makeClassSet().map((c) => c.toUpperCase()).toList(), | 71 expect(makeClassSet().map((c) => c.toUpperCase()).toList(), |
| 72 orderedEquals(['FOO', 'BAR', 'BAZ'])); | 72 orderedEquals(['FOO', 'BAR', 'BAZ'])); |
| 73 }); | 73 }); |
| 74 | 74 |
| 75 test('where', () { | 75 test('where', () { |
| 76 expect(makeClassSet().where((c) => c.contains('a')).toSet(), | 76 expect(makeClassSet().where((c) => c.contains('a')).toList(), |
| 77 orderedEquals(['bar', 'baz'])); | 77 orderedEquals(['bar', 'baz'])); |
| 78 }); | 78 }); |
| 79 | 79 |
| 80 test('every', () { | 80 test('every', () { |
| 81 expect(makeClassSet().every((c) => c is String), isTrue); | 81 expect(makeClassSet().every((c) => c is String), isTrue); |
| 82 expect(makeClassSet().every((c) => c.contains('a')), isFalse); | 82 expect(makeClassSet().every((c) => c.contains('a')), isFalse); |
| 83 }); | 83 }); |
| 84 | 84 |
| 85 test('any', () { | 85 test('any', () { |
| 86 expect(makeClassSet().any((c) => c.contains('a')), isTrue); | 86 expect(makeClassSet().any((c) => c.contains('a')), isTrue); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 178 test('order', () { | 178 test('order', () { |
| 179 var classes = makeClassSet(); | 179 var classes = makeClassSet(); |
| 180 classes.add('aardvark'); | 180 classes.add('aardvark'); |
| 181 expect(classes, orderedEquals(['foo', 'bar', 'baz', 'aardvark'])); | 181 expect(classes, orderedEquals(['foo', 'bar', 'baz', 'aardvark'])); |
| 182 classes.toggle('baz'); | 182 classes.toggle('baz'); |
| 183 expect(classes, orderedEquals(['foo', 'bar', 'aardvark'])); | 183 expect(classes, orderedEquals(['foo', 'bar', 'aardvark'])); |
| 184 classes.toggle('baz'); | 184 classes.toggle('baz'); |
| 185 expect(classes, orderedEquals(['foo', 'bar', 'aardvark', 'baz'])); | 185 expect(classes, orderedEquals(['foo', 'bar', 'aardvark', 'baz'])); |
| 186 }); | 186 }); |
| 187 } | 187 } |
| OLD | NEW |