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

Side by Side Diff: tests/compiler/dart2js/constant_expression_evaluate_test.dart

Issue 1916053003: Add toStructuredText to ConstantExpression and align method names with ConstantValue (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: dartfmt Created 4 years, 8 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
OLDNEW
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';
(...skipping 209 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 Compiler compiler = result.compiler; 220 Compiler compiler = result.compiler;
221 var library = compiler.mainApp; 221 var library = compiler.mainApp;
222 constants.forEach((String name, ConstantData data) { 222 constants.forEach((String name, ConstantData data) {
223 FieldElement field = library.localLookup(name); 223 FieldElement field = library.localLookup(name);
224 ConstantExpression constant = field.constant; 224 ConstantExpression constant = field.constant;
225 data.expectedValues.forEach( 225 data.expectedValues.forEach(
226 (Map<String, String> env, String expectedText) { 226 (Map<String, String> env, String expectedText) {
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.toStructuredText();
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.toDartText()}`, expected '${expectedText}'.");
234 }); 234 });
235 }); 235 });
236 } 236 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/const_exp_test.dart ('k') | tests/compiler/dart2js/constant_expression_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698