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

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

Issue 2175093002: Fix incremental element builder for added enums. (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 d0ec5b2caf846d1904e2f845397d03d38a043542..28dceb7827ec000b3d7a53556cfb2ac0cb3c240c 100644
--- a/pkg/analyzer/test/src/context/context_test.dart
+++ b/pkg/analyzer/test/src/context/context_test.dart
@@ -3220,6 +3220,29 @@ class A {
_assertValid(b, LIBRARY_ERRORS_READY);
}
+ void test_enum_add() {
+ Source a = addSource(
+ '/a.dart',
+ r'''
+main() {
+ print(MyEnum.A);
+}
+''');
+ _performPendingAnalysisTasks();
+ // Insert a new enum declaration.
+ // No errors expected.
+ context.setContents(
+ a,
+ r'''
+main() {
+ print(MyEnum.A);
+}
+enum MyEnum { A, B, C }
+''');
+ _performPendingAnalysisTasks();
+ expect(context.getErrors(a).errors, isEmpty);
+ }
+
void test_private_class() {
Source a = addSource(
'/a.dart',

Powered by Google App Engine
This is Rietveld 408576698