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

Unified Diff: tests/compiler/dart2js/map_tracer_keys_test.dart

Issue 2345083003: dart2js: run dartfmt on tests (Closed)
Patch Set: revert another multipart test Created 4 years, 3 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 | « tests/compiler/dart2js/map_tracer_const_test.dart ('k') | tests/compiler/dart2js/map_tracer_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/map_tracer_keys_test.dart
diff --git a/tests/compiler/dart2js/map_tracer_keys_test.dart b/tests/compiler/dart2js/map_tracer_keys_test.dart
index 4f429d3f2a281dce76ce6407beeab7886cf8f15e..4516fb3bb0801742c28db794d3d9b07c26fb814e 100644
--- a/tests/compiler/dart2js/map_tracer_keys_test.dart
+++ b/tests/compiler/dart2js/map_tracer_keys_test.dart
@@ -4,12 +4,10 @@
import 'package:expect/expect.dart';
import "package:async_helper/async_helper.dart";
-import 'package:compiler/src/types/types.dart'
- show ContainerTypeMask, TypeMask;
+import 'package:compiler/src/types/types.dart' show ContainerTypeMask, TypeMask;
import 'compiler_helper.dart';
-
String generateTest(String key, String value, bool initial) {
return """
double aDouble = 42.5;
@@ -18,15 +16,16 @@ List aList = [42];
consume(x) => x;
main() {
-""" + (initial ?
-"""
+""" +
+ (initial
+ ? """
var theMap = {'a': 2.2, 'b': 3.3, 'c': 4.4, $key: $value};
-""" :
"""
+ : """
var theMap = {'a': 2.2, 'b': 3.3, 'c': 4.4};
theMap[$key] = $value;
""") +
-"""
+ """
for (var key in theMap.keys) {
aDouble = theMap[key];
}
@@ -49,27 +48,30 @@ void main() {
doTest(value: "aList", initial: true);
}
-void doTest({String key: "'d'", String value: "5.5", bool bail: false,
- bool initial: false}) {
+void doTest(
+ {String key: "'d'",
+ String value: "5.5",
+ bool bail: false,
+ bool initial: false}) {
Uri uri = new Uri(scheme: 'source');
var compiler = compilerFor(generateTest(key, value, initial), uri,
expectedErrors: 0, expectedWarnings: 0);
asyncTest(() => compiler.run(uri).then((_) {
- var commonMasks = compiler.commonMasks;
- var typesInferrer = compiler.globalInference.typesInferrer;
- var aDoubleType =
- typesInferrer.getTypeOfElement(findElement(compiler, 'aDouble'));
- var aListType =
- typesInferrer.getTypeOfElement(findElement(compiler, 'aList'));
+ var commonMasks = compiler.commonMasks;
+ var typesInferrer = compiler.globalInference.typesInferrer;
+ var aDoubleType =
+ typesInferrer.getTypeOfElement(findElement(compiler, 'aDouble'));
+ var aListType =
+ typesInferrer.getTypeOfElement(findElement(compiler, 'aList'));
- Expect.equals(aDoubleType, commonMasks.doubleType);
- Expect.isTrue(aListType is ContainerTypeMask);
- ContainerTypeMask container = aListType;
- TypeMask elementType = container.elementType;
- if (bail) {
- Expect.equals(elementType, commonMasks.dynamicType);
- } else {
- Expect.equals(elementType, commonMasks.uint31Type);
- }
- }));
+ Expect.equals(aDoubleType, commonMasks.doubleType);
+ Expect.isTrue(aListType is ContainerTypeMask);
+ ContainerTypeMask container = aListType;
+ TypeMask elementType = container.elementType;
+ if (bail) {
+ Expect.equals(elementType, commonMasks.dynamicType);
+ } else {
+ Expect.equals(elementType, commonMasks.uint31Type);
+ }
+ }));
}
« no previous file with comments | « tests/compiler/dart2js/map_tracer_const_test.dart ('k') | tests/compiler/dart2js/map_tracer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698