| 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 3de9dcf28d1d9caf987b25451a29c120c248f520..4cc374381056f4d286f8149d67035f21dca14579 100644
|
| --- a/pkg/analyzer/test/generated/incremental_resolver_test.dart
|
| +++ b/pkg/analyzer/test/generated/incremental_resolver_test.dart
|
| @@ -224,6 +224,24 @@ enum E {A, B}
|
| ''');
|
| }
|
|
|
| + void test_false_export_list_add() {
|
| + _assertCompilationUnitMatches(false, r'''
|
| +export 'dart:async';
|
| +''', r'''
|
| +export 'dart:async';
|
| +export 'dart:math';
|
| +''');
|
| + }
|
| +
|
| + void test_false_export_list_remove() {
|
| + _assertCompilationUnitMatches(false, r'''
|
| +export 'dart:async';
|
| +export 'dart:math';
|
| +''', r'''
|
| +export 'dart:async';
|
| +''');
|
| + }
|
| +
|
| void test_false_extendsClause_add() {
|
| _assertCompilationUnitMatches(false, r'''
|
| class A {}
|
| @@ -414,6 +432,106 @@ class C implements B, A {}
|
| ''');
|
| }
|
|
|
| + void test_false_import_hide_add() {
|
| + _assertCompilationUnitMatches(false, r'''
|
| +import 'dart:async' hide Future;
|
| +''', r'''
|
| +import 'dart:async' hide Future, Stream;
|
| +''');
|
| + }
|
| +
|
| + void test_false_import_hide_remove() {
|
| + _assertCompilationUnitMatches(false, r'''
|
| +import 'dart:async' hide Future, Stream;
|
| +''', r'''
|
| +import 'dart:async' hide Future;
|
| +''');
|
| + }
|
| +
|
| + void test_false_import_list_add() {
|
| + _assertCompilationUnitMatches(false, r'''
|
| +import 'dart:async';
|
| +''', r'''
|
| +import 'dart:async';
|
| +import 'dart:math';
|
| +''');
|
| + }
|
| +
|
| + void test_false_import_list_remove() {
|
| + _assertCompilationUnitMatches(false, r'''
|
| +import 'dart:async';
|
| +import 'dart:math';
|
| +''', r'''
|
| +import 'dart:async';
|
| +''');
|
| + }
|
| +
|
| + void test_false_import_prefix_add() {
|
| + _assertCompilationUnitMatches(false, r'''
|
| +import 'dart:async';
|
| +''', r'''
|
| +import 'dart:async' as async;
|
| +''');
|
| + }
|
| +
|
| + void test_false_import_prefix_edit() {
|
| + _assertCompilationUnitMatches(false, r'''
|
| +import 'dart:async' as oldPrefix;
|
| +''', r'''
|
| +import 'dart:async' as newPrefix;
|
| +''');
|
| + }
|
| +
|
| + void test_false_import_prefix_remove() {
|
| + _assertCompilationUnitMatches(false, r'''
|
| +import 'dart:async' as async;
|
| +''', r'''
|
| +import 'dart:async';
|
| +''');
|
| + }
|
| +
|
| + void test_false_import_show_add() {
|
| + _assertCompilationUnitMatches(false, r'''
|
| +import 'dart:async' show Future;
|
| +''', r'''
|
| +import 'dart:async' show Future, Stream;
|
| +''');
|
| + }
|
| +
|
| + void test_false_import_show_remove() {
|
| + _assertCompilationUnitMatches(false, r'''
|
| +import 'dart:async' show Future, Stream;
|
| +''', r'''
|
| +import 'dart:async' show Future;
|
| +''');
|
| + }
|
| +
|
| + void test_false_part_list_add() {
|
| + addNamedSource('/unitA.dart', 'part of lib; class A {}');
|
| + addNamedSource('/unitB.dart', 'part of lib; class B {}');
|
| + _assertCompilationUnitMatches(false, r'''
|
| +library lib;
|
| +part 'unitA.dart';
|
| +''', r'''
|
| +library lib;
|
| +part 'unitA.dart';
|
| +part 'unitB.dart';
|
| +''');
|
| + }
|
| +
|
| + void test_false_part_list_remove() {
|
| + addNamedSource('/unitA.dart', 'part of lib; class A {}');
|
| + addNamedSource('/unitB.dart', 'part of lib; class B {}');
|
| + _assertCompilationUnitMatches(false, r'''
|
| +library lib;
|
| +part 'unitA.dart';
|
| +part 'unitB.dart';
|
| +''', r'''
|
| +library lib;
|
| +part 'unitA.dart';
|
| +''');
|
| + }
|
| +
|
| void test_false_topLevelVariable_list_add() {
|
| _assertCompilationUnitMatches(false, r'''
|
| const int A = 1;
|
| @@ -701,6 +819,26 @@ main() {
|
| ''');
|
| }
|
|
|
| + void test_true_export_list_reorder() {
|
| + _assertCompilationUnitMatches(true, r'''
|
| +export 'dart:async';
|
| +export 'dart:math';
|
| +''', r'''
|
| +export 'dart:math';
|
| +export 'dart:async';
|
| +''');
|
| + }
|
| +
|
| + void test_true_export_list_same() {
|
| + _assertCompilationUnitMatches(true, r'''
|
| +export 'dart:async';
|
| +export 'dart:math';
|
| +''', r'''
|
| +export 'dart:async';
|
| +export 'dart:math';
|
| +''');
|
| + }
|
| +
|
| void test_true_extendsClause_same() {
|
| _assertCompilationUnitMatches(true, r'''
|
| class A {}
|
| @@ -753,6 +891,78 @@ class B implements A {}
|
| ''');
|
| }
|
|
|
| + void test_true_import_hide_reorder() {
|
| + _assertCompilationUnitMatches(true, r'''
|
| +import 'dart:async' hide Future, Stream;
|
| +''', r'''
|
| +import 'dart:async' hide Stream, Future;
|
| +''');
|
| + }
|
| +
|
| + void test_true_import_list_reorder() {
|
| + _assertCompilationUnitMatches(true, r'''
|
| +import 'dart:async';
|
| +import 'dart:math';
|
| +''', r'''
|
| +import 'dart:math';
|
| +import 'dart:async';
|
| +''');
|
| + }
|
| +
|
| + void test_true_import_list_same() {
|
| + _assertCompilationUnitMatches(true, r'''
|
| +import 'dart:async';
|
| +import 'dart:math';
|
| +''', r'''
|
| +import 'dart:async';
|
| +import 'dart:math';
|
| +''');
|
| + }
|
| +
|
| + void test_true_import_prefix() {
|
| + _assertCompilationUnitMatches(true, r'''
|
| +import 'dart:async' as async;
|
| +''', r'''
|
| +import 'dart:async' as async;
|
| +''');
|
| + }
|
| +
|
| + void test_true_import_show_reorder() {
|
| + _assertCompilationUnitMatches(true, r'''
|
| +import 'dart:async' show Future, Stream;
|
| +''', r'''
|
| +import 'dart:async' show Stream, Future;
|
| +''');
|
| + }
|
| +
|
| + void test_true_part_list_reorder() {
|
| + addNamedSource('/unitA.dart', 'part of lib; class A {}');
|
| + addNamedSource('/unitB.dart', 'part of lib; class B {}');
|
| + _assertCompilationUnitMatches(true, r'''
|
| +library lib;
|
| +part 'unitA.dart';
|
| +part 'unitB.dart';
|
| +''', r'''
|
| +library lib;
|
| +part 'unitB.dart';
|
| +part 'unitA.dart';
|
| +''');
|
| + }
|
| +
|
| + void test_true_part_list_same() {
|
| + addNamedSource('/unitA.dart', 'part of lib; class A {}');
|
| + addNamedSource('/unitB.dart', 'part of lib; class B {}');
|
| + _assertCompilationUnitMatches(true, r'''
|
| +library lib;
|
| +part 'unitA.dart';
|
| +part 'unitB.dart';
|
| +''', r'''
|
| +library lib;
|
| +part 'unitA.dart';
|
| +part 'unitB.dart';
|
| +''');
|
| + }
|
| +
|
| void test_true_topLevelVariable_list_reorder() {
|
| _assertCompilationUnitMatches(true, r'''
|
| const int A = 1;
|
| @@ -832,6 +1042,16 @@ class IncrementalResolverTest extends ResolverTestCase {
|
| LibraryElement library;
|
| CompilationUnit unit;
|
|
|
| + 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 fail_test_functionBody_addLocalVariable() {
|
| // TODO(scheglov) this test fails, because we don't create element models
|
| // for new local variables
|
| @@ -868,16 +1088,6 @@ class A {
|
| _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 {
|
| @@ -1018,10 +1228,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 _isExpression(AstNode node) => node is Expression;
|
| +
|
| static bool _isFunctionBody(AstNode node) => node is FunctionBody;
|
|
|
| static bool _isStatement(AstNode node) => node is Statement;
|
|
|