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

Side by Side Diff: pkg/analyzer/test/generated/parser_test.dart

Issue 3008783002: Run the parser recovery tests under fasta (Closed)
Patch Set: use 'with' Created 3 years, 3 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 unified diff | Download patch
« no previous file with comments | « pkg/analyzer/test/generated/parser_fasta_test.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:analyzer/dart/ast/ast.dart'; 5 import 'package:analyzer/dart/ast/ast.dart';
6 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; 6 import 'package:analyzer/dart/ast/standard_ast_factory.dart';
7 import 'package:analyzer/dart/ast/token.dart'; 7 import 'package:analyzer/dart/ast/token.dart';
8 import 'package:analyzer/dart/ast/visitor.dart'; 8 import 'package:analyzer/dart/ast/visitor.dart';
9 import 'package:analyzer/error/error.dart'; 9 import 'package:analyzer/error/error.dart';
10 import 'package:analyzer/error/listener.dart'; 10 import 'package:analyzer/error/listener.dart';
(...skipping 8815 matching lines...) Expand 10 before | Expand all | Expand 10 after
8826 expect(components, hasLength(count)); 8826 expect(components, hasLength(count));
8827 for (int i = 0; i < count; i++) { 8827 for (int i = 0; i < count; i++) {
8828 SimpleIdentifier component = components[i]; 8828 SimpleIdentifier component = components[i];
8829 expect(component, isNotNull); 8829 expect(component, isNotNull);
8830 expect(component.name, expectedComponents[i]); 8830 expect(component.name, expectedComponents[i]);
8831 } 8831 }
8832 } 8832 }
8833 } 8833 }
8834 8834
8835 /** 8835 /**
8836 * The class `RecoveryParserTest` defines parser tests that test the parsing of invalid code 8836 * The class `RecoveryParserTest` defines parser tests that test the parsing of
8837 * sequences to ensure that the correct recovery steps are taken in the parser. 8837 * invalid code sequences to ensure that the correct recovery steps are taken in
8838 * the parser.
8838 */ 8839 */
8839 @reflectiveTest 8840 @reflectiveTest
8840 class RecoveryParserTest extends ParserTestCase { 8841 class RecoveryParserTest extends ParserTestCase with RecoveryParserTestMixin {}
8842
8843 abstract class RecoveryParserTestMixin implements AbstractParserTestCase {
8841 void test_additiveExpression_missing_LHS() { 8844 void test_additiveExpression_missing_LHS() {
8842 BinaryExpression expression = 8845 BinaryExpression expression =
8843 parseExpression("+ y", [ParserErrorCode.MISSING_IDENTIFIER]); 8846 parseExpression("+ y", [ParserErrorCode.MISSING_IDENTIFIER]);
8844 EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier, 8847 EngineTestCase.assertInstanceOf((obj) => obj is SimpleIdentifier,
8845 SimpleIdentifier, expression.leftOperand); 8848 SimpleIdentifier, expression.leftOperand);
8846 expect(expression.leftOperand.isSynthetic, isTrue); 8849 expect(expression.leftOperand.isSynthetic, isTrue);
8847 } 8850 }
8848 8851
8849 void test_additiveExpression_missing_LHS_RHS() { 8852 void test_additiveExpression_missing_LHS_RHS() {
8850 BinaryExpression expression = parseExpression("+", [ 8853 BinaryExpression expression = parseExpression("+", [
(...skipping 6616 matching lines...) Expand 10 before | Expand all | Expand 10 after
15467 expectCommentText(typeVariable.documentationComment, '/// Doc'); 15470 expectCommentText(typeVariable.documentationComment, '/// Doc');
15468 } 15471 }
15469 15472
15470 /** 15473 /**
15471 * Assert that the given [name] is in declaration context. 15474 * Assert that the given [name] is in declaration context.
15472 */ 15475 */
15473 void _assertIsDeclarationName(SimpleIdentifier name) { 15476 void _assertIsDeclarationName(SimpleIdentifier name) {
15474 expect(name.inDeclarationContext(), isTrue); 15477 expect(name.inDeclarationContext(), isTrue);
15475 } 15478 }
15476 } 15479 }
OLDNEW
« 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