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 |
+ }); |
} |
- |