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

Unified Diff: tests/compiler/dart2js/concrete_type_inference_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/compiler_helper.dart ('k') | tests/compiler/dart2js/const_exp_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/concrete_type_inference_test.dart
diff --git a/tests/compiler/dart2js/concrete_type_inference_test.dart b/tests/compiler/dart2js/concrete_type_inference_test.dart
index 6a142cd98baa3d0ec1496a3b7bb29c7e30c251f3..1be4e18f37f7b29b2ff4fc546a25c2f4f8cac542 100644
--- a/tests/compiler/dart2js/concrete_type_inference_test.dart
+++ b/tests/compiler/dart2js/concrete_type_inference_test.dart
@@ -7,8 +7,7 @@ import 'package:expect/expect.dart';
import 'package:async_helper/async_helper.dart';
import 'compiler_helper.dart';
-Future compileAndFind(String code, String name,
- check(compiler, element)) {
+Future compileAndFind(String code, String name, check(compiler, element)) {
Uri uri = new Uri(scheme: 'source');
var compiler = compilerFor(code, uri);
return compiler.run(uri).then((_) {
@@ -18,36 +17,26 @@ Future compileAndFind(String code, String name,
}
void checkPrintType(String expression, checkType(compiler, type)) {
- asyncTest(() => compileAndFind(
- 'main() { print($expression); }',
- 'print',
- (compiler, printElement) {
- var parameter =
- printElement.functionSignature.requiredParameters.first;
- var type =
- compiler.globalInference.results.typeOf(parameter);
+ asyncTest(() => compileAndFind('main() { print($expression); }', 'print',
+ (compiler, printElement) {
+ var parameter = printElement.functionSignature.requiredParameters.first;
+ var type = compiler.globalInference.results.typeOf(parameter);
checkType(compiler, type);
}));
- asyncTest(() => compileAndFind(
- 'main() { var x = print; print($expression); }',
- 'print',
- (compiler, printElement) {
- var parameter =
- printElement.functionSignature.requiredParameters.first;
- var type =
- compiler.globalInference.results.typeOf(parameter);
+ asyncTest(() =>
+ compileAndFind('main() { var x = print; print($expression); }', 'print',
+ (compiler, printElement) {
+ var parameter = printElement.functionSignature.requiredParameters.first;
+ var type = compiler.globalInference.results.typeOf(parameter);
checkType(compiler, type);
}));
asyncTest(() => compileAndFind(
- 'main() { print($expression); print($expression); }',
- 'print',
- (compiler, printElement) {
- var parameter =
- printElement.functionSignature.requiredParameters.first;
- var type =
- compiler.globalInference.results.typeOf(parameter);
+ 'main() { print($expression); print($expression); }', 'print',
+ (compiler, printElement) {
+ var parameter = printElement.functionSignature.requiredParameters.first;
+ var type = compiler.globalInference.results.typeOf(parameter);
checkType(compiler, type);
}));
}
@@ -77,28 +66,20 @@ void testBasicTypes() {
}
void testOptionalParameters() {
- compileAndFind(
- 'fisk(a, [b, c]) {} main() { fisk(1); }',
- 'fisk',
+ compileAndFind('fisk(a, [b, c]) {} main() { fisk(1); }', 'fisk',
(compiler, fiskElement) {
- var firstParameter = fiskElement.functionSignature
- .requiredParameters[0];
- var secondParameter = fiskElement.functionSignature
- .optionalParameters[0];
- var thirdParameter = fiskElement.functionSignature
- .optionalParameters[1];
- var commonMasks = compiler.commonMasks;
- var inference = compiler.globalInference;
- Expect.identical(
- commonMasks.uint31Type,
- inference.results.typeOf(firstParameter));
- Expect.identical(
- commonMasks.nullType,
- inference.results.typeOf(secondParameter));
- Expect.identical(
- commonMasks.nullType,
- inference.results.typeOf(thirdParameter));
- });
+ var firstParameter = fiskElement.functionSignature.requiredParameters[0];
+ var secondParameter = fiskElement.functionSignature.optionalParameters[0];
+ var thirdParameter = fiskElement.functionSignature.optionalParameters[1];
+ var commonMasks = compiler.commonMasks;
+ var inference = compiler.globalInference;
+ Expect.identical(
+ commonMasks.uint31Type, inference.results.typeOf(firstParameter));
+ Expect.identical(
+ commonMasks.nullType, inference.results.typeOf(secondParameter));
+ Expect.identical(
+ commonMasks.nullType, inference.results.typeOf(thirdParameter));
+ });
}
void main() {
« no previous file with comments | « tests/compiler/dart2js/compiler_helper.dart ('k') | tests/compiler/dart2js/const_exp_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698