| Index: pkg/analyzer/test/generated/incremental_resolver_test.dart
|
| diff --git a/pkg/analyzer/test/generated/incremental_resolver_test.dart b/pkg/analyzer/test/generated/incremental_resolver_test.dart
|
| index 3701dd8c01eaf57486420dcf49ac81df760fc153..3de9dcf28d1d9caf987b25451a29c120c248f520 100644
|
| --- a/pkg/analyzer/test/generated/incremental_resolver_test.dart
|
| +++ b/pkg/analyzer/test/generated/incremental_resolver_test.dart
|
| @@ -846,6 +846,50 @@ main(int a, int b) {
|
| '''), _isBlock);
|
| }
|
|
|
| + void test_constructor_body() {
|
| + _resolveUnit(r'''
|
| +class A {
|
| + int f;
|
| + A(int a, int b) {
|
| + f = a + b;
|
| + }
|
| +}''');
|
| + _resolve(_editString('+', '*'), _isFunctionBody);
|
| + }
|
| +
|
| + void test_constructor_fieldInitializer_edit() {
|
| + _resolveUnit(r'''
|
| +class A {
|
| + int f;
|
| + A(int a, int b) : f = a + b {
|
| + int a = 42;
|
| + }
|
| +}''');
|
| + _resolve(_editString('+', '*'), _isExpression);
|
| + }
|
| +
|
| + void fail_test_constructor_fieldInitializer_add() {
|
| + // TODO(scheglov) resolver uses "enclosingClass", which we don't set yet
|
| + _resolveUnit(r'''
|
| +class A {
|
| + int f;
|
| + A(int a, int b);
|
| +}''');
|
| + _resolve(_editString(');', ') : f = a + b;'), _isClassMember);
|
| + }
|
| +
|
| + void test_constructor_superConstructorInvocation() {
|
| + _resolveUnit(r'''
|
| +class A {
|
| + A(int p);
|
| +}
|
| +class A {
|
| + A(int a, int b) : super(a + b);
|
| +}
|
| +''');
|
| + _resolve(_editString('+', '*'), _isExpression);
|
| + }
|
| +
|
| void test_functionBody_body() {
|
| _resolveUnit(r'''
|
| main(int a, int b) {
|
| @@ -854,6 +898,13 @@ main(int a, int b) {
|
| _resolve(_editString('+', '*'), _isFunctionBody);
|
| }
|
|
|
| + void test_functionBody_expression() {
|
| + _resolveUnit(r'''
|
| +main(int a, int b) => a + b;
|
| +''');
|
| + _resolve(_editString('+', '*'), _isExpression);
|
| + }
|
| +
|
| void test_functionBody_statement() {
|
| _resolveUnit(r'''
|
| main(int a, int b) {
|
| @@ -862,6 +913,23 @@ main(int a, int b) {
|
| _resolve(_editString('+', '*'), _isStatement);
|
| }
|
|
|
| + void test_method_body() {
|
| + _resolveUnit(r'''
|
| +class A {
|
| + m(int a, int b) {
|
| + return a + b;
|
| + }
|
| +}''');
|
| + _resolve(_editString('+', '*'), _isFunctionBody);
|
| + }
|
| +
|
| + void test_topLevelVariable_initializer() {
|
| + _resolveUnit(r'''
|
| +int C = 1 + 2;
|
| +''');
|
| + _resolve(_editString('+', '*'), _isExpression);
|
| + }
|
| +
|
| void test_updateElementOffset() {
|
| _resolveUnit(r'''
|
| class A {
|
| @@ -950,6 +1018,10 @@ class B {
|
|
|
| static bool _isBlock(AstNode node) => node is Block;
|
|
|
| + static bool _isExpression(AstNode node) => node is Expression;
|
| +
|
| + static bool _isClassMember(AstNode node) => node is ClassMember;
|
| +
|
| static bool _isFunctionBody(AstNode node) => node is FunctionBody;
|
|
|
| static bool _isStatement(AstNode node) => node is Statement;
|
|
|