OLD | NEW |
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 library analyzer.test.generated.parser_test; | 5 library analyzer.test.generated.parser_test; |
6 | 6 |
7 import 'package:analyzer/dart/ast/ast.dart'; | 7 import 'package:analyzer/dart/ast/ast.dart'; |
8 import 'package:analyzer/dart/ast/token.dart'; | 8 import 'package:analyzer/dart/ast/token.dart'; |
9 import 'package:analyzer/dart/ast/visitor.dart'; | 9 import 'package:analyzer/dart/ast/visitor.dart'; |
10 import 'package:analyzer/error/error.dart'; | 10 import 'package:analyzer/error/error.dart'; |
11 import 'package:analyzer/src/dart/ast/token.dart'; | 11 import 'package:analyzer/src/dart/ast/token.dart'; |
12 import 'package:analyzer/src/dart/scanner/reader.dart'; | 12 import 'package:analyzer/src/dart/scanner/reader.dart'; |
13 import 'package:analyzer/src/dart/scanner/scanner.dart'; | 13 import 'package:analyzer/src/dart/scanner/scanner.dart'; |
14 import 'package:analyzer/src/generated/parser.dart'; | 14 import 'package:analyzer/src/generated/parser.dart'; |
15 import 'package:analyzer/src/generated/testing/ast_factory.dart'; | 15 import 'package:analyzer/src/generated/testing/ast_factory.dart'; |
16 import 'package:analyzer/src/generated/testing/token_factory.dart'; | 16 import 'package:analyzer/src/generated/testing/token_factory.dart'; |
17 import 'package:analyzer/src/generated/utilities_dart.dart'; | 17 import 'package:analyzer/src/generated/utilities_dart.dart'; |
| 18 import 'package:test/test.dart'; |
18 import 'package:test_reflective_loader/test_reflective_loader.dart'; | 19 import 'package:test_reflective_loader/test_reflective_loader.dart'; |
19 import 'package:unittest/unittest.dart' hide Configuration; | |
20 | 20 |
21 import '../utils.dart'; | 21 import '../utils.dart'; |
22 import 'test_support.dart'; | 22 import 'test_support.dart'; |
23 | 23 |
24 main() { | 24 main() { |
25 initializeTestEnvironment(); | 25 initializeTestEnvironment(); |
26 defineReflectiveTests(ComplexParserTest); | 26 defineReflectiveSuite(() { |
27 defineReflectiveTests(ErrorParserTest); | 27 defineReflectiveTests(ComplexParserTest); |
28 defineReflectiveTests(NonErrorParserTest); | 28 defineReflectiveTests(ErrorParserTest); |
29 defineReflectiveTests(RecoveryParserTest); | 29 defineReflectiveTests(NonErrorParserTest); |
30 defineReflectiveTests(SimpleParserTest); | 30 defineReflectiveTests(RecoveryParserTest); |
| 31 defineReflectiveTests(SimpleParserTest); |
| 32 }); |
31 } | 33 } |
32 | 34 |
33 /** | 35 /** |
34 * Instances of the class `AstValidator` are used to validate the correct constr
uction of an | 36 * Instances of the class `AstValidator` are used to validate the correct constr
uction of an |
35 * AST structure. | 37 * AST structure. |
36 */ | 38 */ |
37 class AstValidator extends UnifyingAstVisitor<Object> { | 39 class AstValidator extends UnifyingAstVisitor<Object> { |
38 /** | 40 /** |
39 * A list containing the errors found while traversing the AST structure. | 41 * A list containing the errors found while traversing the AST structure. |
40 */ | 42 */ |
(...skipping 13401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13442 CompilationUnit _parseDirectives(String source, | 13444 CompilationUnit _parseDirectives(String source, |
13443 [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) { | 13445 [List<ErrorCode> errorCodes = ErrorCode.EMPTY_LIST]) { |
13444 createParser(source); | 13446 createParser(source); |
13445 CompilationUnit unit = parser.parseDirectives2(); | 13447 CompilationUnit unit = parser.parseDirectives2(); |
13446 expect(unit, isNotNull); | 13448 expect(unit, isNotNull); |
13447 expect(unit.declarations, hasLength(0)); | 13449 expect(unit.declarations, hasLength(0)); |
13448 listener.assertErrorsWithCodes(errorCodes); | 13450 listener.assertErrorsWithCodes(errorCodes); |
13449 return unit; | 13451 return unit; |
13450 } | 13452 } |
13451 } | 13453 } |
OLD | NEW |