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

Side by Side Diff: tests/compiler/dart2js/list_tracer2_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 unified diff | Download patch
« no previous file with comments | « tests/compiler/dart2js/link_test.dart ('k') | tests/compiler/dart2js/list_tracer3_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 // We used to always nullify the element type of a list we are tracing in 5 // We used to always nullify the element type of a list we are tracing in
6 // the presence of a fixed length list constructor call. 6 // the presence of a fixed length list constructor call.
7 7
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 import "package:async_helper/async_helper.dart"; 9 import "package:async_helper/async_helper.dart";
10 import 'package:compiler/src/types/types.dart' 10 import 'package:compiler/src/types/types.dart' show ContainerTypeMask, TypeMask;
11 show ContainerTypeMask, TypeMask;
12 11
13 import 'compiler_helper.dart'; 12 import 'compiler_helper.dart';
14 import 'type_mask_test_helper.dart'; 13 import 'type_mask_test_helper.dart';
15 14
16 const String TEST = r''' 15 const String TEST = r'''
17 var myList = [42]; 16 var myList = [42];
18 main() { 17 main() {
19 var a = new List(42); 18 var a = new List(42);
20 return myList[0]; 19 return myList[0];
21 } 20 }
22 '''; 21 ''';
23 22
24 void main() { 23 void main() {
25 Uri uri = new Uri(scheme: 'source'); 24 Uri uri = new Uri(scheme: 'source');
26 var compiler = compilerFor(TEST, uri); 25 var compiler = compilerFor(TEST, uri);
27 asyncTest(() => compiler.run(uri).then((_) { 26 asyncTest(() => compiler.run(uri).then((_) {
28 var typesInferrer = compiler.globalInference.typesInferrer; 27 var typesInferrer = compiler.globalInference.typesInferrer;
29 28
30 checkType(String name, type) { 29 checkType(String name, type) {
31 var element = findElement(compiler, name); 30 var element = findElement(compiler, name);
32 ContainerTypeMask mask = typesInferrer.getTypeOfElement(element); 31 ContainerTypeMask mask = typesInferrer.getTypeOfElement(element);
33 Expect.equals(type, simplify(mask.elementType, compiler), name); 32 Expect.equals(type, simplify(mask.elementType, compiler), name);
34 } 33 }
35 34
36 checkType('myList', compiler.commonMasks.uint31Type); 35 checkType('myList', compiler.commonMasks.uint31Type);
37 })); 36 }));
38 } 37 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/link_test.dart ('k') | tests/compiler/dart2js/list_tracer3_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698