Index: pkg/analyzer/test/src/context/context_test.dart |
diff --git a/pkg/analyzer/test/src/context/context_test.dart b/pkg/analyzer/test/src/context/context_test.dart |
index c0a9b318cab0574a00ad4e75d9463d7307543eb3..06c5922e0207e3fc22ad02fe2f71ae0a2c1ba91e 100644 |
--- a/pkg/analyzer/test/src/context/context_test.dart |
+++ b/pkg/analyzer/test/src/context/context_test.dart |
@@ -3470,6 +3470,46 @@ class A { |
expect(context.getErrors(b).errors, hasLength(1)); |
} |
+ void test_sequence_dependenciesWithCycles() { |
+ Source a = addSource( |
+ '/a.dart', |
+ r''' |
+const A = 1; |
+'''); |
+ Source b = addSource( |
+ '/b.dart', |
+ r''' |
+import 'c.dart'; |
+const B = C1 + 1; |
+'''); |
+ Source c = addSource( |
+ '/c.dart', |
+ r''' |
+import 'a.dart'; |
+import 'b.dart'; |
+const C1 = A + 1; |
+const C2 = B + 2; |
+'''); |
+ Source d = addSource( |
+ '/d.dart', |
+ r''' |
+import 'c.dart'; |
+const D = C2 + 1; |
+'''); |
+ _performPendingAnalysisTasks(); |
+ // Update "A" constant. |
+ // This should invalidate results in all sources. |
+ context.setContents( |
+ a, |
+ r''' |
+const A = 2; |
+'''); |
+ _assertInvalid(a, LIBRARY_ERRORS_READY); |
+ _assertInvalid(b, LIBRARY_ERRORS_READY); |
+ _assertInvalid(c, LIBRARY_ERRORS_READY); |
+ _assertInvalid(d, LIBRARY_ERRORS_READY); |
+ } |
+ |
void test_sequence_inBodyChange_addRef_deltaChange() { |
Source a = addSource( |
'/a.dart', |