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

Side by Side Diff: tests/corelib_strong/hash_set_test.dart

Issue 2988803002: Adjust some tests for limited 64-bit integers (Closed)
Patch Set: 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
« no previous file with comments | « tests/corelib_strong/growable_list_test.dart ('k') | tests/language/bit_shift_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) 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 // VMOptions= 5 // VMOptions=
6 6
7 // Tests of hash set behavior, with focus in iteration and concurrent 7 // Tests of hash set behavior, with focus in iteration and concurrent
8 // modification errors. 8 // modification errors.
9 9
10 library hash_map2_test; 10 library hash_map2_test;
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 Expect.identical(1, set.lookup(1.0)); 268 Expect.identical(1, set.lookup(1.0));
269 set.add(-0.0); 269 set.add(-0.0);
270 Expect.identical(-0.0, set.lookup(0.0)); 270 Expect.identical(-0.0, set.lookup(0.0));
271 } 271 }
272 272
273 { 273 {
274 // Test special hash codes 274 // Test special hash codes
275 Set set = newSet(); 275 Set set = newSet();
276 List keys = []; 276 List keys = [];
277 // Powers of two 277 // Powers of two
278 for (int i = 65; i >= 2; --i) { 278 for (int i = 63; i >= 2; --i) {
279 keys.add(new Mutable(math.pow(2, i))); 279 keys.add(new Mutable(math.pow(2, i)));
280 } 280 }
281 for (var key in keys) { 281 for (var key in keys) {
282 Expect.isTrue(set.add(key)); 282 Expect.isTrue(set.add(key));
283 } 283 }
284 for (var key in keys) { 284 for (var key in keys) {
285 Expect.isTrue(set.contains(key)); 285 Expect.isTrue(set.contains(key));
286 } 286 }
287 } 287 }
288 } 288 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
354 // Can't make a bad compareTo that isn't invalid. 354 // Can't make a bad compareTo that isn't invalid.
355 int compareTo(BadHashCode other) => id - other.id; 355 int compareTo(BadHashCode other) => id - other.id;
356 } 356 }
357 357
358 class Mutable { 358 class Mutable {
359 int id; 359 int id;
360 Mutable(this.id); 360 Mutable(this.id);
361 int get hashCode => id; 361 int get hashCode => id;
362 bool operator ==(other) => other is Mutable && id == other.id; 362 bool operator ==(other) => other is Mutable && id == other.id;
363 } 363 }
OLDNEW
« no previous file with comments | « tests/corelib_strong/growable_list_test.dart ('k') | tests/language/bit_shift_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698