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

Unified Diff: tests/corelib/hash_set_test.dart

Issue 946893002: Ensure hash pattern is non-zero. Re-enable compact hash map/set. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/lib/linked_hash_map.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/corelib/hash_set_test.dart
===================================================================
--- tests/corelib/hash_set_test.dart (revision 43939)
+++ tests/corelib/hash_set_test.dart (working copy)
@@ -254,6 +254,21 @@
set.add(-0.0);
Expect.identical(-0.0, set.lookup(0.0));
}
+
+ { // Test special hash codes
+ Set set = newSet();
+ List keys = [];
+ // Powers of two
+ for (int i = 65; i >= 2; --i) {
+ keys.add(new Mutable(1 << i));
+ }
+ for (var key in keys) {
+ Expect.isTrue(set.add(key));
+ }
+ for (var key in keys) {
+ Expect.isTrue(set.contains(key));
+ }
+ }
}
« no previous file with comments | « runtime/lib/linked_hash_map.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698