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 4a6ee92b3870bfec6d8132773f79642305d89fe8..3c363dfb287657e198a86206df638f8fbc7c6bda 100644 |
--- a/pkg/analyzer/test/src/summary/summary_common.dart |
+++ b/pkg/analyzer/test/src/summary/summary_common.dart |
@@ -6471,6 +6471,17 @@ class B extends A {} |
expect(unlinkedExports[0].configurations, isEmpty); |
} |
+ test_export_uri_nullStringValue() { |
+ String libraryText = r''' |
+export "${'a'}.dart"; |
+'''; |
+ serializeLibraryText(libraryText); |
+ var unlinkedExports = unlinkedUnits[0].publicNamespace.exports; |
+ expect(unlinkedExports, hasLength(1)); |
+ expect(unlinkedExports[0].uri, ''); |
+ expect(unlinkedExports[0].configurations, isEmpty); |
+ } |
+ |
test_export_variable() { |
addNamedSource('/a.dart', 'var v;'); |
serializeLibraryText('export "a.dart";'); |
@@ -8346,6 +8357,16 @@ class D extends p.C {} // Prevent "unused import" warning |
expect(unlinkedUnits[0].imports[0].uri, 'dart:async'); |
} |
+ test_import_uri_nullStringValue() { |
+ String libraryText = r''' |
+import "${'a'}.dart"; |
+'''; |
+ serializeLibraryText(libraryText); |
+ // Second import is the implicit import of dart:core |
+ expect(unlinkedUnits[0].imports, hasLength(2)); |
+ expect(unlinkedUnits[0].imports[0].uri, ''); |
+ } |
+ |
test_inferred_function_type_parameter_type_with_unrelated_type_param() { |
if (!strongMode || skipFullyLinkedData) { |
return; |
@@ -9475,6 +9496,20 @@ f(x) => 42; |
expect(unlinkedUnits[0].parts[0].uriEnd, text.indexOf('; // <-part')); |
} |
+ test_part_declaration_invalidUri_nullStringValue() { |
+ addNamedSource('/a.dart', 'part of my.lib;'); |
+ String text = r''' |
+library my.lib; |
+part "${'a'}.dart"; // <-part |
+'''; |
+ serializeLibraryText(text); |
+ expect(unlinkedUnits[0].publicNamespace.parts, hasLength(1)); |
+ expect(unlinkedUnits[0].publicNamespace.parts[0], ''); |
+ expect(unlinkedUnits[0].parts, hasLength(1)); |
+ expect(unlinkedUnits[0].parts[0].uriOffset, text.indexOf(r'"${')); |
+ expect(unlinkedUnits[0].parts[0].uriEnd, text.indexOf('; // <-part')); |
+ } |
+ |
test_part_isPartOf() { |
addNamedSource('/a.dart', 'part of foo; class C {}'); |
serializeLibraryText('library foo; part "a.dart";'); |