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

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

Issue 2990003002: update fasta parser compatibility tests to check error codes (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
« no previous file with comments | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 84d7c631442b9e6c332661095529be64404fa8bd..f92e3c6df7e7f736a1da38c61edc63de6e8fde5d 100644
--- a/pkg/analyzer/test/generated/parser_test.dart
+++ b/pkg/analyzer/test/generated/parser_test.dart
@@ -7605,7 +7605,12 @@ abstract class FormalParameterParserTestMixin
NormalFormalParameter parameter =
parseNormalFormalParameter('const this.a');
expect(parameter, isNotNull);
- assertNoErrors();
+ if (usingFastaParser) {
+ // TODO(danrubel): should not be generating an error
+ assertErrorsWithCodes([ParserErrorCode.UNEXPECTED_TOKEN]);
+ } else {
+ assertNoErrors();
+ }
expect(parameter, new isInstanceOf<FieldFormalParameter>());
FieldFormalParameter fieldParameter = parameter;
expect(fieldParameter.keyword, isNotNull);
@@ -7618,7 +7623,12 @@ abstract class FormalParameterParserTestMixin
NormalFormalParameter parameter =
parseNormalFormalParameter('const A this.a');
expect(parameter, isNotNull);
- assertNoErrors();
+ if (usingFastaParser) {
+ // TODO(danrubel): should not be generating an error
+ assertErrorsWithCodes([ParserErrorCode.UNEXPECTED_TOKEN]);
+ } else {
+ assertNoErrors();
+ }
expect(parameter, new isInstanceOf<FieldFormalParameter>());
FieldFormalParameter fieldParameter = parameter;
expect(fieldParameter.keyword, isNotNull);
@@ -7974,7 +7984,12 @@ abstract class FormalParameterParserTestMixin
void test_parseNormalFormalParameter_simple_const_noType() {
NormalFormalParameter parameter = parseNormalFormalParameter('const a');
expect(parameter, isNotNull);
- assertNoErrors();
+ if (usingFastaParser) {
+ // TODO(danrubel): should not be generating an error
+ assertErrorsWithCodes([ParserErrorCode.UNEXPECTED_TOKEN]);
+ } else {
+ assertNoErrors();
+ }
expect(parameter, new isInstanceOf<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.keyword, isNotNull);
@@ -7985,7 +8000,12 @@ abstract class FormalParameterParserTestMixin
void test_parseNormalFormalParameter_simple_const_type() {
NormalFormalParameter parameter = parseNormalFormalParameter('const A a');
expect(parameter, isNotNull);
- assertNoErrors();
+ if (usingFastaParser) {
+ // TODO(danrubel): should not be generating an error
+ assertErrorsWithCodes([ParserErrorCode.UNEXPECTED_TOKEN]);
+ } else {
+ assertNoErrors();
+ }
expect(parameter, new isInstanceOf<SimpleFormalParameter>());
SimpleFormalParameter simpleParameter = parameter;
expect(simpleParameter.keyword, isNotNull);
@@ -13765,7 +13785,12 @@ abstract class TopLevelParserTestMixin implements AbstractParserTestCase {
createParser('operator<dynamic> _operator = new operator.A();');
CompilationUnit unit = parser.parseCompilationUnit2();
expect(unit, isNotNull);
- assertNoErrors();
+ if (usingFastaParser) {
+ // TODO(danrubel): should not be generating an error
+ assertErrorsWithCodes([ParserErrorCode.EXPECTED_TYPE_NAME]);
+ } else {
+ assertNoErrors();
+ }
expect(unit.scriptTag, isNull);
expect(unit.directives, hasLength(0));
expect(unit.declarations, hasLength(1));
@@ -13809,7 +13834,12 @@ abstract class TopLevelParserTestMixin implements AbstractParserTestCase {
createParser('typedef.A _typedef = new typedef.A();');
CompilationUnit unit = parser.parseCompilationUnit2();
expect(unit, isNotNull);
- assertNoErrors();
+ if (usingFastaParser) {
+ // TODO(danrubel): should not be generating an error
+ assertErrorsWithCodes([ParserErrorCode.EXPECTED_TYPE_NAME]);
+ } else {
+ assertNoErrors();
+ }
expect(unit.scriptTag, isNull);
expect(unit.directives, hasLength(0));
expect(unit.declarations, hasLength(1));
@@ -13819,7 +13849,12 @@ abstract class TopLevelParserTestMixin implements AbstractParserTestCase {
createParser('abstract.A _abstract = new abstract.A();');
CompilationUnitMember member = parseFullCompilationUnitMember();
expect(member, isNotNull);
- assertNoErrors();
+ if (usingFastaParser) {
+ // TODO(danrubel): should not be generating an error
+ assertErrorsWithCodes([ParserErrorCode.EXPECTED_TYPE_NAME]);
+ } else {
+ assertNoErrors();
+ }
expect(member, new isInstanceOf<TopLevelVariableDeclaration>());
TopLevelVariableDeclaration declaration = member;
expect(declaration.semicolon, isNotNull);
« no previous file with comments | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698