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

Unified Diff: pkg/analyzer/test/src/dart/analysis/file_state_test.dart

Issue 2665213003: Encode URIs stored in unlinked summaries to make them Uri.parse() safe. (Closed)
Patch Set: Created 3 years, 11 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
Index: pkg/analyzer/test/src/dart/analysis/file_state_test.dart
diff --git a/pkg/analyzer/test/src/dart/analysis/file_state_test.dart b/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
index 0da912e066a594298854c45106e83dc0cabbf28f..47e1b6810a6006aa71f1ef5dd61bb4ff2be1f2b5 100644
--- a/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
+++ b/pkg/analyzer/test/src/dart/analysis/file_state_test.dart
@@ -295,30 +295,40 @@ part of L;
import 'package:aaa/a1.dart';
import '[invalid uri]';
-export '[invalid uri]';
export 'package:aaa/a2.dart';
+export '[invalid uri]';
part 'a3.dart';
part '[invalid uri]';
''';
provider.newFile(a, content_a1);
+ Uri invalidUri = Uri.parse(Uri.encodeFull('package:aaa/[invalid uri]'));
FileState file = fileSystemState.getFileForPath(a);
- expect(_excludeSdk(file.importedFiles), hasLength(1));
+ expect(_excludeSdk(file.importedFiles), hasLength(2));
expect(file.importedFiles[0].path, a1);
expect(file.importedFiles[0].uri, Uri.parse('package:aaa/a1.dart'));
expect(file.importedFiles[0].source, isNotNull);
+ expect(file.importedFiles[1].path, isNotNull);
+ expect(file.importedFiles[1].uri, invalidUri);
+ expect(file.importedFiles[1].source, isNotNull);
- expect(_excludeSdk(file.exportedFiles), hasLength(1));
+ expect(_excludeSdk(file.exportedFiles), hasLength(2));
expect(file.exportedFiles[0].path, a2);
expect(file.exportedFiles[0].uri, Uri.parse('package:aaa/a2.dart'));
expect(file.exportedFiles[0].source, isNotNull);
+ expect(file.exportedFiles[1].path, isNotNull);
+ expect(file.exportedFiles[1].uri, invalidUri);
+ expect(file.exportedFiles[1].source, isNotNull);
- expect(_excludeSdk(file.partedFiles), hasLength(1));
+ expect(_excludeSdk(file.partedFiles), hasLength(2));
expect(file.partedFiles[0].path, a3);
expect(file.partedFiles[0].uri, Uri.parse('package:aaa/a3.dart'));
expect(file.partedFiles[0].source, isNotNull);
+ expect(file.partedFiles[1].path, isNotNull);
+ expect(file.partedFiles[1].uri, invalidUri);
+ expect(file.partedFiles[1].source, isNotNull);
}
test_getFileForPath_library() {

Powered by Google App Engine
This is Rietveld 408576698