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

Unified Diff: pkg/analyzer/test/generated/resolver_test.dart

Issue 2288983002: Move error checking from scope creation to error reporter (Closed)
Patch Set: Created 4 years, 4 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/generated/resolver_test.dart
diff --git a/pkg/analyzer/test/generated/resolver_test.dart b/pkg/analyzer/test/generated/resolver_test.dart
index 1135a52fbcbc2dcf72ddf8d016ef3756649a44c5..0e9dc33af15acc25b75128686f12f1510da83fb2 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -199,13 +199,12 @@ class EnclosedScopeTest extends ResolverTestCase {
Scope rootScope =
new Scope_EnclosedScopeTest_test_define_duplicate(listener);
EnclosedScope scope = new EnclosedScope(rootScope);
- VariableElement element1 =
- ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
- VariableElement element2 =
- ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
+ SimpleIdentifier identifier = AstFactory.identifier3("v1");
+ VariableElement element1 = ElementFactory.localVariableElement(identifier);
+ VariableElement element2 = ElementFactory.localVariableElement(identifier);
scope.define(element1);
scope.define(element2);
- listener.assertErrorsWithSeverities([ErrorSeverity.ERROR]);
+ expect(scope.lookup(identifier, null), element1);
}
void test_define_normal() {
@@ -600,13 +599,12 @@ class ScopeTest extends ResolverTestCase {
void test_define_duplicate() {
GatheringErrorListener errorListener = new GatheringErrorListener();
ScopeTest_TestScope scope = new ScopeTest_TestScope(errorListener);
- VariableElement element1 =
- ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
- VariableElement element2 =
- ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
+ SimpleIdentifier identifier = AstFactory.identifier3("v1");
+ VariableElement element1 = ElementFactory.localVariableElement(identifier);
+ VariableElement element2 = ElementFactory.localVariableElement(identifier);
scope.define(element1);
scope.define(element2);
- errorListener.assertErrorsWithSeverities([ErrorSeverity.ERROR]);
+ expect(scope.lookup(identifier, null), element1);
}
void test_define_normal() {

Powered by Google App Engine
This is Rietveld 408576698