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

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

Issue 2653203002: Use entities in CommonElements interface. (Closed)
Patch Set: Created 3 years, 11 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) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, 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 import 'dart:async'; 5 import 'dart:async';
6 6
7 import 'package:async_helper/async_helper.dart'; 7 import 'package:async_helper/async_helper.dart';
8 import 'package:expect/expect.dart'; 8 import 'package:expect/expect.dart';
9 9
10 import 'package:compiler/src/elements/resolution_types.dart'; 10 import 'package:compiler/src/elements/resolution_types.dart';
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 testTypePromotionHints, 64 testTypePromotionHints,
65 testFunctionCall, 65 testFunctionCall,
66 testCascade, 66 testCascade,
67 testAwait, 67 testAwait,
68 testAsyncReturn 68 testAsyncReturn
69 ]; 69 ];
70 asyncTest(() => Future.forEach(tests, (test) => setup(test))); 70 asyncTest(() => Future.forEach(tests, (test) => setup(test)));
71 } 71 }
72 72
73 testSimpleTypes(MockCompiler compiler) { 73 testSimpleTypes(MockCompiler compiler) {
74 checkType(ResolutionDartType type, String code) { 74 checkType(ResolutionInterfaceType type, String code) {
75 Expect.equals(type, analyzeType(compiler, code)); 75 Expect.equals(type, analyzeType(compiler, code));
76 } 76 }
77 77
78 checkType(compiler.commonElements.intType, "3"); 78 checkType(compiler.commonElements.intType, "3");
79 checkType(compiler.commonElements.boolType, "false"); 79 checkType(compiler.commonElements.boolType, "false");
80 checkType(compiler.commonElements.boolType, "true"); 80 checkType(compiler.commonElements.boolType, "true");
81 checkType(compiler.commonElements.stringType, "'hestfisk'"); 81 checkType(compiler.commonElements.stringType, "'hestfisk'");
82 } 82 }
83 83
84 Future testReturn(MockCompiler compiler) { 84 Future testReturn(MockCompiler compiler) {
(...skipping 2690 matching lines...) Expand 10 before | Expand all | Expand 10 after
2775 TreeElements elements = compiler.resolveNodeStatement(node, element); 2775 TreeElements elements = compiler.resolveNodeStatement(node, element);
2776 TypeCheckerVisitor checker = 2776 TypeCheckerVisitor checker =
2777 new TypeCheckerVisitor(compiler, elements, compiler.types); 2777 new TypeCheckerVisitor(compiler, elements, compiler.types);
2778 DiagnosticCollector collector = compiler.diagnosticCollector; 2778 DiagnosticCollector collector = compiler.diagnosticCollector;
2779 collector.clear(); 2779 collector.clear();
2780 checker.analyze(node, mustHaveType: false); 2780 checker.analyze(node, mustHaveType: false);
2781 generateOutput(compiler, text); 2781 generateOutput(compiler, text);
2782 compareWarningKinds(text, warnings, collector.warnings); 2782 compareWarningKinds(text, warnings, collector.warnings);
2783 compareWarningKinds(text, hints, collector.hints); 2783 compareWarningKinds(text, hints, collector.hints);
2784 } 2784 }
OLDNEW
« no previous file with comments | « tests/compiler/dart2js/related_types.dart ('k') | tests/compiler/dart2js/type_combination_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698