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

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

Issue 2290373003: Move error checking from scope creation to error reporter (take 2) (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
« no previous file with comments | « pkg/analyzer/test/generated/non_error_resolver_test.dart ('k') | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 cd87a6fd01c74b2e2b5ab981b1e3653a130674d8..7e8a63910f9e81563481f21953f6d75a54539197 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -198,13 +198,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() {
@@ -599,13 +598,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() {
« no previous file with comments | « pkg/analyzer/test/generated/non_error_resolver_test.dart ('k') | pkg/analyzer/test/src/task/dart_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698