Index: pkg/analyzer/test/src/summary/summary_common.dart |
diff --git a/pkg/analyzer/test/src/summary/summary_common.dart b/pkg/analyzer/test/src/summary/summary_common.dart |
index 5d9d9a780d35e3d0c19c47facdf598b506528cd6..cde78ee72230c3a83295c447d1d7284982eaccc3 100644 |
--- a/pkg/analyzer/test/src/summary/summary_common.dart |
+++ b/pkg/analyzer/test/src/summary/summary_common.dart |
@@ -7,10 +7,10 @@ library analyzer.test.src.summary.summary_common; |
import 'package:analyzer/analyzer.dart'; |
import 'package:analyzer/dart/ast/ast.dart'; |
import 'package:analyzer/dart/element/element.dart'; |
+import 'package:analyzer/error/listener.dart'; |
import 'package:analyzer/src/dart/scanner/reader.dart'; |
import 'package:analyzer/src/dart/scanner/scanner.dart'; |
import 'package:analyzer/src/generated/engine.dart'; |
-import 'package:analyzer/src/generated/error.dart'; |
import 'package:analyzer/src/generated/parser.dart'; |
import 'package:analyzer/src/generated/source.dart'; |
import 'package:analyzer/src/generated/source_io.dart'; |
@@ -1307,35 +1307,6 @@ class E {} |
expect(cls.interfaces, isEmpty); |
} |
- test_unresolved_import() { |
- allowMissingFiles = true; |
- serializeLibraryText("import 'foo.dart';", allowErrors: true); |
- expect(unlinkedUnits[0].imports, hasLength(2)); |
- expect(unlinkedUnits[0].imports[0].uri, 'foo.dart'); |
- // Note: imports[1] is the implicit import of dart:core. |
- expect(unlinkedUnits[0].imports[1].isImplicit, true); |
- expect(linked.importDependencies, hasLength(2)); |
- checkDependency( |
- linked.importDependencies[0], absUri('/foo.dart'), 'foo.dart'); |
- } |
- |
- test_unresolved_export() { |
- allowMissingFiles = true; |
- serializeLibraryText("export 'foo.dart';", allowErrors: true); |
- expect(unlinkedUnits[0].publicNamespace.exports, hasLength(1)); |
- expect(unlinkedUnits[0].publicNamespace.exports[0].uri, 'foo.dart'); |
- expect(linked.exportDependencies, hasLength(1)); |
- checkDependency( |
- linked.exportDependencies[0], absUri('/foo.dart'), 'foo.dart'); |
- } |
- |
- test_unresolved_part() { |
- allowMissingFiles = true; |
- serializeLibraryText("part 'foo.dart';", allowErrors: true); |
- expect(unlinkedUnits[0].publicNamespace.parts, hasLength(1)); |
- expect(unlinkedUnits[0].publicNamespace.parts[0], 'foo.dart'); |
- } |
- |
test_class_no_mixins() { |
UnlinkedClass cls = serializeClassText('class C {}'); |
expect(cls.mixins, isEmpty); |
@@ -10073,6 +10044,35 @@ typedef F();'''; |
_assertCodeRange(unit.codeRange, 0, 14); |
} |
+ test_unresolved_export() { |
+ allowMissingFiles = true; |
+ serializeLibraryText("export 'foo.dart';", allowErrors: true); |
+ expect(unlinkedUnits[0].publicNamespace.exports, hasLength(1)); |
+ expect(unlinkedUnits[0].publicNamespace.exports[0].uri, 'foo.dart'); |
+ expect(linked.exportDependencies, hasLength(1)); |
+ checkDependency( |
+ linked.exportDependencies[0], absUri('/foo.dart'), 'foo.dart'); |
+ } |
+ |
+ test_unresolved_import() { |
+ allowMissingFiles = true; |
+ serializeLibraryText("import 'foo.dart';", allowErrors: true); |
+ expect(unlinkedUnits[0].imports, hasLength(2)); |
+ expect(unlinkedUnits[0].imports[0].uri, 'foo.dart'); |
+ // Note: imports[1] is the implicit import of dart:core. |
+ expect(unlinkedUnits[0].imports[1].isImplicit, true); |
+ expect(linked.importDependencies, hasLength(2)); |
+ checkDependency( |
+ linked.importDependencies[0], absUri('/foo.dart'), 'foo.dart'); |
+ } |
+ |
+ test_unresolved_part() { |
+ allowMissingFiles = true; |
+ serializeLibraryText("part 'foo.dart';", allowErrors: true); |
+ expect(unlinkedUnits[0].publicNamespace.parts, hasLength(1)); |
+ expect(unlinkedUnits[0].publicNamespace.parts[0], 'foo.dart'); |
+ } |
+ |
test_unresolved_reference_in_multiple_parts() { |
addNamedSource('/a.dart', 'part of foo; int x; Unresolved y;'); |
serializeLibraryText('library foo; part "a.dart"; Unresolved z;', |