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

Unified Diff: tests/compiler/dart2js/import_mirrors_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/if_do_while_test.dart ('k') | tests/compiler/dart2js/import_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/import_mirrors_test.dart
diff --git a/tests/compiler/dart2js/import_mirrors_test.dart b/tests/compiler/dart2js/import_mirrors_test.dart
index 9c42114605a07c3bcd07ba1a9710a279d741b7f8..e6d5fac596221a87a5a66b6118a7f990098f6c93 100644
--- a/tests/compiler/dart2js/import_mirrors_test.dart
+++ b/tests/compiler/dart2js/import_mirrors_test.dart
@@ -10,9 +10,8 @@ library dart2js.test.import_mirrors;
import 'dart:async';
import 'package:expect/expect.dart';
import 'package:async_helper/async_helper.dart';
-import 'package:compiler/src/diagnostics/messages.dart' show
- MessageKind,
- MessageTemplate;
+import 'package:compiler/src/diagnostics/messages.dart'
+ show MessageKind, MessageTemplate;
import 'memory_compiler.dart';
const DIRECT_IMPORT = const {
@@ -21,9 +20,7 @@ import 'dart:mirrors';
main() {}
''',
-
- 'paths':
- "main.dart => dart:mirrors",
+ 'paths': "main.dart => dart:mirrors",
};
const INDIRECT_IMPORT1 = const {
@@ -35,11 +32,8 @@ main() {}
'/first.dart': '''
import 'dart:mirrors';
''',
-
- 'paths':
- "first.dart => dart:mirrors",
- 'verbosePaths':
- "main.dart => first.dart => dart:mirrors",
+ 'paths': "first.dart => dart:mirrors",
+ 'verbosePaths': "main.dart => first.dart => dart:mirrors",
};
const INDIRECT_IMPORT2 = const {
@@ -54,11 +48,8 @@ import 'second.dart';
'/second.dart': '''
import 'dart:mirrors';
''',
-
- 'paths':
- "second.dart => dart:mirrors",
- 'verbosePaths':
- "main.dart => first.dart => second.dart => dart:mirrors",
+ 'paths': "second.dart => dart:mirrors",
+ 'verbosePaths': "main.dart => first.dart => second.dart => dart:mirrors",
};
const INDIRECT_PACKAGE_IMPORT1 = const {
@@ -73,9 +64,7 @@ import 'package:second/second.dart';
'/pkg/second/second.dart': '''
import 'dart:mirrors';
''',
-
- 'paths':
- "first.dart => package:second => dart:mirrors",
+ 'paths': "first.dart => package:second => dart:mirrors",
'verbosePaths':
"main.dart => first.dart => package:second/second.dart => dart:mirrors",
};
@@ -92,11 +81,8 @@ import 'package:packagename/second.dart';
'/pkg/packagename/second.dart': '''
import 'dart:mirrors';
''',
-
- 'paths':
- "first.dart => package:packagename => dart:mirrors",
- 'verbosePaths':
- "main.dart => first.dart => package:packagename/second.dart "
+ 'paths': "first.dart => package:packagename => dart:mirrors",
+ 'verbosePaths': "main.dart => first.dart => package:packagename/second.dart "
"=> dart:mirrors",
};
@@ -115,11 +101,8 @@ import 'package:package2/third.dart';
'/pkg/package2/third.dart': '''
import 'dart:mirrors';
''',
-
- 'paths':
- "first.dart => package:package1 => package:package2 => dart:mirrors",
- 'verbosePaths':
- "main.dart => first.dart => package:package1/second.dart "
+ 'paths': "first.dart => package:package1 => package:package2 => dart:mirrors",
+ 'verbosePaths': "main.dart => first.dart => package:package1/second.dart "
"=> package:package2/third.dart => dart:mirrors",
};
@@ -144,11 +127,8 @@ import 'lib/src/fifth.dart';
'/pkg/package2/lib/src/fifth.dart': '''
import 'dart:mirrors';
''',
-
- 'paths':
- "first.dart => package:package1 => package:package2 => dart:mirrors",
- 'verbosePaths':
- "main.dart => first.dart => package:package1/second.dart "
+ 'paths': "first.dart => package:package1 => package:package2 => dart:mirrors",
+ 'verbosePaths': "main.dart => first.dart => package:package1/second.dart "
"=> package:package1/sub/third.dart => package:package2/fourth.dart "
"=> package:package2/lib/src/fifth.dart => dart:mirrors",
};
@@ -160,9 +140,7 @@ import 'dart:mirrors';
main() {}
''',
-
- 'paths':
- "main.dart => dart:mirrors",
+ 'paths': "main.dart => dart:mirrors",
};
const DUAL_INDIRECT_IMPORT1 = const {
@@ -175,13 +153,11 @@ main() {}
'/first.dart': '''
import 'dart:mirrors';
''',
-
- 'paths': const
- ["main.dart => dart:mirrors",
- "first.dart => dart:mirrors"],
- 'verbosePaths': const
- ["main.dart => dart:mirrors",
- "main.dart => first.dart => dart:mirrors"],
+ 'paths': const ["main.dart => dart:mirrors", "first.dart => dart:mirrors"],
+ 'verbosePaths': const [
+ "main.dart => dart:mirrors",
+ "main.dart => first.dart => dart:mirrors"
+ ],
};
const DUAL_INDIRECT_IMPORT2 = const {
@@ -197,13 +173,11 @@ import 'dart:mirrors';
'/second.dart': '''
import 'dart:mirrors';
''',
-
- 'paths': const
- ["first.dart => dart:mirrors",
- "second.dart => dart:mirrors"],
- 'verbosePaths': const
- ["main.dart => first.dart => dart:mirrors",
- "main.dart => second.dart => dart:mirrors"],
+ 'paths': const ["first.dart => dart:mirrors", "second.dart => dart:mirrors"],
+ 'verbosePaths': const [
+ "main.dart => first.dart => dart:mirrors",
+ "main.dart => second.dart => dart:mirrors"
+ ],
};
const DUAL_INDIRECT_IMPORT3 = const {
@@ -222,12 +196,11 @@ import 'third.dart';
'/third.dart': '''
import 'dart:mirrors';
''',
-
- 'paths':
- "third.dart => dart:mirrors",
- 'verbosePaths': const
- ["main.dart => first.dart => third.dart => dart:mirrors",
- "main.dart => second.dart => third.dart => dart:mirrors"],
+ 'paths': "third.dart => dart:mirrors",
+ 'verbosePaths': const [
+ "main.dart => first.dart => third.dart => dart:mirrors",
+ "main.dart => second.dart => third.dart => dart:mirrors"
+ ],
};
const DUAL_INDIRECT_PACKAGE_IMPORT1 = const {
@@ -246,13 +219,14 @@ import 'dart:mirrors';
'/pkg/package2/third.dart': '''
import 'dart:mirrors';
''',
-
- 'paths': const
- ["main.dart => package:package1 => dart:mirrors",
- "first.dart => package:package2 => dart:mirrors"],
- 'verbosePaths': const
- ["main.dart => package:package1/second.dart => dart:mirrors",
- "main.dart => first.dart => package:package2/third.dart => dart:mirrors"]
+ 'paths': const [
+ "main.dart => package:package1 => dart:mirrors",
+ "first.dart => package:package2 => dart:mirrors"
+ ],
+ 'verbosePaths': const [
+ "main.dart => package:package1/second.dart => dart:mirrors",
+ "main.dart => first.dart => package:package2/third.dart => dart:mirrors"
+ ]
};
const DIRECT_EXPORT = const {
@@ -261,9 +235,7 @@ export 'dart:mirrors';
main() {}
''',
-
- 'paths':
- "main.dart => dart:mirrors",
+ 'paths': "main.dart => dart:mirrors",
};
const INDIRECT_EXPORT1 = const {
@@ -275,11 +247,8 @@ main() {}
'/first.dart': '''
export 'dart:mirrors';
''',
-
- 'paths':
- "first.dart => dart:mirrors",
- 'verbosePaths':
- "main.dart => first.dart => dart:mirrors",
+ 'paths': "first.dart => dart:mirrors",
+ 'verbosePaths': "main.dart => first.dart => dart:mirrors",
};
const INDIRECT_EXPORT2 = const {
@@ -294,11 +263,8 @@ import 'second.dart';
'/second.dart': '''
export 'dart:mirrors';
''',
-
- 'paths':
- "second.dart => dart:mirrors",
- 'verbosePaths':
- "main.dart => first.dart => second.dart => dart:mirrors",
+ 'paths': "second.dart => dart:mirrors",
+ 'verbosePaths': "main.dart => first.dart => second.dart => dart:mirrors",
};
const INDIRECT_PACKAGE_EXPORT1 = const {
@@ -313,11 +279,8 @@ import 'package:packagename/second.dart';
'/pkg/packagename/second.dart': '''
export 'dart:mirrors';
''',
-
- 'paths':
- "first.dart => package:packagename => dart:mirrors",
- 'verbosePaths':
- "main.dart => first.dart => package:packagename/second.dart "
+ 'paths': "first.dart => package:packagename => dart:mirrors",
+ 'verbosePaths': "main.dart => first.dart => package:packagename/second.dart "
"=> dart:mirrors",
};
@@ -333,18 +296,15 @@ export 'package:packagename/second.dart';
'/pkg/packagename/second.dart': '''
import 'dart:mirrors';
''',
-
- 'paths':
- "first.dart => package:packagename => dart:mirrors",
- 'verbosePaths':
- "main.dart => first.dart => package:packagename/second.dart "
+ 'paths': "first.dart => package:packagename => dart:mirrors",
+ 'verbosePaths': "main.dart => first.dart => package:packagename/second.dart "
"=> dart:mirrors",
};
Future test(Map sourceFiles,
- {expectedPaths,
- bool verbose: false,
- bool enableExperimentalMirrors: false}) async {
+ {expectedPaths,
+ bool verbose: false,
+ bool enableExperimentalMirrors: false}) async {
if (expectedPaths is! List) {
expectedPaths = [expectedPaths];
}
@@ -364,13 +324,12 @@ Future test(Map sourceFiles,
options: options);
Expect.equals(0, collector.errors.length, 'Errors: ${collector.errors}');
if (enableExperimentalMirrors) {
- Expect.equals(0, collector.warnings.length,
- 'Warnings: ${collector.errors}');
+ Expect.equals(
+ 0, collector.warnings.length, 'Warnings: ${collector.errors}');
} else {
- Expect.equals(1, collector.warnings.length,
- 'Warnings: ${collector.errors}');
Expect.equals(
- MessageKind.IMPORT_EXPERIMENTAL_MIRRORS,
+ 1, collector.warnings.length, 'Warnings: ${collector.errors}');
+ Expect.equals(MessageKind.IMPORT_EXPERIMENTAL_MIRRORS,
collector.warnings.first.message.kind);
Expect.equals(
expectedPaths.join(MessageTemplate.IMPORT_EXPERIMENTAL_MIRRORS_PADDING),
@@ -386,8 +345,8 @@ Future checkPaths(Map sourceData) {
expectedVerbosePaths = expectedPaths;
}
return test(sourceFiles, expectedPaths: expectedPaths).then((_) {
- return test(
- sourceFiles, expectedPaths: expectedVerbosePaths, verbose: true);
+ return test(sourceFiles,
+ expectedPaths: expectedVerbosePaths, verbose: true);
}).then((_) {
return test(sourceFiles, enableExperimentalMirrors: true);
});
@@ -395,23 +354,22 @@ Future checkPaths(Map sourceData) {
void main() {
asyncTest(() => Future.forEach([
- DIRECT_IMPORT,
- INDIRECT_IMPORT1,
- INDIRECT_IMPORT2,
- INDIRECT_PACKAGE_IMPORT1,
- INDIRECT_PACKAGE_IMPORT2,
- INDIRECT_PACKAGE_IMPORT3,
- INDIRECT_PACKAGE_IMPORT4,
- DUAL_DIRECT_IMPORT,
- DUAL_INDIRECT_IMPORT1,
- DUAL_INDIRECT_IMPORT2,
- DUAL_INDIRECT_IMPORT3,
- DUAL_INDIRECT_PACKAGE_IMPORT1,
- DIRECT_EXPORT,
- INDIRECT_EXPORT1,
- INDIRECT_EXPORT2,
- INDIRECT_PACKAGE_EXPORT1,
- INDIRECT_PACKAGE_EXPORT2],
- (map) => checkPaths(map)
- ));
+ DIRECT_IMPORT,
+ INDIRECT_IMPORT1,
+ INDIRECT_IMPORT2,
+ INDIRECT_PACKAGE_IMPORT1,
+ INDIRECT_PACKAGE_IMPORT2,
+ INDIRECT_PACKAGE_IMPORT3,
+ INDIRECT_PACKAGE_IMPORT4,
+ DUAL_DIRECT_IMPORT,
+ DUAL_INDIRECT_IMPORT1,
+ DUAL_INDIRECT_IMPORT2,
+ DUAL_INDIRECT_IMPORT3,
+ DUAL_INDIRECT_PACKAGE_IMPORT1,
+ DIRECT_EXPORT,
+ INDIRECT_EXPORT1,
+ INDIRECT_EXPORT2,
+ INDIRECT_PACKAGE_EXPORT1,
+ INDIRECT_PACKAGE_EXPORT2
+ ], (map) => checkPaths(map)));
}
« no previous file with comments | « tests/compiler/dart2js/if_do_while_test.dart ('k') | tests/compiler/dart2js/import_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698