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

Unified Diff: tests/compiler/dart2js/source_mapping_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
Index: tests/compiler/dart2js/source_mapping_test.dart
diff --git a/tests/compiler/dart2js/source_mapping_test.dart b/tests/compiler/dart2js/source_mapping_test.dart
index c061f9949ece2029a7cbe174f84913e451eb54e4..db0855154683a98f10be25f396f7779c961fe59e 100644
--- a/tests/compiler/dart2js/source_mapping_test.dart
+++ b/tests/compiler/dart2js/source_mapping_test.dart
@@ -9,8 +9,8 @@ import 'package:compiler/src/io/code_output.dart';
import 'package:compiler/src/io/source_file.dart';
import 'package:compiler/src/io/source_information.dart';
import 'package:compiler/src/js_backend/js_backend.dart';
-import 'package:compiler/src/js_emitter/full_emitter/emitter.dart'
- as full show Emitter;
+import 'package:compiler/src/js_emitter/full_emitter/emitter.dart' as full
+ show Emitter;
import 'mock_compiler.dart';
@@ -23,8 +23,7 @@ Future<CodeBuffer> compileAll(SourceFile sourceFile) {
// TODO(floitsch): the outputBuffers are only accessible in the full
// emitter.
full.Emitter fullEmitter = backend.emitter.emitter;
- return fullEmitter
- .outputBuffers[compiler.deferredLoadTask.mainOutputUnit];
+ return fullEmitter.outputBuffers[compiler.deferredLoadTask.mainOutputUnit];
});
}
@@ -39,26 +38,27 @@ void testSourceMapLocations(String codeWithMarkers) {
SourceFile sourceFile = new StringSourceFile.fromName('<test script>', code);
asyncTest(() => compileAll(sourceFile).then((CodeOutput output) {
- Set<int> locations = new Set<int>();
- output.forEachSourceLocation((int offset, SourceLocation sourcePosition) {
- if (sourcePosition != null &&
- sourcePosition.sourceUri == sourceFile.uri) {
- locations.add(sourcePosition.offset);
- }
- });
-
- for (int i = 0; i < expectedLocations.length; ++i) {
- int expectedLocation = expectedLocations[i];
- if (!locations.contains(expectedLocation)) {
- int originalLocation = expectedLocation + i;
- SourceFile sourceFileWithMarkers =
- new StringSourceFile.fromName('<test script>', codeWithMarkers);
- String message = sourceFileWithMarkers.getLocationMessage(
- 'Missing location', originalLocation, originalLocation + 1);
- Expect.fail(message);
- }
- }
- }));
+ Set<int> locations = new Set<int>();
+ output
+ .forEachSourceLocation((int offset, SourceLocation sourcePosition) {
+ if (sourcePosition != null &&
+ sourcePosition.sourceUri == sourceFile.uri) {
+ locations.add(sourcePosition.offset);
+ }
+ });
+
+ for (int i = 0; i < expectedLocations.length; ++i) {
+ int expectedLocation = expectedLocations[i];
+ if (!locations.contains(expectedLocation)) {
+ int originalLocation = expectedLocation + i;
+ SourceFile sourceFileWithMarkers =
+ new StringSourceFile.fromName('<test script>', codeWithMarkers);
+ String message = sourceFileWithMarkers.getLocationMessage(
+ 'Missing location', originalLocation, originalLocation + 1);
+ Expect.fail(message);
+ }
+ }
+ }));
}
String FUNCTIONS_TEST = '''
@@ -72,7 +72,8 @@ String NOT_TEST = 'void main() { ((x) { if (@!x) print(x); })(1==2); }';
String UNARY_TEST = 'void main() { ((x, y) { print(@-x + @~y); })(1,2); }';
-String BINARY_TEST = 'void main() { ((x, y) { if (x @!= y) print(x @* y); })(1,2); }';
+String BINARY_TEST =
+ 'void main() { ((x, y) { if (x @!= y) print(x @* y); })(1,2); }';
String SEND_TEST = '''
void main() {
« no previous file with comments | « tests/compiler/dart2js/source_map_validator_test_file.dart ('k') | tests/compiler/dart2js/sourcemaps/colors.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698