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

Unified Diff: pkg/analyzer/test/src/context/context_test.dart

Issue 2160673002: Another fix incremental constants - annotations should use the old unit element. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 5 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/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 ca10e4b814f9c128f4e759758030f04f743d3187..43b194c83c94ae7f0cefecf01aa5b8bdac29b515 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -3312,6 +3312,30 @@ int B = _A + 1;
_assertInvalid(b, LIBRARY_ERRORS_READY);
}
+ void test_sequence_add_annotation() {
+ Source a = addSource(
+ '/a.dart',
+ r'''
+const myAnnotation = const Object();
+class A {}
+''');
+ _performPendingAnalysisTasks();
+ // Add a new annotation.
+ context.setContents(
+ a,
+ r'''
+const myAnnotation = const Object();
+@myAnnotation
+class A {}
+''');
+ _assertValidForChangedLibrary(a);
+ _assertInvalid(a, LIBRARY_ERRORS_READY);
+ // Analysis is done successfully.
+ _performPendingAnalysisTasks();
+ _assertValid(a, LIBRARY_ERRORS_READY);
+ _assertValid(a, READY_RESOLVED_UNIT);
+ }
+
void test_sequence_class_give_take() {
Source a = addSource(
'/a.dart',

Powered by Google App Engine
This is Rietveld 408576698