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

Unified Diff: tests/compiler/dart2js/type_test_helper.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
Index: tests/compiler/dart2js/type_test_helper.dart
diff --git a/tests/compiler/dart2js/type_test_helper.dart b/tests/compiler/dart2js/type_test_helper.dart
index 5e91f774939c3dbf5f7c17959b033e828f552de9..cc0ae9093ed3c9868627c969682a8de905e24ebd 100644
--- a/tests/compiler/dart2js/type_test_helper.dart
+++ b/tests/compiler/dart2js/type_test_helper.dart
@@ -11,16 +11,12 @@ import 'memory_compiler.dart' as memory;
import 'package:compiler/src/common/resolution.dart';
import 'package:compiler/src/commandline_options.dart';
import 'package:compiler/src/dart_types.dart';
-import 'package:compiler/src/compiler.dart'
- show Compiler;
+import 'package:compiler/src/compiler.dart' show Compiler;
import 'package:compiler/src/elements/elements.dart'
- show Element,
- MemberElement,
- TypeDeclarationElement,
- ClassElement;
+ show Element, MemberElement, TypeDeclarationElement, ClassElement;
-GenericType instantiate(TypeDeclarationElement element,
- List<DartType> arguments) {
+GenericType instantiate(
+ TypeDeclarationElement element, List<DartType> arguments) {
if (element.isClass) {
return new InterfaceType(element, arguments);
} else {
@@ -34,12 +30,12 @@ class TypeEnvironment {
Resolution get resolution => compiler.resolution;
- static Future<TypeEnvironment> create(
- String source, {bool useMockCompiler: true,
- bool expectNoErrors: false,
- bool expectNoWarningsOrErrors: false,
- bool stopAfterTypeInference: false,
- String mainSource}) {
+ static Future<TypeEnvironment> create(String source,
+ {bool useMockCompiler: true,
+ bool expectNoErrors: false,
+ bool expectNoWarningsOrErrors: false,
+ bool stopAfterTypeInference: false,
+ String mainSource}) {
Uri uri;
Compiler compiler;
bool stopAfterTypeInference = mainSource != null;
@@ -53,9 +49,7 @@ class TypeEnvironment {
memory.DiagnosticCollector collector;
if (useMockCompiler) {
uri = new Uri(scheme: 'source');
- mock.MockCompiler mockCompiler = mock.compilerFor(
- source,
- uri,
+ mock.MockCompiler mockCompiler = mock.compilerFor(source, uri,
analyzeAll: !stopAfterTypeInference,
analyzeOnly: !stopAfterTypeInference);
mockCompiler.diagnosticHandler = mock.createHandler(mockCompiler, source);
@@ -69,19 +63,18 @@ class TypeEnvironment {
memorySourceFiles: {'main.dart': source},
diagnosticHandler: collector,
options: stopAfterTypeInference
- ? [] : [Flags.analyzeAll, Flags.analyzeOnly]);
+ ? []
+ : [Flags.analyzeAll, Flags.analyzeOnly]);
}
compiler.stopAfterTypeInference = stopAfterTypeInference;
return compiler.run(uri).then((_) {
if (expectNoErrors || expectNoWarningsOrErrors) {
var errors = collector.errors;
- Expect.isTrue(errors.isEmpty,
- 'Unexpected errors: ${errors}');
+ Expect.isTrue(errors.isEmpty, 'Unexpected errors: ${errors}');
}
if (expectNoWarningsOrErrors) {
var warnings = collector.warnings;
- Expect.isTrue(warnings.isEmpty,
- 'Unexpected warnings: ${warnings}');
+ Expect.isTrue(warnings.isEmpty, 'Unexpected warnings: ${warnings}');
}
return new TypeEnvironment._(compiler);
});
@@ -105,7 +98,7 @@ class TypeEnvironment {
return element.computeType(compiler.resolution);
}
- DartType operator[] (String name) {
+ DartType operator [](String name) {
if (name == 'dynamic') return const DynamicType();
if (name == 'void') return const VoidType();
return getElementType(name);
@@ -132,11 +125,9 @@ class TypeEnvironment {
return compiler.types.flatten(T);
}
- FunctionType functionType(DartType returnType,
- List<DartType> parameters,
- {List<DartType> optionalParameters:
- const <DartType>[],
- Map<String,DartType> namedParameters}) {
+ FunctionType functionType(DartType returnType, List<DartType> parameters,
+ {List<DartType> optionalParameters: const <DartType>[],
+ Map<String, DartType> namedParameters}) {
List<String> namedParameterNames = <String>[];
List<DartType> namedParameterTypes = <DartType>[];
if (namedParameters != null) {
@@ -145,8 +136,7 @@ class TypeEnvironment {
namedParameterTypes.add(type);
});
}
- return new FunctionType.synthesized(
- returnType, parameters, optionalParameters,
- namedParameterNames, namedParameterTypes);
+ return new FunctionType.synthesized(returnType, parameters,
+ optionalParameters, namedParameterNames, namedParameterTypes);
}
}
« no previous file with comments | « tests/compiler/dart2js/type_substitution_test.dart ('k') | tests/compiler/dart2js/type_variable_bound_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698