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

Unified Diff: pkg/analyzer/test/generated/declaration_resolver_test.dart

Issue 1737203002: Don't throw exceptions for unresolved/not-existing URIs in directives. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 10 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/lib/src/generated/resolver.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/generated/declaration_resolver_test.dart
diff --git a/pkg/analyzer/test/generated/declaration_resolver_test.dart b/pkg/analyzer/test/generated/declaration_resolver_test.dart
index 0f1112d289686cec3456320a16a2663b1fac1e2c..4f0b214bdd889f132fc0d37a4a6e4147bc0641c8 100644
--- a/pkg/analyzer/test/generated/declaration_resolver_test.dart
+++ b/pkg/analyzer/test/generated/declaration_resolver_test.dart
@@ -302,6 +302,26 @@ main() {
expect(setterName.staticElement, same(setterElement));
}
+ void test_visitExportDirective_notExistingSource() {
+ String code = r'''
+export 'foo.dart';
+''';
+ CompilationUnit unit = resolveSource(code);
+ // re-resolve
+ _cloneResolveUnit(unit);
+ // no other validations than built into DeclarationResolver
+ }
+
+ void test_visitExportDirective_unresolvedUri() {
+ String code = r'''
+export 'package:foo/bar.dart';
+''';
+ CompilationUnit unit = resolveSource(code);
+ // re-resolve
+ _cloneResolveUnit(unit);
+ // no other validations than built into DeclarationResolver
+ }
+
void test_visitFunctionExpression() {
String code = r'''
main(List<String> items) {
@@ -314,12 +334,19 @@ main(List<String> items) {
// no other validations than built into DeclarationResolver
}
- void test_visitMethodDeclaration_unaryMinus() {
+ void test_visitImportDirective_notExistingSource() {
String code = r'''
-class C {
- C operator -() => null;
- C operator -(C other) => null;
-}
+import 'foo.dart';
+''';
+ CompilationUnit unit = resolveSource(code);
+ // re-resolve
+ _cloneResolveUnit(unit);
+ // no other validations than built into DeclarationResolver
+ }
+
+ void test_visitImportDirective_unresolvedUri() {
+ String code = r'''
+import 'package:foo/bar.dart';
''';
CompilationUnit unit = resolveSource(code);
// re-resolve
@@ -409,6 +436,29 @@ class C {
expect(firstName.staticElement, same(firstElement));
expect(secondName.staticElement, same(secondElement));
}
+
+ void test_visitMethodDeclaration_unaryMinus() {
+ String code = r'''
+class C {
+ C operator -() => null;
+ C operator -(C other) => null;
+}
+''';
+ CompilationUnit unit = resolveSource(code);
+ // re-resolve
+ _cloneResolveUnit(unit);
+ // no other validations than built into DeclarationResolver
+ }
+
+ void test_visitPartDirective_notExistingSource() {
+ String code = r'''
+part 'foo.bar';
+''';
+ CompilationUnit unit = resolveSource(code);
+ // re-resolve
+ _cloneResolveUnit(unit);
+ // no other validations than built into DeclarationResolver
+ }
}
/**
« no previous file with comments | « pkg/analyzer/lib/src/generated/resolver.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698