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/compiler/dart2js/constant_value_test.dart

Issue 2112893002: Use unordered map hash on ConstructedConstantValue. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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 | « pkg/compiler/lib/src/util/util.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file
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.
4
5 library dart2js.constants.values.test;
6
7 import 'package:async_helper/async_helper.dart';
8 import 'package:expect/expect.dart';
9 import 'package:compiler/src/helpers/helpers.dart';
10 import 'package:compiler/src/elements/elements.dart';
11 import 'package:compiler/src/constants/values.dart';
12 import 'type_test_helper.dart';
13
14 void main() {
15 enableDebugMode();
16
17 asyncTest(() async {
18 TypeEnvironment env = await TypeEnvironment.create('''
19 class C {
20 final field1;
21 final field2;
22
23 C(this.field1, this.field2);
24 }
25 ''');
26 ClassElement C = env.getElement('C');
27 FieldElement field1 = C.lookupLocalMember('field1');
28 FieldElement field2 = C.lookupLocalMember('field2');
29 ConstantValue value1 = new ConstructedConstantValue(C.rawType, {
30 field1: new IntConstantValue(0),
31 field2: new IntConstantValue(1),
32 });
33 ConstantValue value2 = new ConstructedConstantValue(C.rawType, {
34 field2: new IntConstantValue(1),
35 field1: new IntConstantValue(0),
36 });
37 Expect.equals(value1.hashCode, value2.hashCode, "Hashcode mismatch.");
38 Expect.equals(value1, value2, "Value mismatch.");
39 });
40 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/util/util.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698