Chromium Code Reviews| 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/standard_ast_factory.dart'; | 8 import 'package:analyzer/dart/ast/standard_ast_factory.dart'; |
| 9 import 'package:analyzer/dart/ast/token.dart'; | 9 import 'package:analyzer/dart/ast/token.dart'; |
| 10 import 'package:analyzer/dart/ast/visitor.dart'; | 10 import 'package:analyzer/dart/ast/visitor.dart'; |
| (...skipping 2300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2311 } | 2311 } |
| 2312 | 2312 |
| 2313 void test_nonIdentifierLibraryName_library() { | 2313 void test_nonIdentifierLibraryName_library() { |
| 2314 CompilationUnit unit = ParserTestCase.parseCompilationUnit( | 2314 CompilationUnit unit = ParserTestCase.parseCompilationUnit( |
| 2315 "library 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); | 2315 "library 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); |
| 2316 expect(unit, isNotNull); | 2316 expect(unit, isNotNull); |
| 2317 } | 2317 } |
| 2318 | 2318 |
| 2319 void test_nonIdentifierLibraryName_partOf() { | 2319 void test_nonIdentifierLibraryName_partOf() { |
| 2320 CompilationUnit unit = ParserTestCase.parseCompilationUnit( | 2320 CompilationUnit unit = ParserTestCase.parseCompilationUnit( |
| 2321 "part of 'lib';", [ParserErrorCode.NON_IDENTIFIER_LIBRARY_NAME]); | 2321 "part of 'lib';", []); |
|
Brian Wilkerson
2017/01/25 17:05:14
We should still check that this error is emitted w
Lasse Reichstein Nielsen
2017/01/26 10:39:13
Done.
| |
| 2322 expect(unit, isNotNull); | 2322 expect(unit, isNotNull); |
| 2323 } | 2323 } |
| 2324 | 2324 |
| 2325 void test_nonPartOfDirectiveInPart_after() { | 2325 void test_nonPartOfDirectiveInPart_after() { |
| 2326 ParserTestCase.parseCompilationUnit("part of l; part 'f.dart';", | 2326 ParserTestCase.parseCompilationUnit("part of l; part 'f.dart';", |
| 2327 [ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); | 2327 [ParserErrorCode.NON_PART_OF_DIRECTIVE_IN_PART]); |
| 2328 } | 2328 } |
| 2329 | 2329 |
| 2330 void test_nonPartOfDirectiveInPart_before() { | 2330 void test_nonPartOfDirectiveInPart_before() { |
| 2331 ParserTestCase.parseCompilationUnit("part 'f.dart'; part of m;", | 2331 ParserTestCase.parseCompilationUnit("part 'f.dart'; part of m;", |
| (...skipping 12272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 14604 CompilationUnit _parseDirectives(String source, | 14604 CompilationUnit _parseDirectives(String source, |
| 14605 [List<ErrorCode> errorCodes = const <ErrorCode>[]]) { | 14605 [List<ErrorCode> errorCodes = const <ErrorCode>[]]) { |
| 14606 createParser(source); | 14606 createParser(source); |
| 14607 CompilationUnit unit = parser.parseDirectives2(); | 14607 CompilationUnit unit = parser.parseDirectives2(); |
| 14608 expect(unit, isNotNull); | 14608 expect(unit, isNotNull); |
| 14609 expect(unit.declarations, hasLength(0)); | 14609 expect(unit.declarations, hasLength(0)); |
| 14610 listener.assertErrorsWithCodes(errorCodes); | 14610 listener.assertErrorsWithCodes(errorCodes); |
| 14611 return unit; | 14611 return unit; |
| 14612 } | 14612 } |
| 14613 } | 14613 } |
| OLD | NEW |