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

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

Issue 2990723002: Revert "Implemented support for generalized void in analyzer." (Closed)
Patch Set: Created 3 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/generated/parser_test.dart
diff --git a/pkg/analyzer/test/generated/parser_test.dart b/pkg/analyzer/test/generated/parser_test.dart
index 5bdb523adf9ec98a8f2a4fbf7a446f10e76ff2f2..84d7c631442b9e6c332661095529be64404fa8bd 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -4315,53 +4315,53 @@ void main() {
createParser('void a)');
NormalFormalParameter parameter = parser.parseNormalFormalParameter();
expectNotNullIfNoErrors(parameter);
- listener.assertNoErrors();
+ listener.assertErrorsWithCodes([ParserErrorCode.VOID_PARAMETER]);
}
void test_voidVariable_parseClassMember_initializer() {
createParser('void x = 0;');
ClassMember member = parser.parseClassMember('C');
expectNotNullIfNoErrors(member);
- listener.assertNoErrors();
+ listener.assertErrorsWithCodes([ParserErrorCode.VOID_VARIABLE]);
}
void test_voidVariable_parseClassMember_noInitializer() {
createParser('void x;');
ClassMember member = parser.parseClassMember('C');
expectNotNullIfNoErrors(member);
- listener.assertNoErrors();
+ listener.assertErrorsWithCodes([ParserErrorCode.VOID_VARIABLE]);
}
void test_voidVariable_parseCompilationUnit_initializer() {
- parseCompilationUnit("void x = 0;");
+ parseCompilationUnit("void x = 0;", [ParserErrorCode.VOID_VARIABLE]);
}
void test_voidVariable_parseCompilationUnit_noInitializer() {
- parseCompilationUnit("void x;");
+ parseCompilationUnit("void x;", [ParserErrorCode.VOID_VARIABLE]);
}
void test_voidVariable_parseCompilationUnitMember_initializer() {
createParser('void a = 0;');
CompilationUnitMember member = parseFullCompilationUnitMember();
expectNotNullIfNoErrors(member);
- listener.assertNoErrors();
+ listener.assertErrorsWithCodes([ParserErrorCode.VOID_VARIABLE]);
}
void test_voidVariable_parseCompilationUnitMember_noInitializer() {
createParser('void a;');
CompilationUnitMember member = parseFullCompilationUnitMember();
expectNotNullIfNoErrors(member);
- listener.assertNoErrors();
+ listener.assertErrorsWithCodes([ParserErrorCode.VOID_VARIABLE]);
}
void test_voidVariable_statement_initializer() {
parseStatement("void x = 0;");
- listener.assertNoErrors();
+ assertErrorsWithCodes([ParserErrorCode.VOID_VARIABLE]);
}
void test_voidVariable_statement_noInitializer() {
parseStatement("void x;");
- listener.assertNoErrors();
+ assertErrorsWithCodes([ParserErrorCode.VOID_VARIABLE]);
}
void test_withBeforeExtends() {
@@ -11490,9 +11490,8 @@ void''');
}
void test_parseReturnType_function() {
- // TODO(eernst): `parseReturnType` eliminated, delete this test?
createParser('A<B> Function<B>(B)');
- GenericFunctionType type = parser.parseTypeAnnotation(false);
+ GenericFunctionType type = parser.parseReturnType(false);
expectNotNullIfNoErrors(type);
listener.assertNoErrors();
expect(type.returnType, isNotNull);
@@ -11501,9 +11500,8 @@ void''');
}
void test_parseReturnType_named() {
- // TODO(eernst): `parseReturnType` eliminated, delete this test?
createParser('A<B>');
- TypeName typeName = parser.parseTypeAnnotation(false);
+ TypeName typeName = parser.parseReturnType(false);
expectNotNullIfNoErrors(typeName);
listener.assertNoErrors();
expect(typeName.name, isNotNull);
@@ -11511,9 +11509,8 @@ void''');
}
void test_parseReturnType_void() {
- // TODO(eernst): `parseReturnType` eliminated, delete this test?
createParser('void');
- TypeName typeName = parser.parseTypeAnnotation(false);
+ TypeName typeName = parser.parseReturnType(false);
expectNotNullIfNoErrors(typeName);
listener.assertNoErrors();
expect(typeName.name, isNotNull);
@@ -12023,24 +12020,21 @@ Function<A>(core.List<core.int> x) m() => null;
}
void test_skipReturnType_invalid() {
- // TODO(eernst): `skipReturnType` eliminated, delete this test?
createParser('+');
- Token following = parser.skipTypeAnnotation(parser.currentToken);
+ Token following = parser.skipReturnType(parser.currentToken);
expect(following, isNull);
}
void test_skipReturnType_type() {
- // TODO(eernst): `skipReturnType` eliminated, delete this test?
createParser('C +');
- Token following = parser.skipTypeAnnotation(parser.currentToken);
+ Token following = parser.skipReturnType(parser.currentToken);
expect(following, isNotNull);
expect(following.type, TokenType.PLUS);
}
void test_skipReturnType_void() {
- // TODO(eernst): `skipReturnType` eliminated, delete this test?
createParser('void +');
- Token following = parser.skipTypeAnnotation(parser.currentToken);
+ Token following = parser.skipReturnType(parser.currentToken);
expect(following, isNotNull);
expect(following.type, TokenType.PLUS);
}
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | pkg/analyzer/test/generated/static_warning_code_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698