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

Side by Side Diff: tests/lib_strong/collection/linked_list_test.dart

Issue 2989993002: fix unsound cast failures in tests (Closed)
Patch Set: fix Created 3 years, 4 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
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 import 'dart:collection'; 5 import 'dart:collection';
6 import "package:expect/expect.dart"; 6 import "package:expect/expect.dart";
7 7
8 class MyEntry extends LinkedListEntry<MyEntry> { 8 class MyEntry extends LinkedListEntry<MyEntry> {
9 final int value; 9 final int value;
10 10
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 var list1 = new LinkedList<MyEntry>(); 117 var list1 = new LinkedList<MyEntry>();
118 list1.addFirst(new MyEntry(0)); 118 list1.addFirst(new MyEntry(0));
119 119
120 var list2 = new LinkedList<MyEntry>(); 120 var list2 = new LinkedList<MyEntry>();
121 Expect.throws(() => list2.addFirst(list1.first)); 121 Expect.throws(() => list2.addFirst(list1.first));
122 122
123 Expect.throws(() => new MyEntry(0).unlink()); 123 Expect.throws(() => new MyEntry(0).unlink());
124 } 124 }
125 125
126 testConcurrentModificationError() { 126 testConcurrentModificationError() {
127 test(function(LinkedList ll)) { 127 test(function(LinkedList<MyEntry> ll)) {
128 var ll = new LinkedList<MyEntry>(); 128 var ll = new LinkedList<MyEntry>();
129 for (int i = 0; i < 10; i++) { 129 for (int i = 0; i < 10; i++) {
130 ll.add(new MyEntry(i)); 130 ll.add(new MyEntry(i));
131 } 131 }
132 Expect.throws(() => function(ll), (e) => e is ConcurrentModificationError); 132 Expect.throws(() => function(ll), (e) => e is ConcurrentModificationError);
133 } 133 }
134 134
135 test((ll) { 135 test((ll) {
136 for (var x in ll) { 136 for (var x in ll) {
137 ll.remove(x); 137 ll.remove(x);
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 }); 219 });
220 }); 220 });
221 } 221 }
222 222
223 main() { 223 main() {
224 testInsert(); 224 testInsert();
225 testRemove(); 225 testRemove();
226 testBadAdd(); 226 testBadAdd();
227 testConcurrentModificationError(); 227 testConcurrentModificationError();
228 } 228 }
OLDNEW
« no previous file with comments | « tests/language_strong/many_named_arguments_test.dart ('k') | tests/lib_strong/convert/chunked_conversion_utf82_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698