| 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 // 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/java_core.dart'; | 10 import 'package:analyzer/src/generated/java_core.dart'; |
| 11 import 'package:analyzer/src/generated/java_junit.dart'; | 11 import 'package:analyzer/src/generated/java_junit.dart'; |
| 12 import 'package:analyzer/src/generated/error.dart'; | 12 import 'package:analyzer/src/generated/error.dart'; |
| 13 import 'package:analyzer/src/generated/source.dart' show Source; | 13 import 'package:analyzer/src/generated/source.dart' show Source; |
| 14 import 'package:analyzer/src/generated/scanner.dart'; | 14 import 'package:analyzer/src/generated/scanner.dart'; |
| 15 import 'package:analyzer/src/generated/ast.dart'; | 15 import 'package:analyzer/src/generated/ast.dart'; |
| 16 import 'package:analyzer/src/generated/parser.dart'; | 16 import 'package:analyzer/src/generated/parser.dart'; |
| 17 import 'package:analyzer/src/generated/element.dart'; | 17 import 'package:analyzer/src/generated/element.dart'; |
| 18 import 'package:analyzer/src/generated/utilities_dart.dart'; | 18 import 'package:analyzer/src/generated/utilities_dart.dart'; |
| 19 import 'package:unittest/unittest.dart' as _ut; | 19 import 'package:unittest/unittest.dart' as _ut; |
| 20 import 'test_support.dart'; | 20 import 'test_support.dart'; |
| 21 import 'scanner_test.dart' show TokenFactory; | 21 import 'package:analyzer/src/generated/testing/ast_factory.dart'; |
| 22 import 'ast_test.dart' show AstFactory; | 22 import 'package:analyzer/src/generated/testing/element_factory.dart'; |
| 23 import 'element_test.dart' show ElementFactory; | 23 import 'package:analyzer/src/generated/testing/token_factory.dart'; |
| 24 | 24 |
| 25 class AnalysisErrorListener_SimpleParserTest_computeStringValue implements Analy
sisErrorListener { | 25 class AnalysisErrorListener_SimpleParserTest_computeStringValue implements Analy
sisErrorListener { |
| 26 @override | 26 @override |
| 27 void onError(AnalysisError event) { | 27 void onError(AnalysisError event) { |
| 28 JUnitTestCase.fail("Unexpected compilation error: ${event.message} (${event.
offset}, ${event.length})"); | 28 JUnitTestCase.fail("Unexpected compilation error: ${event.message} (${event.
offset}, ${event.length})"); |
| 29 } | 29 } |
| 30 } | 30 } |
| 31 | 31 |
| 32 /** | 32 /** |
| 33 * Instances of the class `AstValidator` are used to validate the correct constr
uction of an | 33 * Instances of the class `AstValidator` are used to validate the correct constr
uction of an |
| (...skipping 4618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4652 DartType staticType = ElementFactory.classElement2("C", []).type; | 4652 DartType staticType = ElementFactory.classElement2("C", []).type; |
| 4653 fromNode.staticType = staticType; | 4653 fromNode.staticType = staticType; |
| 4654 ParenthesizedExpression toNode = AstFactory.parenthesizedExpression(AstFacto
ry.integer(0)); | 4654 ParenthesizedExpression toNode = AstFactory.parenthesizedExpression(AstFacto
ry.integer(0)); |
| 4655 ResolutionCopier.copyResolutionData(fromNode, toNode); | 4655 ResolutionCopier.copyResolutionData(fromNode, toNode); |
| 4656 JUnitTestCase.assertSame(propagatedType, toNode.propagatedType); | 4656 JUnitTestCase.assertSame(propagatedType, toNode.propagatedType); |
| 4657 JUnitTestCase.assertSame(staticType, toNode.staticType); | 4657 JUnitTestCase.assertSame(staticType, toNode.staticType); |
| 4658 } | 4658 } |
| 4659 | 4659 |
| 4660 void test_visitPartDirective() { | 4660 void test_visitPartDirective() { |
| 4661 PartDirective fromNode = AstFactory.partDirective2("part.dart"); | 4661 PartDirective fromNode = AstFactory.partDirective2("part.dart"); |
| 4662 LibraryElement element = new LibraryElementImpl(null, AstFactory.libraryIden
tifier2(["lib"])); | 4662 LibraryElement element = new LibraryElementImpl.forNode(null, AstFactory.lib
raryIdentifier2(["lib"])); |
| 4663 fromNode.element = element; | 4663 fromNode.element = element; |
| 4664 PartDirective toNode = AstFactory.partDirective2("part.dart"); | 4664 PartDirective toNode = AstFactory.partDirective2("part.dart"); |
| 4665 ResolutionCopier.copyResolutionData(fromNode, toNode); | 4665 ResolutionCopier.copyResolutionData(fromNode, toNode); |
| 4666 JUnitTestCase.assertSame(element, toNode.element); | 4666 JUnitTestCase.assertSame(element, toNode.element); |
| 4667 } | 4667 } |
| 4668 | 4668 |
| 4669 void test_visitPartOfDirective() { | 4669 void test_visitPartOfDirective() { |
| 4670 PartOfDirective fromNode = AstFactory.partOfDirective(AstFactory.libraryIden
tifier2(["lib"])); | 4670 PartOfDirective fromNode = AstFactory.partOfDirective(AstFactory.libraryIden
tifier2(["lib"])); |
| 4671 LibraryElement element = new LibraryElementImpl(null, AstFactory.libraryIden
tifier2(["lib"])); | 4671 LibraryElement element = new LibraryElementImpl.forNode(null, AstFactory.lib
raryIdentifier2(["lib"])); |
| 4672 fromNode.element = element; | 4672 fromNode.element = element; |
| 4673 PartOfDirective toNode = AstFactory.partOfDirective(AstFactory.libraryIdenti
fier2(["lib"])); | 4673 PartOfDirective toNode = AstFactory.partOfDirective(AstFactory.libraryIdenti
fier2(["lib"])); |
| 4674 ResolutionCopier.copyResolutionData(fromNode, toNode); | 4674 ResolutionCopier.copyResolutionData(fromNode, toNode); |
| 4675 JUnitTestCase.assertSame(element, toNode.element); | 4675 JUnitTestCase.assertSame(element, toNode.element); |
| 4676 } | 4676 } |
| 4677 | 4677 |
| 4678 void test_visitPostfixExpression() { | 4678 void test_visitPostfixExpression() { |
| 4679 String variableName = "x"; | 4679 String variableName = "x"; |
| 4680 PostfixExpression fromNode = AstFactory.postfixExpression(AstFactory.identif
ier3(variableName), TokenType.PLUS_PLUS); | 4680 PostfixExpression fromNode = AstFactory.postfixExpression(AstFactory.identif
ier3(variableName), TokenType.PLUS_PLUS); |
| 4681 MethodElement propagatedElement = ElementFactory.methodElement("+", ElementF
actory.classElement2("C", []).type, []); | 4681 MethodElement propagatedElement = ElementFactory.methodElement("+", ElementF
actory.classElement2("C", []).type, []); |
| (...skipping 7289 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 11971 | 11971 |
| 11972 main() { | 11972 main() { |
| 11973 ComplexParserTest.dartSuite(); | 11973 ComplexParserTest.dartSuite(); |
| 11974 ErrorParserTest.dartSuite(); | 11974 ErrorParserTest.dartSuite(); |
| 11975 IncrementalParserTest.dartSuite(); | 11975 IncrementalParserTest.dartSuite(); |
| 11976 NonErrorParserTest.dartSuite(); | 11976 NonErrorParserTest.dartSuite(); |
| 11977 RecoveryParserTest.dartSuite(); | 11977 RecoveryParserTest.dartSuite(); |
| 11978 ResolutionCopierTest.dartSuite(); | 11978 ResolutionCopierTest.dartSuite(); |
| 11979 SimpleParserTest.dartSuite(); | 11979 SimpleParserTest.dartSuite(); |
| 11980 } | 11980 } |
| OLD | NEW |