OLD | NEW |
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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 library dart2js.constants.expressions.evaluate_test; | 5 library dart2js.constants.expressions.evaluate_test; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 import 'package:async_helper/async_helper.dart'; | 8 import 'package:async_helper/async_helper.dart'; |
9 import 'package:expect/expect.dart'; | 9 import 'package:expect/expect.dart'; |
10 import 'package:compiler/src/constants/evaluation.dart'; | 10 import 'package:compiler/src/constants/evaluation.dart'; |
11 import 'package:compiler/src/constants/expressions.dart'; | 11 import 'package:compiler/src/constants/expressions.dart'; |
12 import 'package:compiler/src/constants/values.dart'; | 12 import 'package:compiler/src/constants/values.dart'; |
13 import 'package:compiler/src/constant_system_dart.dart'; | 13 import 'package:compiler/src/constant_system_dart.dart'; |
14 import 'package:compiler/src/dart2jslib.dart'; | 14 import 'package:compiler/src/compiler.dart'; |
15 import 'package:compiler/src/elements/elements.dart'; | 15 import 'package:compiler/src/elements/elements.dart'; |
16 import 'memory_compiler.dart'; | 16 import 'memory_compiler.dart'; |
17 | 17 |
18 class TestData { | 18 class TestData { |
19 /// Declarations needed for the [constants]. | 19 /// Declarations needed for the [constants]. |
20 final String declarations; | 20 final String declarations; |
21 /// Tested constants. | 21 /// Tested constants. |
22 final List constants; | 22 final List constants; |
23 | 23 |
24 const TestData(this.declarations, this.constants); | 24 const TestData(this.declarations, this.constants); |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 Environment environment = new MemoryEnvironment(compiler, env); | 227 Environment environment = new MemoryEnvironment(compiler, env); |
228 ConstantValue value = | 228 ConstantValue value = |
229 constant.evaluate(environment, DART_CONSTANT_SYSTEM); | 229 constant.evaluate(environment, DART_CONSTANT_SYSTEM); |
230 String valueText = value.toStructuredString(); | 230 String valueText = value.toStructuredString(); |
231 Expect.equals(expectedText, valueText, | 231 Expect.equals(expectedText, valueText, |
232 "Unexpected value '${valueText}' for contant " | 232 "Unexpected value '${valueText}' for contant " |
233 "`${constant.getText()}`, expected '${expectedText}'."); | 233 "`${constant.getText()}`, expected '${expectedText}'."); |
234 }); | 234 }); |
235 }); | 235 }); |
236 } | 236 } |
OLD | NEW |