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

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

Issue 214593008: Rollback pkg/analyzer that breaks code_transformers (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 9 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:
Download patch
« no previous file with comments | « pkg/analyzer/test/generated/ast_test.dart ('k') | pkg/analyzer/test/generated/scanner_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 e84c374d81650481c4b073289c9ba850aa8b3a9e..3a9d2b9397499829dbf5ca06facc29f206fe878e 100644
--- a/pkg/analyzer/test/generated/resolver_test.dart
+++ b/pkg/analyzer/test/generated/resolver_test.dart
@@ -7733,33 +7733,6 @@ class StaticTypeWarningCodeTest extends ResolverTestCase {
}
class HintCodeTest extends ResolverTestCase {
- void fail_deadCode_statementAfterRehrow() {
- Source source = addSource(EngineTestCase.createSource([
- "f() {",
- " try {",
- " var one = 1;",
- " } catch (e) {",
- " rethrow;",
- " var two = 2;",
- " }",
- "}"]));
- resolve(source);
- assertErrors(source, [HintCode.DEAD_CODE]);
- verify([source]);
- }
-
- void fail_deadCode_statementAfterThrow() {
- Source source = addSource(EngineTestCase.createSource([
- "f() {",
- " var one = 1;",
- " throw 'Stop here';",
- " var two = 2;",
- "}"]));
- resolve(source);
- assertErrors(source, [HintCode.DEAD_CODE]);
- verify([source]);
- }
-
void fail_isInt() {
Source source = addSource(EngineTestCase.createSource(["var v = 1 is int;"]));
resolve(source);
@@ -19423,12 +19396,6 @@ class StaticWarningCodeTest extends ResolverTestCase {
assertErrors(source, [StaticTypeWarningCode.UNDEFINED_SETTER]);
}
- void test_voidReturnForGetter() {
- Source source = addSource(EngineTestCase.createSource(["class S {", " void get value {}", "}"]));
- resolve(source);
- assertErrors(source, [StaticWarningCode.VOID_RETURN_FOR_GETTER]);
- }
-
static dartSuite() {
_ut.group('StaticWarningCodeTest', () {
_ut.test('test_ambiguousImport_as', () {
@@ -20263,10 +20230,6 @@ class StaticWarningCodeTest extends ResolverTestCase {
final __test = new StaticWarningCodeTest();
runJUnitTest(__test, __test.test_undefinedStaticMethodOrGetter_setter_inSuperclass);
});
- _ut.test('test_voidReturnForGetter', () {
- final __test = new StaticWarningCodeTest();
- runJUnitTest(__test, __test.test_voidReturnForGetter);
- });
});
}
}
@@ -21079,7 +21042,7 @@ class ResolutionVerifier extends RecursiveAstVisitor<Object> {
* A set containing nodes that are known to not be resolvable and should therefore not cause the
* test to fail.
*/
- final Set<AstNode> _knownExceptions;
+ Set<AstNode> _knownExceptions;
/**
* A list containing all of the AST nodes that were not resolved.
@@ -21106,7 +21069,9 @@ class ResolutionVerifier extends RecursiveAstVisitor<Object> {
* @param knownExceptions a set containing nodes that are known to not be resolvable and should
* therefore not cause the test to fail
**/
- ResolutionVerifier.con1(this._knownExceptions);
+ ResolutionVerifier.con1(Set<AstNode> knownExceptions) {
+ this._knownExceptions = knownExceptions;
+ }
/**
* Assert that all of the visited identifiers were resolved.
@@ -23617,26 +23582,26 @@ class NonHintCodeTest extends ResolverTestCase {
class EnclosedScopeTest extends ResolverTestCase {
void test_define_duplicate() {
- GatheringErrorListener listener = new GatheringErrorListener();
- Scope rootScope = new Scope_EnclosedScopeTest_test_define_duplicate(listener);
+ GatheringErrorListener errorListener2 = new GatheringErrorListener();
+ Scope rootScope = new Scope_EnclosedScopeTest_test_define_duplicate(errorListener2);
EnclosedScope scope = new EnclosedScope(rootScope);
VariableElement element1 = ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
VariableElement element2 = ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
scope.define(element1);
scope.define(element2);
- listener.assertErrorsWithSeverities([ErrorSeverity.ERROR]);
+ errorListener2.assertErrorsWithSeverities([ErrorSeverity.ERROR]);
}
void test_define_normal() {
- GatheringErrorListener listener = new GatheringErrorListener();
- Scope rootScope = new Scope_EnclosedScopeTest_test_define_normal(listener);
+ GatheringErrorListener errorListener3 = new GatheringErrorListener();
+ Scope rootScope = new Scope_EnclosedScopeTest_test_define_normal(errorListener3);
EnclosedScope outerScope = new EnclosedScope(rootScope);
EnclosedScope innerScope = new EnclosedScope(outerScope);
VariableElement element1 = ElementFactory.localVariableElement(AstFactory.identifier3("v1"));
VariableElement element2 = ElementFactory.localVariableElement(AstFactory.identifier3("v2"));
outerScope.define(element1);
innerScope.define(element2);
- listener.assertNoErrors();
+ errorListener3.assertNoErrors();
}
static dartSuite() {
@@ -23654,24 +23619,24 @@ class EnclosedScopeTest extends ResolverTestCase {
}
class Scope_EnclosedScopeTest_test_define_duplicate extends Scope {
- GatheringErrorListener listener;
+ GatheringErrorListener errorListener2;
- Scope_EnclosedScopeTest_test_define_duplicate(this.listener) : super();
+ Scope_EnclosedScopeTest_test_define_duplicate(this.errorListener2) : super();
@override
- AnalysisErrorListener get errorListener => listener;
+ AnalysisErrorListener get errorListener => errorListener2;
@override
Element internalLookup(Identifier identifier, String name, LibraryElement referencingLibrary) => null;
}
class Scope_EnclosedScopeTest_test_define_normal extends Scope {
- GatheringErrorListener listener;
+ GatheringErrorListener errorListener3;
- Scope_EnclosedScopeTest_test_define_normal(this.listener) : super();
+ Scope_EnclosedScopeTest_test_define_normal(this.errorListener3) : super();
@override
- AnalysisErrorListener get errorListener => listener;
+ AnalysisErrorListener get errorListener => errorListener3;
@override
Element internalLookup(Identifier identifier, String name, LibraryElement referencingLibrary) => null;
@@ -23732,6 +23697,12 @@ class LibraryElementBuilderTest extends EngineTestCase {
EngineTestCase.assertLength(0, unit.topLevelVariables);
}
+ void test_invalidUri_part() {
+ Source librarySource = addSource("/lib.dart", EngineTestCase.createSource(["library lib;", "", "part '\${'a'}.dart';"]));
+ LibraryElement element = _buildLibrary(librarySource, [CompileTimeErrorCode.URI_WITH_INTERPOLATION]);
+ JUnitTestCase.assertNotNull(element);
+ }
+
void test_missingLibraryDirectiveWithPart() {
addSource("/a.dart", EngineTestCase.createSource(["part of lib;"]));
Source librarySource = addSource("/lib.dart", EngineTestCase.createSource(["part 'a.dart';"]));
@@ -23844,6 +23815,10 @@ class LibraryElementBuilderTest extends EngineTestCase {
final __test = new LibraryElementBuilderTest();
runJUnitTest(__test, __test.test_empty);
});
+ _ut.test('test_invalidUri_part', () {
+ final __test = new LibraryElementBuilderTest();
+ runJUnitTest(__test, __test.test_invalidUri_part);
+ });
_ut.test('test_missingLibraryDirectiveWithPart', () {
final __test = new LibraryElementBuilderTest();
runJUnitTest(__test, __test.test_missingLibraryDirectiveWithPart);
@@ -23932,9 +23907,11 @@ class ScopeTest_TestScope extends Scope {
/**
* The listener that is to be informed when an error is encountered.
*/
- final AnalysisErrorListener errorListener;
+ AnalysisErrorListener errorListener;
- ScopeTest_TestScope(this.errorListener);
+ ScopeTest_TestScope(AnalysisErrorListener errorListener) {
+ this.errorListener = errorListener;
+ }
@override
Element internalLookup(Identifier identifier, String name, LibraryElement referencingLibrary) => localLookup(name, referencingLibrary);
« no previous file with comments | « pkg/analyzer/test/generated/ast_test.dart ('k') | pkg/analyzer/test/generated/scanner_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698