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

Unified Diff: tests/compiler/dart2js/in_user_code_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/import_test.dart ('k') | tests/compiler/dart2js/incremental/compile_all.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/compiler/dart2js/in_user_code_test.dart
diff --git a/tests/compiler/dart2js/in_user_code_test.dart b/tests/compiler/dart2js/in_user_code_test.dart
index 0a6e13f2fbe337d61f15b35ea86c5d040b58185e..486d3ec771995efbfc873f3db16abf256ad362ab 100644
--- a/tests/compiler/dart2js/in_user_code_test.dart
+++ b/tests/compiler/dart2js/in_user_code_test.dart
@@ -23,22 +23,18 @@ import 'package:sup/boz.dart';
main() {}
""",
-
'foo.dart': """
library foo;
""",
-
'pkg/sub/bar.dart': """
library sub.bar;
import 'package:sup/boz.dart';
import 'baz.dart';
""",
-
'pkg/sub/baz.dart': """
library sub.baz;
""",
-
'pkg/sup/boz.dart': """
library sup.boz;
""",
@@ -46,17 +42,20 @@ library sup.boz;
Future test(List<Uri> entryPoints, Map<String, bool> expectedResults) async {
CompilationResult result = await runCompiler(
- entryPoints: entryPoints,
- memorySourceFiles: SOURCE,
- options: [Flags.analyzeOnly, Flags.analyzeAll],
- packageRoot: Uri.parse('memory:pkg/'));
+ entryPoints: entryPoints,
+ memorySourceFiles: SOURCE,
+ options: [Flags.analyzeOnly, Flags.analyzeAll],
+ packageRoot: Uri.parse('memory:pkg/'));
Compiler compiler = result.compiler;
expectedResults.forEach((String uri, bool expectedResult) {
var element = compiler.libraryLoader.lookupLibrary(Uri.parse(uri));
Expect.isNotNull(element, "Unknown library '$uri'.");
- Expect.equals(expectedResult, compiler.inUserCode(element),
- expectedResult ? "Library '$uri' expected to be in user code"
- : "Library '$uri' not expected to be in user code");
+ Expect.equals(
+ expectedResult,
+ compiler.inUserCode(element),
+ expectedResult
+ ? "Library '$uri' expected to be in user code"
+ : "Library '$uri' not expected to be in user code");
});
}
@@ -65,39 +64,46 @@ void main() {
}
Future runTests() async {
+ await test([
+ Uri.parse('memory:main.dart')
+ ], {
+ 'memory:main.dart': true,
+ 'memory:foo.dart': true,
+ 'memory:pkg/sub/bar.dart': true,
+ 'memory:pkg/sub/baz.dart': true,
+ 'package:sub/bar.dart': false,
+ 'package:sub/baz.dart': false,
+ 'package:sup/boz.dart': false,
+ 'dart:core': false,
+ 'dart:async': false
+ });
await test(
- [Uri.parse('memory:main.dart')],
- {'memory:main.dart': true,
- 'memory:foo.dart': true,
- 'memory:pkg/sub/bar.dart': true,
- 'memory:pkg/sub/baz.dart': true,
- 'package:sub/bar.dart': false,
- 'package:sub/baz.dart': false,
- 'package:sup/boz.dart': false,
- 'dart:core': false,
- 'dart:async': false});
- await test(
- [Uri.parse('dart:async')],
- {'dart:core': true,
- 'dart:async': true});
- await test(
- [Uri.parse('package:sub/bar.dart')],
- {'package:sub/bar.dart': true,
- 'package:sub/baz.dart': true,
- 'package:sup/boz.dart': false,
- 'dart:core': false});
- await test(
- [Uri.parse('package:sub/bar.dart'), Uri.parse('package:sup/boz.dart')],
- {'package:sub/bar.dart': true,
- 'package:sub/baz.dart': true,
- 'package:sup/boz.dart': true,
- 'dart:core': false});
- await test(
- [Uri.parse('dart:async'), Uri.parse('package:sub/bar.dart')],
- {'package:sub/bar.dart': true,
- 'package:sub/baz.dart': true,
- 'package:sup/boz.dart': false,
- 'dart:core': true,
- 'dart:async': true});
+ [Uri.parse('dart:async')], {'dart:core': true, 'dart:async': true});
+ await test([
+ Uri.parse('package:sub/bar.dart')
+ ], {
+ 'package:sub/bar.dart': true,
+ 'package:sub/baz.dart': true,
+ 'package:sup/boz.dart': false,
+ 'dart:core': false
+ });
+ await test([
+ Uri.parse('package:sub/bar.dart'),
+ Uri.parse('package:sup/boz.dart')
+ ], {
+ 'package:sub/bar.dart': true,
+ 'package:sub/baz.dart': true,
+ 'package:sup/boz.dart': true,
+ 'dart:core': false
+ });
+ await test([
+ Uri.parse('dart:async'),
+ Uri.parse('package:sub/bar.dart')
+ ], {
+ 'package:sub/bar.dart': true,
+ 'package:sub/baz.dart': true,
+ 'package:sup/boz.dart': false,
+ 'dart:core': true,
+ 'dart:async': true
+ });
}
-
« no previous file with comments | « tests/compiler/dart2js/import_test.dart ('k') | tests/compiler/dart2js/incremental/compile_all.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698