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

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

Issue 689383005: Fix for issue 20796 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Fixed missed case Created 6 years, 1 month 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 | Annotate | Revision Log
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.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 // This code was auto-generated, is not intended to be edited, and is subject to 5 // This code was auto-generated, is not intended to be edited, and is subject to
6 // significant change. Please see the README file for more information. 6 // significant change. Please see the README file for more information.
7 7
8 library engine.parser_test; 8 library engine.parser_test;
9 9
10 import 'package:analyzer/src/generated/error.dart'; 10 import 'package:analyzer/src/generated/error.dart';
(...skipping 2455 matching lines...) Expand 10 before | Expand all | Expand 10 after
2466 // Make sure we recovered and parsed "var v" correctly 2466 // Make sure we recovered and parsed "var v" correctly
2467 ClassDeclaration declaration = unit.declarations[0] as ClassDeclaration; 2467 ClassDeclaration declaration = unit.declarations[0] as ClassDeclaration;
2468 NodeList<ClassMember> members = declaration.members; 2468 NodeList<ClassMember> members = declaration.members;
2469 ClassMember fieldDecl = members[1]; 2469 ClassMember fieldDecl = members[1];
2470 EngineTestCase.assertInstanceOf((obj) => obj is FieldDeclaration, FieldDecla ration, fieldDecl); 2470 EngineTestCase.assertInstanceOf((obj) => obj is FieldDeclaration, FieldDecla ration, fieldDecl);
2471 NodeList<VariableDeclaration> vars = (fieldDecl as FieldDeclaration).fields. variables; 2471 NodeList<VariableDeclaration> vars = (fieldDecl as FieldDeclaration).fields. variables;
2472 expect(vars, hasLength(1)); 2472 expect(vars, hasLength(1));
2473 expect(vars[0].name.name, "v"); 2473 expect(vars[0].name.name, "v");
2474 } 2474 }
2475 2475
2476 void test_incomplete_constructorInitializers_empty() {
2477 ParserTestCase.parse3(
2478 "parseClassMember",
2479 ["C"],
2480 "C() : {}",
2481 [ParserErrorCode.MISSING_INITIALIZER]);
2482 }
2483
2484 void test_incomplete_constructorInitializers_variable() {
2485 ParserTestCase.parse3(
2486 "parseClassMember",
2487 ["C"],
2488 "C() : x {}",
2489 [ParserErrorCode.MISSING_ASSIGNMENT_IN_INITIALIZER]);
2490 }
2491
2476 void test_incomplete_topLevelVariable() { 2492 void test_incomplete_topLevelVariable() {
2477 CompilationUnit unit = ParserTestCase.parseCompilationUnit("String", [Parser ErrorCode.EXPECTED_EXECUTABLE]); 2493 CompilationUnit unit = ParserTestCase.parseCompilationUnit("String", [Parser ErrorCode.EXPECTED_EXECUTABLE]);
2478 NodeList<CompilationUnitMember> declarations = unit.declarations; 2494 NodeList<CompilationUnitMember> declarations = unit.declarations;
2479 expect(declarations, hasLength(1)); 2495 expect(declarations, hasLength(1));
2480 CompilationUnitMember member = declarations[0]; 2496 CompilationUnitMember member = declarations[0];
2481 EngineTestCase.assertInstanceOf((obj) => obj is TopLevelVariableDeclaration, TopLevelVariableDeclaration, member); 2497 EngineTestCase.assertInstanceOf((obj) => obj is TopLevelVariableDeclaration, TopLevelVariableDeclaration, member);
2482 NodeList<VariableDeclaration> variables = (member as TopLevelVariableDeclara tion).variables.variables; 2498 NodeList<VariableDeclaration> variables = (member as TopLevelVariableDeclara tion).variables.variables;
2483 expect(variables, hasLength(1)); 2499 expect(variables, hasLength(1));
2484 SimpleIdentifier name = variables[0].name; 2500 SimpleIdentifier name = variables[0].name;
2485 expect(name.isSynthetic, isTrue); 2501 expect(name.isSynthetic, isTrue);
(...skipping 5816 matching lines...) Expand 10 before | Expand all | Expand 10 after
8302 main() { 8318 main() {
8303 groupSep = ' | '; 8319 groupSep = ' | ';
8304 runReflectiveTests(ComplexParserTest); 8320 runReflectiveTests(ComplexParserTest);
8305 runReflectiveTests(ErrorParserTest); 8321 runReflectiveTests(ErrorParserTest);
8306 runReflectiveTests(IncrementalParserTest); 8322 runReflectiveTests(IncrementalParserTest);
8307 runReflectiveTests(NonErrorParserTest); 8323 runReflectiveTests(NonErrorParserTest);
8308 runReflectiveTests(RecoveryParserTest); 8324 runReflectiveTests(RecoveryParserTest);
8309 runReflectiveTests(ResolutionCopierTest); 8325 runReflectiveTests(ResolutionCopierTest);
8310 runReflectiveTests(SimpleParserTest); 8326 runReflectiveTests(SimpleParserTest);
8311 } 8327 }
OLDNEW
« no previous file with comments | « pkg/analyzer/lib/src/generated/parser.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698