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

Unified Diff: pkg/analyzer/test/src/task/dart_test.dart

Issue 1181663004: Fix for explicit dart:core import. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 6 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 | « pkg/analyzer/test/generated/static_warning_code_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/test/src/task/dart_test.dart
diff --git a/pkg/analyzer/test/src/task/dart_test.dart b/pkg/analyzer/test/src/task/dart_test.dart
index 096ca3d75193d9a58a93b71c35d9ce4320025602..81119c63ad80801b296dc9177fb6cd44aca2d50b 100644
--- a/pkg/analyzer/test/src/task/dart_test.dart
+++ b/pkg/analyzer/test/src/task/dart_test.dart
@@ -360,6 +360,7 @@ library libC;
List<ImportElement> imports = libraryElementA.imports;
expect(imports, hasLength(2));
expect(imports[1].importedLibrary.isDartCore, isTrue);
+ expect(imports[1].isSynthetic, isTrue);
}
}
@@ -452,6 +453,28 @@ part of notLib;
_assertErrorsWithCodes([CompileTimeErrorCode.IMPORT_OF_NON_LIBRARY]);
}
+ test_perform_explicitDartCoreImport() {
+ List<Source> sources = newSources({
+ '/lib.dart': '''
+library lib;
+import 'dart:core' show List;
+'''
+ });
+ Source source = sources[0];
+ // perform task
+ computeResult(source, LIBRARY_ELEMENT2);
+ expect(task, new isInstanceOf<BuildDirectiveElementsTask>());
+ // prepare outputs
+ LibraryElement libraryElement = outputs[LIBRARY_ELEMENT2];
+ // has an explicit "dart:core" import
+ {
+ List<ImportElement> imports = libraryElement.imports;
+ expect(imports, hasLength(1));
+ expect(imports[0].importedLibrary.isDartCore, isTrue);
+ expect(imports[0].isSynthetic, isFalse);
+ }
+ }
+
test_perform_hasExtUri() {
List<Source> sources = newSources({
'/lib.dart': '''
« no previous file with comments | « pkg/analyzer/test/generated/static_warning_code_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698