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

Side by Side Diff: tests/compiler/dart2js_extra/hash_code_test.dart

Issue 1519563004: Upgrade more confuse() functions (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years 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) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 "package:expect/expect.dart"; 5 import "package:expect/expect.dart";
6 6
7 // dart2js specific test to make sure hashCode on intercepted types behaves as 7 // dart2js specific test to make sure hashCode on intercepted types behaves as
8 // intended. 8 // intended.
9 9
10 @NoInline()
11 @AssumeDynamic()
12 confuse(x) => x;
10 13
11 class Hasher { 14 class Hasher {
12 confuse(x) => [1, 'x', true, null, x].last;
13 hash(x) => confuse(x).hashCode; 15 hash(x) => confuse(x).hashCode;
14 } 16 }
15 17
16 // Hashing via [hash] should be forced to use the general interceptor, but the 18 // Hashing via [hash] should be forced to use the general interceptor, but the
17 // local x.hashCode calls might be optimized. 19 // local x.hashCode calls might be optimized.
18 var hash = new Hasher().hash; 20 var hash = new Hasher().hash;
19 21
20 check(value1, value2, {identityHashCode}) { 22 check(value1, value2, {identityHashCode}) {
21 var h1 = hash(value1); 23 var h1 = hash(value1);
22 var h2 = hash(value2); 24 var h2 = hash(value2);
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 Expect.equals(0x0DB819B, 'b'.hashCode); 79 Expect.equals(0x0DB819B, 'b'.hashCode);
78 Expect.equals(0xEBA5D59, 'c'.hashCode); 80 Expect.equals(0xEBA5D59, 'c'.hashCode);
79 } 81 }
80 82
81 main() { 83 main() {
82 bools(); 84 bools();
83 ints(); 85 ints();
84 lists(); 86 lists();
85 strings(); 87 strings();
86 } 88 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js_extra/23828_test.dart ('k') | tests/compiler/dart2js_extra/mirrors_used_closure_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698