mirror of
https://github.com/dart-lang/sdk
synced 2024-10-07 09:01:03 +00:00
Use testPackageLibPath in analysis_server/ tests.
Change-Id: I0500183fe14288447735c85e6d8e070fc913e8a4 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/221993 Reviewed-by: Brian Wilkerson <brianwilkerson@google.com>
This commit is contained in:
parent
73f4377011
commit
387fc2e8db
|
@ -94,6 +94,6 @@ class AbstractSingleUnitTest extends AbstractContextTest {
|
|||
@override
|
||||
void setUp() {
|
||||
super.setUp();
|
||||
testFile = convertPath('/home/test/lib/test.dart');
|
||||
testFile = convertPath('$testPackageLibPath/test.dart');
|
||||
}
|
||||
}
|
||||
|
|
|
@ -123,7 +123,7 @@ mixin ArgListContributorMixin on DartCompletionContributorTest {
|
|||
class ArgListContributorTest extends DartCompletionContributorTest
|
||||
with ArgListContributorMixin {
|
||||
Future<void> test_Annotation_imported_constructor_named_param() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library libA; class A { const A({int one, String two: 'defaultValue'}); }''');
|
||||
addTestSource('import "a.dart"; @A(^) main() { }');
|
||||
await computeSuggestions();
|
||||
|
@ -132,7 +132,7 @@ library libA; class A { const A({int one, String two: 'defaultValue'}); }''');
|
|||
}
|
||||
|
||||
Future<void> test_Annotation_importedConstructor_prefixed() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
const A({int value});
|
||||
}
|
||||
|
@ -581,7 +581,8 @@ foo({String children}) {}
|
|||
|
||||
Future<void> test_ArgumentList_imported_constructor_named_param() async {
|
||||
// ArgumentList InstanceCreationExpression ExpressionStatement
|
||||
addSource('/home/test/lib/a.dart', 'library libA; class A{A({int one}); }');
|
||||
addSource(
|
||||
'$testPackageLibPath/a.dart', 'library libA; class A{A({int one}); }');
|
||||
addTestSource('import "a.dart"; main() { new A(^);}');
|
||||
await computeSuggestions();
|
||||
assertSuggestArgumentsAndTypes(namedArgumentsWithTypes: {'one': 'int'});
|
||||
|
@ -589,8 +590,8 @@ foo({String children}) {}
|
|||
|
||||
Future<void> test_ArgumentList_imported_constructor_named_param2() async {
|
||||
// ArgumentList InstanceCreationExpression ExpressionStatement
|
||||
addSource(
|
||||
'/home/test/lib/a.dart', 'library libA; class A{A.foo({int one}); }');
|
||||
addSource('$testPackageLibPath/a.dart',
|
||||
'library libA; class A{A.foo({int one}); }');
|
||||
addTestSource('import "a.dart"; main() { new A.foo(^);}');
|
||||
await computeSuggestions();
|
||||
assertSuggestArgumentsAndTypes(namedArgumentsWithTypes: {'one': 'int'});
|
||||
|
@ -599,7 +600,7 @@ foo({String children}) {}
|
|||
Future<void>
|
||||
test_ArgumentList_imported_constructor_named_typed_param() async {
|
||||
// ArgumentList InstanceCreationExpression VariableDeclaration
|
||||
addSource('/home/test/lib/a.dart',
|
||||
addSource('$testPackageLibPath/a.dart',
|
||||
'library libA; class A { A({int i, String s, d}) {} }}');
|
||||
addTestSource('import "a.dart"; main() { var a = new A(^);}');
|
||||
await computeSuggestions();
|
||||
|
@ -609,7 +610,7 @@ foo({String children}) {}
|
|||
|
||||
Future<void> test_ArgumentList_imported_factory_named_param() async {
|
||||
// ArgumentList InstanceCreationExpression ExpressionStatement
|
||||
addSource('/home/test/lib/a.dart',
|
||||
addSource('$testPackageLibPath/a.dart',
|
||||
'library libA; class A{factory A({int one}) => throw 0;}');
|
||||
addTestSource('import "a.dart"; main() { new A(^);}');
|
||||
await computeSuggestions();
|
||||
|
@ -618,7 +619,7 @@ foo({String children}) {}
|
|||
|
||||
Future<void> test_ArgumentList_imported_factory_named_param2() async {
|
||||
// ArgumentList InstanceCreationExpression ExpressionStatement
|
||||
addSource('/home/test/lib/a.dart',
|
||||
addSource('$testPackageLibPath/a.dart',
|
||||
'library libA; abstract class A{factory A.foo({int one});}');
|
||||
addTestSource('import "a.dart"; main() { new A.foo(^);}');
|
||||
await computeSuggestions();
|
||||
|
@ -627,7 +628,7 @@ foo({String children}) {}
|
|||
|
||||
Future<void> test_ArgumentList_imported_factory_named_typed_param() async {
|
||||
// ArgumentList InstanceCreationExpression VariableDeclaration
|
||||
addSource('/home/test/lib/a.dart',
|
||||
addSource('$testPackageLibPath/a.dart',
|
||||
'library libA; class A {factory A({int i, String s, d}) {} }}');
|
||||
addTestSource('import "a.dart"; main() { var a = new A(^);}');
|
||||
await computeSuggestions();
|
||||
|
@ -637,7 +638,7 @@ foo({String children}) {}
|
|||
|
||||
Future<void> test_ArgumentList_imported_function_0() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }
|
||||
expect() { }
|
||||
|
@ -653,7 +654,7 @@ foo({String children}) {}
|
|||
|
||||
Future<void> test_ArgumentList_imported_function_3a() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }
|
||||
expect(String arg1, int arg2, {bool arg3}) { }
|
||||
|
@ -669,7 +670,7 @@ foo({String children}) {}
|
|||
|
||||
Future<void> test_ArgumentList_imported_function_3b() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }
|
||||
expect(String arg1, int arg2, {bool arg3}) { }
|
||||
|
@ -685,7 +686,7 @@ foo({String children}) {}
|
|||
|
||||
Future<void> test_ArgumentList_imported_function_3c() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }
|
||||
expect(String arg1, int arg2, {bool arg3}) { }
|
||||
|
@ -701,7 +702,7 @@ foo({String children}) {}
|
|||
|
||||
Future<void> test_ArgumentList_imported_function_3d() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }
|
||||
expect(String arg1, int arg2, {bool arg3}) { }
|
||||
|
@ -1084,7 +1085,7 @@ main() { f("16", radix: ^);}''');
|
|||
|
||||
Future<void> test_ArgumentList_local_method_0() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }
|
||||
void baz() { }''');
|
||||
|
@ -1111,7 +1112,7 @@ main() { f(^);}');
|
|||
}
|
||||
|
||||
Future<void> test_ArgumentList_nnbd_function_named_param_imported() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
f({int? nullable, int nonnullable}) {}''');
|
||||
createAnalysisOptionsFile(experiments: [EnableString.non_nullable]);
|
||||
addTestSource(r'''
|
||||
|
@ -1126,7 +1127,7 @@ main() { f(^);}');
|
|||
}
|
||||
|
||||
Future<void> test_ArgumentList_nnbd_function_named_param_legacy() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
// @dart = 2.8
|
||||
f({int named}) {}''');
|
||||
addTestSource(r'''
|
||||
|
|
|
@ -41,17 +41,17 @@ class CombinatorContributorTest extends DartCompletionContributorTest {
|
|||
|
||||
Future<void> test_Combinator_hide() async {
|
||||
// SimpleIdentifier HideCombinator ImportDirective
|
||||
addSource('/home/test/lib/ab.dart', '''
|
||||
addSource('$testPackageLibPath/ab.dart', '''
|
||||
library libAB;
|
||||
part "ab_part.dart";
|
||||
class A { }
|
||||
class B { }''');
|
||||
addSource('/home/test/lib/ab_part.dart', '''
|
||||
addSource('$testPackageLibPath/ab_part.dart', '''
|
||||
part of libAB;
|
||||
var T1;
|
||||
PB F1() => new PB();
|
||||
class PB { }''');
|
||||
addSource('/home/test/lib/cd.dart', '''
|
||||
addSource('$testPackageLibPath/cd.dart', '''
|
||||
class C { }
|
||||
class D { }''');
|
||||
addTestSource('''
|
||||
|
@ -81,20 +81,20 @@ class CombinatorContributorTest extends DartCompletionContributorTest {
|
|||
|
||||
Future<void> test_Combinator_show() async {
|
||||
// SimpleIdentifier HideCombinator ImportDirective
|
||||
addSource('/home/test/lib/ab.dart', '''
|
||||
addSource('$testPackageLibPath/ab.dart', '''
|
||||
library libAB;
|
||||
part "ab_part.dart";
|
||||
class A { }
|
||||
class B { }
|
||||
class _AB''');
|
||||
addSource('/home/test/lib/ab_part.dart', '''
|
||||
addSource('$testPackageLibPath/ab_part.dart', '''
|
||||
part of libAB;
|
||||
var T1;
|
||||
PB F1() => new PB();
|
||||
typedef PB2 F2(int blat);
|
||||
class Clz = Object with Object;
|
||||
class PB { }''');
|
||||
addSource('/home/test/lib/cd.dart', '''
|
||||
addSource('$testPackageLibPath/cd.dart', '''
|
||||
class C { }
|
||||
class D { }''');
|
||||
addTestSource('''
|
||||
|
@ -129,11 +129,11 @@ class CombinatorContributorTest extends DartCompletionContributorTest {
|
|||
}
|
||||
|
||||
Future<void> test_Combinator_show_export_withShow() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
class A {}
|
||||
class B {}
|
||||
''');
|
||||
addSource('/home/test/lib/b.dart', r'''
|
||||
addSource('$testPackageLibPath/b.dart', r'''
|
||||
export 'a.dart' show A;
|
||||
''');
|
||||
addTestSource(r'''
|
||||
|
@ -152,10 +152,10 @@ import 'b.dart' show ^;
|
|||
}
|
||||
|
||||
Future<void> test_Combinator_show_recursive() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {}
|
||||
''');
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
export 'a.dart';
|
||||
export 'b.dart';
|
||||
class B {}
|
||||
|
|
|
@ -609,7 +609,7 @@ abstract class _BaseDartCompletionContributorTest extends AbstractContextTest {
|
|||
@override
|
||||
void setUp() {
|
||||
super.setUp();
|
||||
testFile = convertPath('/home/test/lib/test.dart');
|
||||
testFile = convertPath('$testPackageLibPath/test.dart');
|
||||
}
|
||||
|
||||
CompletionSuggestion suggestionWith(
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -29,7 +29,7 @@ class LibraryMemberContributorTest extends DartCompletionContributorTest {
|
|||
|
||||
Future<void> test_extension() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
extension MyExt on int {}
|
||||
''');
|
||||
addTestSource('''
|
||||
|
@ -134,7 +134,7 @@ extension MyExt on int {}
|
|||
|
||||
Future<void> test_PrefixedIdentifier_library() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
var T1;
|
||||
class X { }
|
||||
|
@ -158,11 +158,11 @@ extension MyExt on int {}
|
|||
}
|
||||
|
||||
Future<void> test_PrefixedIdentifier_library_export_withShow() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
class A {}
|
||||
class B {}
|
||||
''');
|
||||
addSource('/home/test/lib/b.dart', r'''
|
||||
addSource('$testPackageLibPath/b.dart', r'''
|
||||
export 'a.dart' show A;
|
||||
''');
|
||||
addTestSource(r'''
|
||||
|
@ -177,7 +177,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_PrefixedIdentifier_library_import_withShow() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
class A {}
|
||||
class B {}
|
||||
''');
|
||||
|
|
|
@ -45,21 +45,21 @@ class LibraryPrefixContributorTest extends DartCompletionContributorTest {
|
|||
|
||||
Future<void> test_Block() async {
|
||||
// Block BlockFunctionBody MethodDeclaration
|
||||
addSource('/home/test/lib/ab.dart', '''
|
||||
addSource('$testPackageLibPath/ab.dart', '''
|
||||
export "dart:math" hide max;
|
||||
class A {int x;}
|
||||
@deprecated D1() {int x;}
|
||||
class _B {boo() { partBoo() {}} }''');
|
||||
addSource('/home/test/lib/cd.dart', '''
|
||||
addSource('$testPackageLibPath/cd.dart', '''
|
||||
String T1;
|
||||
var _T2;
|
||||
class C { }
|
||||
class D { }''');
|
||||
addSource('/home/test/lib/eef.dart', '''
|
||||
addSource('$testPackageLibPath/eef.dart', '''
|
||||
class EE { }
|
||||
class F { }''');
|
||||
addSource('/home/test/lib/g.dart', 'class G { }');
|
||||
addSource('/home/test/lib/h.dart', '''
|
||||
addSource('$testPackageLibPath/g.dart', 'class G { }');
|
||||
addSource('$testPackageLibPath/h.dart', '''
|
||||
class H { }
|
||||
int T3;
|
||||
var _T4;'''); // not imported
|
||||
|
@ -186,7 +186,7 @@ class Z { }''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -201,7 +201,7 @@ A T;''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body_final() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -216,7 +216,7 @@ A T;''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body_final_field() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -231,7 +231,7 @@ A T;''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body_final_field2() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as Soo;
|
||||
|
@ -246,7 +246,7 @@ A Sew;''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body_final_final() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -261,7 +261,7 @@ A T;''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body_final_var() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -275,7 +275,7 @@ A T;''');
|
|||
}
|
||||
|
||||
Future<void> test_InstanceCreationExpression() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {foo(){var f; {var x;}}}
|
||||
class B {B(this.x, [String boo]) { } int x;}
|
||||
class C {C.bar({boo: 'hoo', int z: 0}) { } }''');
|
||||
|
@ -294,11 +294,11 @@ main() {new ^ String x = "hello";}''');
|
|||
}
|
||||
|
||||
Future<void> test_InstanceCreationExpression_inPart() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {foo(){var f; {var x;}}}
|
||||
class B {B(this.x, [String boo]) { } int x;}
|
||||
class C {C.bar({boo: 'hoo', int z: 0}) { } }''');
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
library testB;
|
||||
import "a.dart" as t;
|
||||
import "dart:math" as math;
|
||||
|
@ -313,11 +313,11 @@ main() {new ^ String x = "hello";}''');
|
|||
}
|
||||
|
||||
Future<void> test_InstanceCreationExpression_inPart_detached() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {foo(){var f; {var x;}}}
|
||||
class B {B(this.x, [String boo]) { } int x;}
|
||||
class C {C.bar({boo: 'hoo', int z: 0}) { } }''');
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
library testB;
|
||||
import "a.dart" as t;
|
||||
import "dart:math" as math;
|
||||
|
|
|
@ -81,7 +81,7 @@ void f() {h^}''');
|
|||
|
||||
Future<void> test_ArgDefaults_inherited_method_with_required_named() async {
|
||||
writeTestPackageConfig(meta: true);
|
||||
resolveSource('/home/test/lib/b.dart', '''
|
||||
resolveSource('$testPackageLibPath/b.dart', '''
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
lib libB;
|
||||
|
@ -120,7 +120,7 @@ class A {
|
|||
|
||||
Future<void> test_ArgumentList() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }
|
||||
void baz() { }''');
|
||||
|
@ -145,7 +145,7 @@ void f() {expect(^)}''');
|
|||
|
||||
Future<void> test_ArgumentList_imported_function() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }
|
||||
expect(arg) { }
|
||||
|
@ -172,7 +172,7 @@ void f() {expect(^)}''');
|
|||
Future<void>
|
||||
test_ArgumentList_InstanceCreationExpression_functionalArg() async {
|
||||
// ArgumentList InstanceCreationExpression ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
class A { A(f()) { } }
|
||||
bool hasLength(int expected) { }
|
||||
|
@ -201,7 +201,7 @@ void f() {new A(^)}''');
|
|||
|
||||
Future<void> test_ArgumentList_InstanceCreationExpression_typedefArg() async {
|
||||
// ArgumentList InstanceCreationExpression ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
typedef Funct();
|
||||
class A { A(Funct f) { } }
|
||||
|
@ -231,7 +231,7 @@ void f() {new A(^)}''');
|
|||
|
||||
Future<void> test_ArgumentList_local_function() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }
|
||||
void baz() { }''');
|
||||
|
@ -257,7 +257,7 @@ void f() {expect(^)}''');
|
|||
|
||||
Future<void> test_ArgumentList_local_method() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }
|
||||
void baz() { }''');
|
||||
|
@ -283,7 +283,7 @@ String bar() => true;''');
|
|||
|
||||
Future<void> test_ArgumentList_MethodInvocation_functionalArg() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
class A { A(f()) { } }
|
||||
bool hasLength(int expected) { }
|
||||
|
@ -314,7 +314,7 @@ void f() {boo(){} bar(^);}''');
|
|||
|
||||
Future<void> test_ArgumentList_MethodInvocation_functionalArg2() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
class A { A(f()) { } }
|
||||
bool hasLength(int expected) { }
|
||||
|
@ -350,7 +350,7 @@ void f() {boo(){} bar(inc: ^);}''');
|
|||
|
||||
Future<void> test_ArgumentList_MethodInvocation_methodArg() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
class A { A(f()) { } }
|
||||
bool hasLength(int expected) { }
|
||||
|
@ -375,7 +375,7 @@ void f() {new B().bar(^);}''');
|
|||
}
|
||||
|
||||
Future<void> test_ArgumentList_namedFieldParam_tear_off() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
typedef void VoidCallback();
|
||||
|
||||
class Button {
|
||||
|
@ -406,7 +406,7 @@ class PageState {
|
|||
Future<void> test_ArgumentList_namedParam() async {
|
||||
// SimpleIdentifier NamedExpression ArgumentList MethodInvocation
|
||||
// ExpressionStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }''');
|
||||
addTestSource('''
|
||||
|
@ -452,7 +452,7 @@ void f() {expect(foo: ^)}''');
|
|||
}
|
||||
|
||||
Future<void> test_ArgumentList_namedParam_tear_off() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
typedef void VoidCallback();
|
||||
|
||||
class Button {
|
||||
|
@ -480,7 +480,7 @@ class PageState {
|
|||
}
|
||||
|
||||
Future<void> test_ArgumentList_namedParam_tear_off_1() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
typedef void VoidCallback();
|
||||
|
||||
class Button {
|
||||
|
@ -508,7 +508,7 @@ class PageState {
|
|||
}
|
||||
|
||||
Future<void> test_ArgumentList_namedParam_tear_off_2() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
typedef void VoidCallback();
|
||||
|
||||
class Button {
|
||||
|
@ -755,7 +755,7 @@ f() async {A a; await ^}''');
|
|||
|
||||
Future<void> test_AwaitExpression_inherited() async {
|
||||
// SimpleIdentifier AwaitExpression ExpressionStatement
|
||||
resolveSource('/home/test/lib/b.dart', '''
|
||||
resolveSource('$testPackageLibPath/b.dart', '''
|
||||
lib libB;
|
||||
class A {
|
||||
Future y() async {return 0;}
|
||||
|
@ -812,21 +812,21 @@ class B extends A {
|
|||
|
||||
Future<void> test_Block() async {
|
||||
// Block BlockFunctionBody MethodDeclaration
|
||||
addSource('/home/test/lib/ab.dart', '''
|
||||
addSource('$testPackageLibPath/ab.dart', '''
|
||||
export "dart:math" hide max;
|
||||
class A {int x;}
|
||||
@deprecated D1() {int x;}
|
||||
class _B {boo() { partBoo() {}} }''');
|
||||
addSource('/home/test/lib/cd.dart', '''
|
||||
addSource('$testPackageLibPath/cd.dart', '''
|
||||
String T1;
|
||||
var _T2;
|
||||
class C { }
|
||||
class D { }''');
|
||||
addSource('/home/test/lib/eef.dart', '''
|
||||
addSource('$testPackageLibPath/eef.dart', '''
|
||||
class EE { }
|
||||
class F { }''');
|
||||
addSource('/home/test/lib/g.dart', 'class G { }');
|
||||
addSource('/home/test/lib/h.dart', '''
|
||||
addSource('$testPackageLibPath/g.dart', 'class G { }');
|
||||
addSource('$testPackageLibPath/h.dart', '''
|
||||
class H { }
|
||||
int T3;
|
||||
var _T4;'''); // not imported
|
||||
|
@ -905,21 +905,21 @@ class Z { }''');
|
|||
|
||||
Future<void> test_Block_final() async {
|
||||
// Block BlockFunctionBody MethodDeclaration
|
||||
addSource('/home/test/lib/ab.dart', '''
|
||||
addSource('$testPackageLibPath/ab.dart', '''
|
||||
export "dart:math" hide max;
|
||||
class A {int x;}
|
||||
@deprecated D1() {int x;}
|
||||
class _B {boo() { partBoo() {}} }''');
|
||||
addSource('/home/test/lib/cd.dart', '''
|
||||
addSource('$testPackageLibPath/cd.dart', '''
|
||||
String T1;
|
||||
var _T2;
|
||||
class C { }
|
||||
class D { }''');
|
||||
addSource('/home/test/lib/eef.dart', '''
|
||||
addSource('$testPackageLibPath/eef.dart', '''
|
||||
class EE { }
|
||||
class F { }''');
|
||||
addSource('/home/test/lib/g.dart', 'class G { }');
|
||||
addSource('/home/test/lib/h.dart', '''
|
||||
addSource('$testPackageLibPath/g.dart', 'class G { }');
|
||||
addSource('$testPackageLibPath/h.dart', '''
|
||||
class H { }
|
||||
int T3;
|
||||
var _T4;'''); // not imported
|
||||
|
@ -1018,21 +1018,21 @@ class Z { }''');
|
|||
|
||||
Future<void> test_Block_final_final() async {
|
||||
// Block BlockFunctionBody MethodDeclaration
|
||||
addSource('/home/test/lib/ab.dart', '''
|
||||
addSource('$testPackageLibPath/ab.dart', '''
|
||||
export "dart:math" hide max;
|
||||
class A {int x;}
|
||||
@deprecated D1() {int x;}
|
||||
class _B {boo() { partBoo() {}} }''');
|
||||
addSource('/home/test/lib/cd.dart', '''
|
||||
addSource('$testPackageLibPath/cd.dart', '''
|
||||
String T1;
|
||||
var _T2;
|
||||
class C { }
|
||||
class D { }''');
|
||||
addSource('/home/test/lib/eef.dart', '''
|
||||
addSource('$testPackageLibPath/eef.dart', '''
|
||||
class EE { }
|
||||
class F { }''');
|
||||
addSource('/home/test/lib/g.dart', 'class G { }');
|
||||
addSource('/home/test/lib/h.dart', '''
|
||||
addSource('$testPackageLibPath/g.dart', 'class G { }');
|
||||
addSource('$testPackageLibPath/h.dart', '''
|
||||
class H { }
|
||||
int T3;
|
||||
var _T4;'''); // not imported
|
||||
|
@ -1117,21 +1117,21 @@ class Z { }''');
|
|||
|
||||
Future<void> test_Block_final_var() async {
|
||||
// Block BlockFunctionBody MethodDeclaration
|
||||
addSource('/home/test/lib/ab.dart', '''
|
||||
addSource('$testPackageLibPath/ab.dart', '''
|
||||
export "dart:math" hide max;
|
||||
class A {int x;}
|
||||
@deprecated D1() {int x;}
|
||||
class _B {boo() { partBoo() {}} }''');
|
||||
addSource('/home/test/lib/cd.dart', '''
|
||||
addSource('$testPackageLibPath/cd.dart', '''
|
||||
String T1;
|
||||
var _T2;
|
||||
class C { }
|
||||
class D { }''');
|
||||
addSource('/home/test/lib/eef.dart', '''
|
||||
addSource('$testPackageLibPath/eef.dart', '''
|
||||
class EE { }
|
||||
class F { }''');
|
||||
addSource('/home/test/lib/g.dart', 'class G { }');
|
||||
addSource('/home/test/lib/h.dart', '''
|
||||
addSource('$testPackageLibPath/g.dart', 'class G { }');
|
||||
addSource('$testPackageLibPath/h.dart', '''
|
||||
class H { }
|
||||
int T3;
|
||||
var _T4;'''); // not imported
|
||||
|
@ -1215,21 +1215,21 @@ class Z { }''');
|
|||
}
|
||||
|
||||
Future<void> test_Block_identifier_partial() async {
|
||||
addSource('/home/test/lib/ab.dart', '''
|
||||
addSource('$testPackageLibPath/ab.dart', '''
|
||||
export "dart:math" hide max;
|
||||
class A {int x;}
|
||||
@deprecated D1() {int x;}
|
||||
class _B { }''');
|
||||
addSource('/home/test/lib/cd.dart', '''
|
||||
addSource('$testPackageLibPath/cd.dart', '''
|
||||
String T1;
|
||||
var _T2;
|
||||
class C { }
|
||||
class D { }''');
|
||||
addSource('/home/test/lib/eef.dart', '''
|
||||
addSource('$testPackageLibPath/eef.dart', '''
|
||||
class EE { }
|
||||
class F { }''');
|
||||
addSource('/home/test/lib/g.dart', 'class G { }');
|
||||
addSource('/home/test/lib/h.dart', '''
|
||||
addSource('$testPackageLibPath/g.dart', 'class G { }');
|
||||
addSource('$testPackageLibPath/h.dart', '''
|
||||
class H { }
|
||||
class D3 { }
|
||||
int T3;
|
||||
|
@ -1294,7 +1294,7 @@ class Z { }''');
|
|||
|
||||
Future<void> test_Block_inherited_imported() async {
|
||||
// Block BlockFunctionBody MethodDeclaration ClassDeclaration
|
||||
resolveSource('/home/test/lib/b.dart', '''
|
||||
resolveSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
class F { var f1; f2() { } get f3 => 0; set f4(fx) { } var _pf; }
|
||||
class E extends F { var e1; e2() { } }
|
||||
|
@ -1322,7 +1322,7 @@ class A extends E implements I with M {a() {^}}''');
|
|||
|
||||
Future<void> test_Block_inherited_imported_from_constructor() async {
|
||||
// Block BlockFunctionBody ConstructorDeclaration ClassDeclaration
|
||||
resolveSource('/home/test/lib/b.dart', '''
|
||||
resolveSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
class F { var f1; f2() { } get f3 => 0; set f4(fx) { } var _pf; }
|
||||
class E extends F { var e1; e2() { } }
|
||||
|
@ -1349,7 +1349,7 @@ class A extends E implements I with M {a() {^}}''');
|
|||
|
||||
Future<void> test_Block_inherited_imported_from_method() async {
|
||||
// Block BlockFunctionBody MethodDeclaration ClassDeclaration
|
||||
resolveSource('/home/test/lib/b.dart', '''
|
||||
resolveSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
class F { var f1; f2() { } get f3 => 0; set f4(fx) { } var _pf; }
|
||||
class E extends F { var e1; e2() { } }
|
||||
|
@ -1448,21 +1448,21 @@ class A extends E implements I with M {a() {^}}''');
|
|||
}
|
||||
|
||||
Future<void> test_Block_local_function() async {
|
||||
addSource('/home/test/lib/ab.dart', '''
|
||||
addSource('$testPackageLibPath/ab.dart', '''
|
||||
export "dart:math" hide max;
|
||||
class A {int x;}
|
||||
@deprecated D1() {int x;}
|
||||
class _B {boo() { partBoo() {}} }''');
|
||||
addSource('/home/test/lib/cd.dart', '''
|
||||
addSource('$testPackageLibPath/cd.dart', '''
|
||||
String T1;
|
||||
var _T2;
|
||||
class C { }
|
||||
class D { }''');
|
||||
addSource('/home/test/lib/eef.dart', '''
|
||||
addSource('$testPackageLibPath/eef.dart', '''
|
||||
class EE { }
|
||||
class F { }''');
|
||||
addSource('/home/test/lib/g.dart', 'class G { }');
|
||||
addSource('/home/test/lib/h.dart', '''
|
||||
addSource('$testPackageLibPath/g.dart', 'class G { }');
|
||||
addSource('$testPackageLibPath/h.dart', '''
|
||||
class H { }
|
||||
int T3;
|
||||
var _T4;'''); // not imported
|
||||
|
@ -1526,7 +1526,7 @@ void f() {
|
|||
|
||||
Future<void> test_CascadeExpression_selector1() async {
|
||||
// PropertyAccess CascadeExpression ExpressionStatement Block
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart";
|
||||
|
@ -1551,7 +1551,7 @@ void f() {A a; a.^.z}''');
|
|||
|
||||
Future<void> test_CascadeExpression_selector2() async {
|
||||
// SimpleIdentifier PropertyAccess CascadeExpression ExpressionStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart";
|
||||
|
@ -1574,7 +1574,7 @@ void f() {A a; a..^z}''');
|
|||
|
||||
Future<void> test_CascadeExpression_selector2_withTrailingReturn() async {
|
||||
// PropertyAccess CascadeExpression ExpressionStatement Block
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart";
|
||||
|
@ -1680,7 +1680,7 @@ class E {}
|
|||
|
||||
Future<void> test_ClassDeclaration_body() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -1709,7 +1709,7 @@ A T;''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body_final() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -1730,7 +1730,7 @@ A T;''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body_final_field() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -1751,7 +1751,7 @@ A T;''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body_final_field2() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as Soo;
|
||||
|
@ -1772,7 +1772,7 @@ A Sew;''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body_final_final() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -1793,7 +1793,7 @@ A T;''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body_final_var() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -1839,7 +1839,7 @@ class Abcd { }
|
|||
|
||||
Future<void> test_Combinator_hide() async {
|
||||
// SimpleIdentifier HideCombinator ImportDirective
|
||||
addSource('/home/test/lib/ab.dart', '''
|
||||
addSource('$testPackageLibPath/ab.dart', '''
|
||||
library libAB;
|
||||
part 'partAB.dart';
|
||||
class A { }
|
||||
|
@ -1849,7 +1849,7 @@ part of libAB;
|
|||
var T1;
|
||||
PB F1() => new PB();
|
||||
class PB { }''');
|
||||
addSource('/home/test/lib/cd.dart', '''
|
||||
addSource('$testPackageLibPath/cd.dart', '''
|
||||
class C { }
|
||||
class D { }''');
|
||||
addTestSource('''
|
||||
|
@ -1863,7 +1863,7 @@ class X {}''');
|
|||
|
||||
Future<void> test_Combinator_show() async {
|
||||
// SimpleIdentifier HideCombinator ImportDirective
|
||||
addSource('/home/test/lib/ab.dart', '''
|
||||
addSource('$testPackageLibPath/ab.dart', '''
|
||||
library libAB;
|
||||
part 'partAB.dart';
|
||||
class A { }
|
||||
|
@ -1875,7 +1875,7 @@ PB F1() => new PB();
|
|||
typedef PB2 F2(int blat);
|
||||
class Clz = Object with Object;
|
||||
class PB { }''');
|
||||
addSource('/home/test/lib/cd.dart', '''
|
||||
addSource('$testPackageLibPath/cd.dart', '''
|
||||
class C { }
|
||||
class D { }''');
|
||||
addTestSource('''
|
||||
|
@ -1889,7 +1889,7 @@ class X {}''');
|
|||
|
||||
Future<void> test_ConditionalExpression_elseExpression() async {
|
||||
// SimpleIdentifier ConditionalExpression ReturnStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {int x;}''');
|
||||
|
@ -1909,7 +1909,7 @@ class C {foo(){var f; {var x;} return a ? T1 : T^}}''');
|
|||
|
||||
Future<void> test_ConditionalExpression_elseExpression_empty() async {
|
||||
// SimpleIdentifier ConditionalExpression ReturnStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {int x;}''');
|
||||
|
@ -1935,7 +1935,7 @@ class C {foo(){var f; {var x;} return a ? T1 : ^}}''');
|
|||
|
||||
Future<void> test_ConditionalExpression_partial_thenExpression() async {
|
||||
// SimpleIdentifier ConditionalExpression ReturnStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {int x;}''');
|
||||
|
@ -1955,7 +1955,7 @@ class C {foo(){var f; {var x;} return a ? T^}}''');
|
|||
|
||||
Future<void> test_ConditionalExpression_partial_thenExpression_empty() async {
|
||||
// SimpleIdentifier ConditionalExpression ReturnStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {int x;}''');
|
||||
|
@ -1981,7 +1981,7 @@ class C {foo(){var f; {var x;} return a ? ^}}''');
|
|||
|
||||
Future<void> test_ConditionalExpression_thenExpression() async {
|
||||
// SimpleIdentifier ConditionalExpression ReturnStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {int x;}''');
|
||||
|
@ -2068,7 +2068,7 @@ class A {
|
|||
Future<void> test_ConstructorName_importedClass() async {
|
||||
// SimpleIdentifier PrefixedIdentifier NamedType ConstructorName
|
||||
// InstanceCreationExpression
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
int T1;
|
||||
F1() { }
|
||||
|
@ -2093,7 +2093,7 @@ void f() {new X.^}''');
|
|||
Future<void> test_ConstructorName_importedFactory() async {
|
||||
// SimpleIdentifier PrefixedIdentifier NamedType ConstructorName
|
||||
// InstanceCreationExpression
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
int T1;
|
||||
F1() { }
|
||||
|
@ -2572,7 +2572,7 @@ class B<U> {}
|
|||
|
||||
Future<void> test_ExpressionStatement_identifier() async {
|
||||
// SimpleIdentifier ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
_B F1() { }
|
||||
class A {int x;}
|
||||
class _B { }''');
|
||||
|
@ -2600,7 +2600,7 @@ class C {foo(){^} void bar() {}}''');
|
|||
|
||||
Future<void> test_ExpressionStatement_name() async {
|
||||
// ExpressionStatement Block BlockFunctionBody MethodDeclaration
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
B T1;
|
||||
class B{}''');
|
||||
addTestSource('''
|
||||
|
@ -2670,7 +2670,7 @@ extension E on A { ^ }
|
|||
|
||||
Future<void> test_extensionDeclaration_notInBody() async {
|
||||
// ExtensionDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -2723,7 +2723,7 @@ extension on String {
|
|||
Future<void> test_FieldDeclaration_name_typed() async {
|
||||
// SimpleIdentifier VariableDeclaration VariableDeclarationList
|
||||
// FieldDeclaration
|
||||
addSource('/home/test/lib/a.dart', 'class A { }');
|
||||
addSource('$testPackageLibPath/a.dart', 'class A { }');
|
||||
addTestSource('''
|
||||
import "a.dart";
|
||||
class C {A ^}''');
|
||||
|
@ -2735,7 +2735,7 @@ extension on String {
|
|||
Future<void> test_FieldDeclaration_name_var() async {
|
||||
// SimpleIdentifier VariableDeclaration VariableDeclarationList
|
||||
// FieldDeclaration
|
||||
addSource('/home/test/lib/a.dart', 'class A { }');
|
||||
addSource('$testPackageLibPath/a.dart', 'class A { }');
|
||||
addTestSource('''
|
||||
import "a.dart";
|
||||
class C {var ^}''');
|
||||
|
@ -3232,7 +3232,7 @@ void f<T>(^) {}
|
|||
|
||||
Future<void> test_FunctionDeclaration_returnType_afterComment() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -3263,7 +3263,7 @@ class C2 { }
|
|||
|
||||
Future<void> test_FunctionDeclaration_returnType_afterComment2() async {
|
||||
// FunctionDeclaration ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -3294,7 +3294,7 @@ class C2 { }
|
|||
|
||||
Future<void> test_FunctionDeclaration_returnType_afterComment3() async {
|
||||
// FunctionDeclaration ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -3560,7 +3560,7 @@ void f(aaa, bbb) {}''');
|
|||
|
||||
Future<void> test_IndexExpression() async {
|
||||
// ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {int x;}''');
|
||||
|
@ -3586,7 +3586,7 @@ class C {foo(){var f; {var x;} f[^]}}''');
|
|||
|
||||
Future<void> test_IndexExpression2() async {
|
||||
// SimpleIdentifier IndexExpression ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {int x;}''');
|
||||
|
@ -3611,7 +3611,7 @@ class C {foo(){var f; {var x;} f[T^]}}''');
|
|||
}
|
||||
|
||||
Future<void> test_inherited() async {
|
||||
resolveSource('/home/test/lib/b.dart', '''
|
||||
resolveSource('$testPackageLibPath/b.dart', '''
|
||||
lib libB;
|
||||
class A2 {
|
||||
int x;
|
||||
|
@ -3763,7 +3763,7 @@ void f() {
|
|||
|
||||
Future<void> test_InstanceCreationExpression_imported() async {
|
||||
// SimpleIdentifier NamedType ConstructorName InstanceCreationExpression
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {A(this.x) { } int x;}''');
|
||||
|
@ -3865,7 +3865,7 @@ void f() {
|
|||
|
||||
Future<void> test_InterpolationExpression_block() async {
|
||||
// SimpleIdentifier InterpolationExpression StringInterpolation
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -3938,7 +3938,7 @@ void f() {String name; print("hello \${^}");}''');
|
|||
|
||||
Future<void> test_IsExpression() async {
|
||||
// SimpleIdentifier NamedType IsExpression IfStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
foo() { }
|
||||
class X {X.c(); X._d(); z() {}}''');
|
||||
|
@ -4061,7 +4061,7 @@ void f(){var a; if (a is Obj^)}''');
|
|||
}
|
||||
|
||||
Future<void> test_keyword() async {
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
int newT1;
|
||||
int T1;
|
||||
|
@ -4214,7 +4214,7 @@ void f() {
|
|||
|
||||
Future<void> test_MapLiteralEntry() async {
|
||||
// MapLiteralEntry MapLiteral VariableDeclaration
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -4244,7 +4244,7 @@ foo = {^''');
|
|||
|
||||
Future<void> test_MapLiteralEntry1() async {
|
||||
// MapLiteralEntry MapLiteral VariableDeclaration
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -4266,7 +4266,7 @@ foo = {T^''');
|
|||
|
||||
Future<void> test_MapLiteralEntry2() async {
|
||||
// SimpleIdentifier MapLiteralEntry MapLiteral VariableDeclaration
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -4322,7 +4322,7 @@ mixin M on C {
|
|||
}
|
||||
|
||||
Future<void> test_method_parameters_mixed_required_and_named() async {
|
||||
resolveSource('/home/test/lib/a.dart', '''
|
||||
resolveSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
void m(x, {int y}) {}
|
||||
}
|
||||
|
@ -4369,7 +4369,7 @@ class B extends A {
|
|||
}
|
||||
|
||||
Future<void> test_method_parameters_mixed_required_and_positional() async {
|
||||
resolveSource('/home/test/lib/a.dart', '''
|
||||
resolveSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
void m(x, [int y]) {}
|
||||
}
|
||||
|
@ -4417,7 +4417,7 @@ class B extends A {
|
|||
}
|
||||
|
||||
Future<void> test_method_parameters_named() async {
|
||||
resolveSource('/home/test/lib/a.dart', '''
|
||||
resolveSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
void m({x, int y}) {}
|
||||
}
|
||||
|
@ -4464,7 +4464,7 @@ class B extends A {
|
|||
}
|
||||
|
||||
Future<void> test_method_parameters_none() async {
|
||||
resolveSource('/home/test/lib/a.dart', '''
|
||||
resolveSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
void m() {}
|
||||
}
|
||||
|
@ -4501,7 +4501,7 @@ class B extends A {
|
|||
}
|
||||
|
||||
Future<void> test_method_parameters_positional() async {
|
||||
resolveSource('/home/test/lib/a.dart', '''
|
||||
resolveSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
void m([x, int y]) {}
|
||||
}
|
||||
|
@ -4548,7 +4548,7 @@ class B extends A {
|
|||
}
|
||||
|
||||
Future<void> test_method_parameters_required() async {
|
||||
resolveSource('/home/test/lib/a.dart', '''
|
||||
resolveSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
void m(x, int y) {}
|
||||
}
|
||||
|
@ -4607,7 +4607,7 @@ class Z {}
|
|||
|
||||
Future<void> test_MethodDeclaration_body_static() async {
|
||||
// Block BlockFunctionBody MethodDeclaration
|
||||
addSource('/home/test/lib/c.dart', '''
|
||||
addSource('$testPackageLibPath/c.dart', '''
|
||||
class C {
|
||||
c1() {}
|
||||
var c2;
|
||||
|
@ -4784,7 +4784,7 @@ class Z {}
|
|||
|
||||
Future<void> test_MethodDeclaration_returnType() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -4814,7 +4814,7 @@ class C2 {^ zoo(z) { } String name; }''');
|
|||
|
||||
Future<void> test_MethodDeclaration_returnType_afterComment() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -4844,7 +4844,7 @@ class C2 {/* */ ^ zoo(z) { } String name; }''');
|
|||
|
||||
Future<void> test_MethodDeclaration_returnType_afterComment2() async {
|
||||
// MethodDeclaration ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -4874,7 +4874,7 @@ class C2 {/** */ ^ zoo(z) { } String name; }''');
|
|||
|
||||
Future<void> test_MethodDeclaration_returnType_afterComment3() async {
|
||||
// MethodDeclaration ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -5008,7 +5008,7 @@ class X{}''');
|
|||
}
|
||||
|
||||
Future<void> test_mixin_ordering() async {
|
||||
resolveSource('/home/test/lib/a.dart', '''
|
||||
resolveSource('$testPackageLibPath/a.dart', '''
|
||||
class B {}
|
||||
class M1 {
|
||||
void m() {}
|
||||
|
@ -5031,7 +5031,7 @@ class C extends B with M1, M2 {
|
|||
|
||||
Future<void> test_MixinDeclaration_body() async {
|
||||
// MixinDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -5115,7 +5115,7 @@ mixin foo on Object {
|
|||
}
|
||||
|
||||
Future<void> test_no_parameters_field() async {
|
||||
resolveSource('/home/test/lib/a.dart', '''
|
||||
resolveSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
int x;
|
||||
}
|
||||
|
@ -5132,7 +5132,7 @@ class B extends A {
|
|||
}
|
||||
|
||||
Future<void> test_no_parameters_getter() async {
|
||||
resolveSource('/home/test/lib/a.dart', '''
|
||||
resolveSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
int get x => null;
|
||||
}
|
||||
|
@ -5149,7 +5149,7 @@ class B extends A {
|
|||
}
|
||||
|
||||
Future<void> test_no_parameters_setter() async {
|
||||
resolveSource('/home/test/lib/a.dart', '''
|
||||
resolveSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
set x(int value) {};
|
||||
}
|
||||
|
@ -5166,7 +5166,7 @@ class B extends A {
|
|||
}
|
||||
|
||||
Future<void> test_outside_class() async {
|
||||
resolveSource('/home/test/lib/b.dart', '''
|
||||
resolveSource('$testPackageLibPath/b.dart', '''
|
||||
lib libB;
|
||||
class A2 {
|
||||
int x;
|
||||
|
@ -5253,7 +5253,7 @@ foo(int bar) {
|
|||
|
||||
Future<void> test_PrefixedIdentifier_class_const() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement Block
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
class I {
|
||||
static const scI = 'boo';
|
||||
|
@ -5300,7 +5300,7 @@ void f() {A.^}''');
|
|||
|
||||
Future<void> test_PrefixedIdentifier_class_imported() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
class I {X get f => new A();get _g => new A();}
|
||||
class A implements I {
|
||||
|
@ -5379,7 +5379,7 @@ class X{}''');
|
|||
|
||||
Future<void> test_PrefixedIdentifier_library() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
var T1;
|
||||
class X { }
|
||||
|
@ -5406,7 +5406,7 @@ void f() {b.^}''');
|
|||
|
||||
Future<void> test_PrefixedIdentifier_library_typesOnly() async {
|
||||
// SimpleIdentifier PrefixedIdentifier NamedType
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
var T1;
|
||||
class X { }
|
||||
|
@ -5433,7 +5433,7 @@ foo(b.^ f) {}''');
|
|||
|
||||
Future<void> test_PrefixedIdentifier_library_typesOnly2() async {
|
||||
// SimpleIdentifier PrefixedIdentifier NamedType
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
var T1;
|
||||
class X { }
|
||||
|
@ -5460,7 +5460,7 @@ foo(b.^) {}''');
|
|||
|
||||
Future<void> test_PrefixedIdentifier_parameter() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
class _W {M y; var _z;}
|
||||
class X extends _W {}
|
||||
|
@ -5479,7 +5479,7 @@ foo(X x) {x.^}''');
|
|||
|
||||
Future<void> test_PrefixedIdentifier_prefix() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {static int bar = 10;}
|
||||
_B() {}''');
|
||||
addTestSource('''
|
||||
|
@ -5643,7 +5643,7 @@ class X {foo(){A^.bar}}''');
|
|||
|
||||
Future<void> test_PropertyAccess_noTarget() async {
|
||||
// SimpleIdentifier PropertyAccess ExpressionStatement
|
||||
addSource('/home/test/lib/ab.dart', 'class Foo { }');
|
||||
addSource('$testPackageLibPath/ab.dart', 'class Foo { }');
|
||||
addTestSource('class C {foo(){.^}}');
|
||||
await computeSuggestions();
|
||||
|
||||
|
@ -5652,7 +5652,7 @@ class X {foo(){A^.bar}}''');
|
|||
|
||||
Future<void> test_PropertyAccess_noTarget2() async {
|
||||
// SimpleIdentifier PropertyAccess ExpressionStatement
|
||||
addSource('/home/test/lib/ab.dart', 'class Foo { }');
|
||||
addSource('$testPackageLibPath/ab.dart', 'class Foo { }');
|
||||
addTestSource('void f() {.^}');
|
||||
await computeSuggestions();
|
||||
|
||||
|
@ -5680,7 +5680,7 @@ class X {foo(){A^.bar}}''');
|
|||
}
|
||||
|
||||
Future<void> test_static_field() async {
|
||||
resolveSource('/home/test/lib/b.dart', '''
|
||||
resolveSource('$testPackageLibPath/b.dart', '''
|
||||
lib libB;
|
||||
class A2 {
|
||||
int x;
|
||||
|
@ -5722,7 +5722,7 @@ class B extends A1 with A2 {
|
|||
}
|
||||
|
||||
Future<void> test_static_method() async {
|
||||
resolveSource('/home/test/lib/b.dart', '''
|
||||
resolveSource('$testPackageLibPath/b.dart', '''
|
||||
lib libB;
|
||||
class A2 {
|
||||
int x;
|
||||
|
@ -6107,7 +6107,7 @@ void f() {
|
|||
|
||||
Future<void> test_TypeArgumentList() async {
|
||||
// SimpleIdentifier BinaryExpression ExpressionStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class C1 {int x;}
|
||||
F1() => 0;
|
||||
typedef String T1(int blat);''');
|
||||
|
@ -6134,7 +6134,7 @@ void f() { C<^> c; }''');
|
|||
|
||||
Future<void> test_TypeArgumentList2() async {
|
||||
// NamedType TypeArgumentList NamedType
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class C1 {int x;}
|
||||
F1() => 0;
|
||||
typedef String T1(int blat);''');
|
||||
|
@ -6198,7 +6198,7 @@ class A<T> {
|
|||
Future<void> test_VariableDeclaration_name() async {
|
||||
// SimpleIdentifier VariableDeclaration VariableDeclarationList
|
||||
// VariableDeclarationStatement Block
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
foo() { }
|
||||
class _B { }
|
||||
|
@ -6225,7 +6225,7 @@ void f() {var ^}''');
|
|||
Future<void> test_VariableDeclarationStatement_RHS() async {
|
||||
// SimpleIdentifier VariableDeclaration VariableDeclarationList
|
||||
// VariableDeclarationStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
foo() { }
|
||||
class _B { }
|
||||
|
@ -6250,7 +6250,7 @@ class C {bar(){var f; {var x;} var e = ^}}''');
|
|||
Future<void> test_VariableDeclarationStatement_RHS_missing_semicolon() async {
|
||||
// VariableDeclaration VariableDeclarationList
|
||||
// VariableDeclarationStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
foo1() { }
|
||||
void bar1() { }
|
||||
|
|
|
@ -292,7 +292,7 @@ void f() {
|
|||
Future<void> test_ConstructorName_importedClass() async {
|
||||
// SimpleIdentifier PrefixedIdentifier NamedType ConstructorName
|
||||
// InstanceCreationExpression
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
int T1;
|
||||
F1() { }
|
||||
|
@ -320,7 +320,7 @@ void f() {
|
|||
Future<void> test_ConstructorName_importedClass_unresolved() async {
|
||||
// SimpleIdentifier PrefixedIdentifier NamedType ConstructorName
|
||||
// InstanceCreationExpression
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
int T1;
|
||||
F1() { }
|
||||
|
@ -349,7 +349,7 @@ void f() {
|
|||
Future<void> test_ConstructorName_importedFactory() async {
|
||||
// SimpleIdentifier PrefixedIdentifier NamedType ConstructorName
|
||||
// InstanceCreationExpression
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
int T1;
|
||||
F1() { }
|
||||
|
@ -450,7 +450,7 @@ void f() {
|
|||
|
||||
Future<void>
|
||||
test_importPrefix_className_typeArguments_period_nothing_functionTypeContext_matchingReturnType() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A<T> {
|
||||
A.named();
|
||||
A.new();
|
||||
|
|
|
@ -153,7 +153,7 @@ class C extends B {
|
|||
}
|
||||
|
||||
Future<void> test_fromPart() async {
|
||||
addSource('/home/test/lib/myLib.dart', '''
|
||||
addSource('$testPackageLibPath/myLib.dart', '''
|
||||
library myLib;
|
||||
part 'test.dart';
|
||||
part 'otherPart.dart';
|
||||
|
@ -162,7 +162,7 @@ class A {
|
|||
B suggested2(String y) => null;
|
||||
}
|
||||
''');
|
||||
addSource('/home/test/lib/otherPart.dart', '''
|
||||
addSource('$testPackageLibPath/otherPart.dart', '''
|
||||
part of myLib;
|
||||
class B extends A {
|
||||
B suggested2(String y) => null;
|
||||
|
|
|
@ -28,7 +28,7 @@ class StaticMemberContributorTest extends DartCompletionContributorTest {
|
|||
}
|
||||
|
||||
Future<void> test_class_static_notPrivate() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
static int _f;
|
||||
static String get _g => '';
|
||||
|
@ -138,7 +138,7 @@ main() {E.^}
|
|||
}
|
||||
|
||||
Future<void> test_extension_static_notPrivate() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
extension E {
|
||||
static int _f;
|
||||
static String get _g => '';
|
||||
|
@ -160,7 +160,7 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_implicitCreation() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
A.foo();
|
||||
A.bar();
|
||||
|
@ -181,7 +181,7 @@ main() {
|
|||
|
||||
Future<void>
|
||||
test_implicitCreation_functionContextType_matchingReturnType() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
A.foo();
|
||||
A.bar();
|
||||
|
@ -202,7 +202,7 @@ main() {
|
|||
|
||||
Future<void>
|
||||
test_implicitCreation_functionContextType_notMatchingReturnType() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
A.foo();
|
||||
A.bar();
|
||||
|
@ -365,7 +365,7 @@ void main() {async.Future.^.w()}''');
|
|||
|
||||
Future<void> test_PrefixedIdentifier_class_const() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement Block
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
class I {
|
||||
static const scI = 'boo';
|
||||
|
@ -409,7 +409,7 @@ void main() {async.Future.^.w()}''');
|
|||
}
|
||||
|
||||
Future<void> test_simpleIdentifier_typeAlias_interfaceType_class() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
static int _privateField = 0;
|
||||
static int get _privateGetter => 0;
|
||||
|
@ -451,7 +451,7 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_simpleIdentifier_typeAlias_interfaceType_enum() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
enum E {
|
||||
aaa,
|
||||
_bbb,
|
||||
|
|
|
@ -114,7 +114,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ArgumentList() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }
|
||||
void baz() { }''');
|
||||
|
@ -138,7 +138,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ArgumentList_imported_function() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }
|
||||
expect(arg) { }
|
||||
|
@ -164,7 +164,7 @@ void f() {new A().f^}''');
|
|||
Future<void>
|
||||
test_ArgumentList_InstanceCreationExpression_functionalArg() async {
|
||||
// ArgumentList InstanceCreationExpression ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
class A { A(f()) { } }
|
||||
bool hasLength(int expected) { }
|
||||
|
@ -191,7 +191,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ArgumentList_InstanceCreationExpression_typedefArg() async {
|
||||
// ArgumentList InstanceCreationExpression ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
typedef Funct();
|
||||
class A { A(Funct f) { } }
|
||||
|
@ -219,7 +219,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ArgumentList_local_function() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }
|
||||
void baz() { }''');
|
||||
|
@ -244,7 +244,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ArgumentList_local_method() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }
|
||||
void baz() { }''');
|
||||
|
@ -269,7 +269,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ArgumentList_MethodInvocation_functionalArg() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
class A { A(f()) { } }
|
||||
bool hasLength(int expected) { }
|
||||
|
@ -296,7 +296,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ArgumentList_MethodInvocation_methodArg() async {
|
||||
// ArgumentList MethodInvocation ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
class A { A(f()) { } }
|
||||
bool hasLength(int expected) { }
|
||||
|
@ -322,7 +322,7 @@ void f() {new A().f^}''');
|
|||
Future<void> test_ArgumentList_namedParam() async {
|
||||
// SimpleIdentifier NamedExpression ArgumentList MethodInvocation
|
||||
// ExpressionStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library A;
|
||||
bool hasLength(int expected) { }''');
|
||||
addTestSource('''
|
||||
|
@ -977,7 +977,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_Block_inherited_imported() async {
|
||||
// Block BlockFunctionBody MethodDeclaration ClassDeclaration
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
class F { var f1; f2() { } get f3 => 0; set f4(fx) { } var _pf; }
|
||||
class E extends F { var e1; e2() { } }
|
||||
|
@ -1093,7 +1093,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_CascadeExpression_method1() async {
|
||||
// PropertyAccess CascadeExpression ExpressionStatement Block
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart";
|
||||
|
@ -1117,7 +1117,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_CascadeExpression_selector1() async {
|
||||
// PropertyAccess CascadeExpression ExpressionStatement Block
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart";
|
||||
|
@ -1141,7 +1141,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_CascadeExpression_selector2() async {
|
||||
// SimpleIdentifier PropertyAccess CascadeExpression ExpressionStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart";
|
||||
|
@ -1163,7 +1163,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_CascadeExpression_selector2_withTrailingReturn() async {
|
||||
// PropertyAccess CascadeExpression ExpressionStatement Block
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart";
|
||||
|
@ -1252,7 +1252,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -1271,7 +1271,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body_final() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -1290,7 +1290,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body_final_field() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -1309,7 +1309,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body_final_field2() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as Soo;
|
||||
|
@ -1328,7 +1328,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body_final_final() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -1347,7 +1347,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ClassDeclaration_body_final_var() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
import "b.dart" as x;
|
||||
|
@ -1414,7 +1414,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ConditionalExpression_elseExpression() async {
|
||||
// SimpleIdentifier ConditionalExpression ReturnStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {int x;}''');
|
||||
|
@ -1433,7 +1433,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ConditionalExpression_elseExpression_empty() async {
|
||||
// SimpleIdentifier ConditionalExpression ReturnStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {int x;}''');
|
||||
|
@ -1458,7 +1458,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ConditionalExpression_partial_thenExpression() async {
|
||||
// SimpleIdentifier ConditionalExpression ReturnStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {int x;}''');
|
||||
|
@ -1477,7 +1477,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ConditionalExpression_partial_thenExpression_empty() async {
|
||||
// SimpleIdentifier ConditionalExpression ReturnStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {int x;}''');
|
||||
|
@ -1502,7 +1502,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ConditionalExpression_thenExpression() async {
|
||||
// SimpleIdentifier ConditionalExpression ReturnStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {int x;}''');
|
||||
|
@ -1522,7 +1522,7 @@ void f() {new A().f^}''');
|
|||
Future<void> test_ConstructorName_importedClass() async {
|
||||
// SimpleIdentifier PrefixedIdentifier NamedType ConstructorName
|
||||
// InstanceCreationExpression
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
int T1;
|
||||
F1() { }
|
||||
|
@ -1546,7 +1546,7 @@ void f() {new A().f^}''');
|
|||
Future<void> test_ConstructorName_importedFactory() async {
|
||||
// SimpleIdentifier PrefixedIdentifier NamedType ConstructorName
|
||||
// InstanceCreationExpression
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
int T1;
|
||||
F1() { }
|
||||
|
@ -1706,7 +1706,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ExpressionStatement_identifier() async {
|
||||
// SimpleIdentifier ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
_B F1() { }
|
||||
class A {int x;}
|
||||
class _B { }''');
|
||||
|
@ -1732,7 +1732,7 @@ void f() {new A().f^}''');
|
|||
|
||||
Future<void> test_ExpressionStatement_name() async {
|
||||
// ExpressionStatement Block BlockFunctionBody MethodDeclaration
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
B T1;
|
||||
class B{}''');
|
||||
addTestSource('''
|
||||
|
@ -1759,7 +1759,7 @@ void f() {
|
|||
Future<void> test_FieldDeclaration_name_typed() async {
|
||||
// SimpleIdentifier VariableDeclaration VariableDeclarationList
|
||||
// FieldDeclaration
|
||||
addSource('/home/test/lib/a.dart', 'class A { }');
|
||||
addSource('$testPackageLibPath/a.dart', 'class A { }');
|
||||
addTestSource('''
|
||||
import "a.dart";
|
||||
class C {A ^}''');
|
||||
|
@ -1770,7 +1770,7 @@ void f() {
|
|||
Future<void> test_FieldDeclaration_name_var() async {
|
||||
// SimpleIdentifier VariableDeclaration VariableDeclarationList
|
||||
// FieldDeclaration
|
||||
addSource('/home/test/lib/a.dart', 'class A { }');
|
||||
addSource('$testPackageLibPath/a.dart', 'class A { }');
|
||||
addTestSource('''
|
||||
import "a.dart";
|
||||
class C {var ^}''');
|
||||
|
@ -1922,7 +1922,7 @@ void f() {
|
|||
|
||||
Future<void> test_FunctionDeclaration_returnType_afterComment() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -1951,7 +1951,7 @@ void f() {
|
|||
|
||||
Future<void> test_FunctionDeclaration_returnType_afterComment2() async {
|
||||
// FunctionDeclaration ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -1980,7 +1980,7 @@ void f() {
|
|||
|
||||
Future<void> test_FunctionDeclaration_returnType_afterComment3() async {
|
||||
// FunctionDeclaration ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -2174,7 +2174,7 @@ g(F.^
|
|||
|
||||
Future<void> test_IndexExpression() async {
|
||||
// ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {int x;}''');
|
||||
|
@ -2199,7 +2199,7 @@ g(F.^
|
|||
|
||||
Future<void> test_IndexExpression2() async {
|
||||
// SimpleIdentifier IndexExpression ExpressionStatement Block
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {int x;}''');
|
||||
|
@ -2218,7 +2218,7 @@ g(F.^
|
|||
|
||||
Future<void> test_InstanceCreationExpression_imported() async {
|
||||
// SimpleIdentifier NamedType ConstructorName InstanceCreationExpression
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
class A {A(this.x) { } int x;}''');
|
||||
|
@ -2304,7 +2304,7 @@ void f() {
|
|||
|
||||
Future<void> test_InterpolationExpression() async {
|
||||
// SimpleIdentifier InterpolationExpression StringInterpolation
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -2333,7 +2333,7 @@ void f() {
|
|||
|
||||
Future<void> test_InterpolationExpression_block() async {
|
||||
// SimpleIdentifier InterpolationExpression StringInterpolation
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -2399,7 +2399,7 @@ void f() {
|
|||
|
||||
Future<void> test_IsExpression() async {
|
||||
// SimpleIdentifier NamedType IsExpression IfStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
foo() { }
|
||||
class X {X.c(); X._d(); z() {}}''');
|
||||
|
@ -2472,7 +2472,7 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_keyword2() async {
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
int newT1;
|
||||
int T1;
|
||||
|
@ -2532,8 +2532,8 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_libraryPrefix_with_exports() async {
|
||||
addSource('/home/test/lib/a.dart', 'class A { }');
|
||||
addSource('/home/test/lib/b.dart', 'export "a.dart"; class B { }');
|
||||
addSource('$testPackageLibPath/a.dart', 'class A { }');
|
||||
addSource('$testPackageLibPath/b.dart', 'export "a.dart"; class B { }');
|
||||
addTestSource('import "b.dart" as foo; void f() {foo.^} class C { }');
|
||||
await computeSuggestions();
|
||||
// Suggested by LibraryMemberContributor
|
||||
|
@ -2591,7 +2591,7 @@ void f() {
|
|||
|
||||
Future<void> test_MapLiteralEntry() async {
|
||||
// MapLiteralEntry MapLiteral VariableDeclaration
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -2618,7 +2618,7 @@ void f() {
|
|||
|
||||
Future<void> test_MapLiteralEntry1() async {
|
||||
// MapLiteralEntry MapLiteral VariableDeclaration
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -2638,7 +2638,7 @@ void f() {
|
|||
|
||||
Future<void> test_MapLiteralEntry2() async {
|
||||
// SimpleIdentifier MapLiteralEntry MapLiteral VariableDeclaration
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -2937,7 +2937,7 @@ void f() {new C().^}''');
|
|||
|
||||
Future<void> test_MethodDeclaration_returnType() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -2965,7 +2965,7 @@ void f() {new C().^}''');
|
|||
|
||||
Future<void> test_MethodDeclaration_returnType_afterComment() async {
|
||||
// ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -2993,7 +2993,7 @@ void f() {new C().^}''');
|
|||
|
||||
Future<void> test_MethodDeclaration_returnType_afterComment2() async {
|
||||
// MethodDeclaration ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -3021,7 +3021,7 @@ void f() {new C().^}''');
|
|||
|
||||
Future<void> test_MethodDeclaration_returnType_afterComment3() async {
|
||||
// MethodDeclaration ClassDeclaration CompilationUnit
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
int T1;
|
||||
F1() { }
|
||||
typedef D1();
|
||||
|
@ -3268,12 +3268,12 @@ void f() {C.^ print("something");}''');
|
|||
|
||||
Future<void> test_partFile_TypeName() async {
|
||||
// SimpleIdentifier NamedType ConstructorName
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
int T1;
|
||||
F1() { }
|
||||
class X {X.c(); X._d(); z() {}}''');
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library libA;
|
||||
import "b.dart";
|
||||
part "${resourceProvider.pathContext.basename(testFile)}";
|
||||
|
@ -3300,12 +3300,12 @@ void f() {C.^ print("something");}''');
|
|||
|
||||
Future<void> test_partFile_TypeName2() async {
|
||||
// SimpleIdentifier NamedType ConstructorName
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
int T1;
|
||||
F1() { }
|
||||
class X {X.c(); X._d(); z() {}}''');
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
part of libA;
|
||||
class B { }''');
|
||||
addTestSource('''
|
||||
|
@ -3332,7 +3332,7 @@ void f() {C.^ print("something");}''');
|
|||
|
||||
Future<void> test_PrefixedIdentifier_class_const() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement Block
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
class I {
|
||||
static const scI = 'boo';
|
||||
|
@ -3378,7 +3378,7 @@ void f() {C.^ print("something");}''');
|
|||
|
||||
Future<void> test_PrefixedIdentifier_class_imported() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
class I {X get f => new A();get _g => new A();}
|
||||
class A implements I {
|
||||
|
@ -3454,7 +3454,7 @@ void f() {C.^ print("something");}''');
|
|||
|
||||
Future<void> test_PrefixedIdentifier_library() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
var T1;
|
||||
class X { }
|
||||
|
@ -3480,7 +3480,7 @@ void f() {C.^ print("something");}''');
|
|||
|
||||
Future<void> test_PrefixedIdentifier_library_typesOnly() async {
|
||||
// SimpleIdentifier PrefixedIdentifier NamedType
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
var T1;
|
||||
class X { }
|
||||
|
@ -3506,7 +3506,7 @@ void f() {C.^ print("something");}''');
|
|||
|
||||
Future<void> test_PrefixedIdentifier_library_typesOnly2() async {
|
||||
// SimpleIdentifier PrefixedIdentifier NamedType
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
var T1;
|
||||
class X { }
|
||||
|
@ -3532,7 +3532,7 @@ void f() {C.^ print("something");}''');
|
|||
|
||||
Future<void> test_PrefixedIdentifier_parameter() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
class _W {M y; var _z;}
|
||||
class X extends _W {}
|
||||
|
@ -3550,7 +3550,7 @@ void f() {C.^ print("something");}''');
|
|||
|
||||
Future<void> test_PrefixedIdentifier_prefix() async {
|
||||
// SimpleIdentifier PrefixedIdentifier ExpressionStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {static int bar = 10;}
|
||||
_B() {}''');
|
||||
addTestSource('''
|
||||
|
@ -4149,7 +4149,7 @@ class C with M {
|
|||
|
||||
Future<void> test_TypeArgumentList() async {
|
||||
// SimpleIdentifier BinaryExpression ExpressionStatement
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class C1 {int x;}
|
||||
F1() => 0;
|
||||
typedef String T1(int blat);''');
|
||||
|
@ -4174,7 +4174,7 @@ class C with M {
|
|||
|
||||
Future<void> test_TypeArgumentList2() async {
|
||||
// NamedType TypeArgumentList NamedType
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class C1 {int x;}
|
||||
F1() => 0;
|
||||
typedef String T1(int blat);''');
|
||||
|
@ -4218,7 +4218,7 @@ class C with M {
|
|||
Future<void> test_VariableDeclaration_name() async {
|
||||
// SimpleIdentifier VariableDeclaration VariableDeclarationList
|
||||
// VariableDeclarationStatement Block
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
foo() { }
|
||||
class _B { }
|
||||
|
@ -4243,7 +4243,7 @@ class C with M {
|
|||
Future<void> test_VariableDeclarationStatement_RHS() async {
|
||||
// SimpleIdentifier VariableDeclaration VariableDeclarationList
|
||||
// VariableDeclarationStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
foo() { }
|
||||
class _B { }
|
||||
|
@ -4267,7 +4267,7 @@ class C with M {
|
|||
Future<void> test_VariableDeclarationStatement_RHS_missing_semicolon() async {
|
||||
// VariableDeclaration VariableDeclarationList
|
||||
// VariableDeclarationStatement
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
lib B;
|
||||
foo1() { }
|
||||
void bar1() { }
|
||||
|
|
|
@ -738,7 +738,7 @@ f() {
|
|||
}
|
||||
|
||||
Future<void> test_tryonThrowStatement_nnbd_into_legacy() async {
|
||||
newFile('/home/test/lib/a.dart', content: r'''
|
||||
newFile('$testPackageLibPath/a.dart', content: r'''
|
||||
String? x;
|
||||
''');
|
||||
await _prepareCompletion('.tryon', '''
|
||||
|
@ -762,7 +762,7 @@ f() {
|
|||
}
|
||||
|
||||
Future<void> test_tryonThrowStatement_nnbd_into_legacy_nested() async {
|
||||
newFile('/home/test/lib/a.dart', content: r'''
|
||||
newFile('$testPackageLibPath/a.dart', content: r'''
|
||||
List<String?> x;
|
||||
''');
|
||||
await _prepareCompletion('.tryon', '''
|
||||
|
@ -786,7 +786,7 @@ f() {
|
|||
}
|
||||
|
||||
Future<void> test_tryonThrowStatement_nnbd_legacy() async {
|
||||
newFile('/home/test/lib/a.dart', content: r'''
|
||||
newFile('$testPackageLibPath/a.dart', content: r'''
|
||||
// @dart = 2.8
|
||||
String x;
|
||||
''');
|
||||
|
@ -809,7 +809,7 @@ f() {
|
|||
}
|
||||
|
||||
Future<void> test_tryonThrowStatement_nnbd_legacy_nested() async {
|
||||
newFile('/home/test/lib/a.dart', content: r'''
|
||||
newFile('$testPackageLibPath/a.dart', content: r'''
|
||||
// @dart = 2.8
|
||||
List<String> x;
|
||||
''');
|
||||
|
|
|
@ -881,7 +881,7 @@ import 'annotations.dart'; // used
|
|||
}
|
||||
|
||||
Future<void> _addAnnotationsFile() async {
|
||||
final annotationsFile = convertPath('/home/test/lib/annotations.dart');
|
||||
final annotationsFile = convertPath('$testPackageLibPath/annotations.dart');
|
||||
const annotationsContent = '''
|
||||
import 'package:meta/meta_meta.dart';
|
||||
|
||||
|
|
|
@ -89,7 +89,7 @@ void f(A a, B b, C c, D d) {
|
|||
}
|
||||
|
||||
Future<void> test_change_multipleFiles() async {
|
||||
await indexUnit('/home/test/lib/other.dart', r'''
|
||||
await indexUnit('$testPackageLibPath/other.dart', r'''
|
||||
class A {
|
||||
int get test => 1;
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ void f(A a, B b, C c, D d) {
|
|||
}
|
||||
|
||||
Future<void> test_change_multipleFiles() async {
|
||||
await indexUnit('/home/test/lib/other.dart', r'''
|
||||
await indexUnit('$testPackageLibPath/other.dart', r'''
|
||||
class A {
|
||||
int test() => 1;
|
||||
}
|
||||
|
|
|
@ -2871,7 +2871,7 @@ void res() {
|
|||
}
|
||||
|
||||
void _addLibraryReturningAsync() {
|
||||
addSource('/home/test/lib/asyncLib.dart', r'''
|
||||
addSource('$testPackageLibPath/asyncLib.dart', r'''
|
||||
import 'dart:async';
|
||||
|
||||
Completer<int> newCompleter() => null;
|
||||
|
|
|
@ -57,7 +57,7 @@ part '${toUriStr('/absolute/uri.dart')}';
|
|||
}
|
||||
|
||||
Future<void> test_file_imported_with_package_uri_down() async {
|
||||
var file = newFile('/home/test/lib/old_name.dart', content: '');
|
||||
var file = newFile('$testPackageLibPath/old_name.dart', content: '');
|
||||
addTestSource(r'''
|
||||
import 'package:test/old_name.dart';
|
||||
''');
|
||||
|
@ -69,7 +69,8 @@ import 'package:test/old_name.dart';
|
|||
testAnalysisResult =
|
||||
await session.getResolvedUnit(file.path) as ResolvedUnitResult;
|
||||
|
||||
_createRefactoring('/home/test/lib/222/new_name.dart', oldFile: file.path);
|
||||
_createRefactoring('$testPackageLibPath/222/new_name.dart',
|
||||
oldFile: file.path);
|
||||
await _assertSuccessfulRefactoring();
|
||||
|
||||
assertFileChangeResult(testFile, '''
|
||||
|
@ -150,7 +151,7 @@ import 'package:test0.test1/111/name.dart';
|
|||
}
|
||||
|
||||
Future<void> test_file_imported_with_package_uri_sideways() async {
|
||||
var file = newFile('/home/test/lib/111/old_name.dart', content: '');
|
||||
var file = newFile('$testPackageLibPath/111/old_name.dart', content: '');
|
||||
addTestSource(r'''
|
||||
import 'package:test/111/old_name.dart';
|
||||
''');
|
||||
|
@ -162,7 +163,8 @@ import 'package:test/111/old_name.dart';
|
|||
testAnalysisResult =
|
||||
await session.getResolvedUnit(file.path) as ResolvedUnitResult;
|
||||
|
||||
_createRefactoring('/home/test/lib/222/new_name.dart', oldFile: file.path);
|
||||
_createRefactoring('$testPackageLibPath/222/new_name.dart',
|
||||
oldFile: file.path);
|
||||
await _assertSuccessfulRefactoring();
|
||||
|
||||
assertFileChangeResult(testFile, '''
|
||||
|
@ -171,7 +173,7 @@ import 'package:test/222/new_name.dart';
|
|||
}
|
||||
|
||||
Future<void> test_file_imported_with_package_uri_up() async {
|
||||
var file = newFile('/home/test/lib/222/old_name.dart', content: '');
|
||||
var file = newFile('$testPackageLibPath/222/old_name.dart', content: '');
|
||||
addTestSource(r'''
|
||||
import 'package:test/222/old_name.dart';
|
||||
''');
|
||||
|
@ -183,7 +185,7 @@ import 'package:test/222/old_name.dart';
|
|||
testAnalysisResult =
|
||||
await session.getResolvedUnit(file.path) as ResolvedUnitResult;
|
||||
|
||||
_createRefactoring('/home/test/lib/new_name.dart', oldFile: file.path);
|
||||
_createRefactoring('$testPackageLibPath/new_name.dart', oldFile: file.path);
|
||||
await _assertSuccessfulRefactoring();
|
||||
|
||||
assertFileChangeResult(testFile, '''
|
||||
|
|
|
@ -157,7 +157,7 @@ class A {
|
|||
test() {}
|
||||
}
|
||||
''');
|
||||
await indexUnit('/home/test/lib/lib.dart', '''
|
||||
await indexUnit('$testPackageLibPath/lib.dart', '''
|
||||
library my.lib;
|
||||
import 'test.dart';
|
||||
|
||||
|
@ -181,7 +181,7 @@ class A {
|
|||
var foo = 1;
|
||||
}
|
||||
''');
|
||||
await indexUnit('/home/test/lib/lib.dart', '''
|
||||
await indexUnit('$testPackageLibPath/lib.dart', '''
|
||||
import 'test.dart';
|
||||
|
||||
void f(A a) {
|
||||
|
@ -387,7 +387,7 @@ class A {
|
|||
newName() {} // marker
|
||||
}
|
||||
''';
|
||||
await indexUnit('/home/test/lib/lib.dart', libCode);
|
||||
await indexUnit('$testPackageLibPath/lib.dart', libCode);
|
||||
await indexTestUnit('''
|
||||
import 'lib.dart';
|
||||
class B extends A {
|
||||
|
|
|
@ -35,7 +35,7 @@ library my.app;
|
|||
}
|
||||
|
||||
Future<void> test_createChange() async {
|
||||
addSource('/home/test/lib/part.dart', '''
|
||||
addSource('$testPackageLibPath/part.dart', '''
|
||||
part of my.app;
|
||||
''');
|
||||
await indexTestUnit('''
|
||||
|
@ -52,13 +52,13 @@ part 'part.dart';
|
|||
library the.new.name;
|
||||
part 'part.dart';
|
||||
''');
|
||||
assertFileChangeResult('/home/test/lib/part.dart', '''
|
||||
assertFileChangeResult('$testPackageLibPath/part.dart', '''
|
||||
part of the.new.name;
|
||||
''');
|
||||
}
|
||||
|
||||
Future<void> test_createChange_hasWhitespaces() async {
|
||||
addSource('/home/test/lib/part.dart', '''
|
||||
addSource('$testPackageLibPath/part.dart', '''
|
||||
part of my . app;
|
||||
''');
|
||||
await indexTestUnit('''
|
||||
|
@ -75,7 +75,7 @@ part 'part.dart';
|
|||
library the.new.name;
|
||||
part 'part.dart';
|
||||
''');
|
||||
assertFileChangeResult('/home/test/lib/part.dart', '''
|
||||
assertFileChangeResult('$testPackageLibPath/part.dart', '''
|
||||
part of the.new.name;
|
||||
''');
|
||||
}
|
||||
|
|
|
@ -472,8 +472,8 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_createChange_parameter_named_inOtherFile() async {
|
||||
var a = convertPath('/home/test/lib/a.dart');
|
||||
var b = convertPath('/home/test/lib/b.dart');
|
||||
var a = convertPath('$testPackageLibPath/a.dart');
|
||||
var b = convertPath('$testPackageLibPath/b.dart');
|
||||
|
||||
newFile(a, content: r'''
|
||||
class A {
|
||||
|
@ -566,7 +566,7 @@ void f(A<int> a) {
|
|||
}
|
||||
|
||||
Future<void> test_createChange_parameter_named_updateHierarchy() async {
|
||||
await indexUnit('/home/test/lib/test2.dart', '''
|
||||
await indexUnit('$testPackageLibPath/test2.dart', '''
|
||||
library test2;
|
||||
class A {
|
||||
void foo({int? test}) {
|
||||
|
@ -610,7 +610,7 @@ class C extends A {
|
|||
}
|
||||
}
|
||||
''');
|
||||
assertFileChangeResult('/home/test/lib/test2.dart', '''
|
||||
assertFileChangeResult('$testPackageLibPath/test2.dart', '''
|
||||
library test2;
|
||||
class A {
|
||||
void foo({int? newName}) {
|
||||
|
|
|
@ -71,7 +71,7 @@ class B extends A {
|
|||
await indexTestUnit('''
|
||||
class Test {}
|
||||
''');
|
||||
await indexUnit('/home/test/lib/lib.dart', '''
|
||||
await indexUnit('$testPackageLibPath/lib.dart', '''
|
||||
library my.lib;
|
||||
import 'test.dart';
|
||||
|
||||
|
@ -112,7 +112,7 @@ class A {
|
|||
await indexTestUnit('''
|
||||
class Test {}
|
||||
''');
|
||||
await indexUnit('/home/test/lib/lib.dart', '''
|
||||
await indexUnit('$testPackageLibPath/lib.dart', '''
|
||||
library my.lib;
|
||||
import 'test.dart';
|
||||
class A {
|
||||
|
@ -610,7 +610,7 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_createChange_FunctionElement_imported() async {
|
||||
await indexUnit('/home/test/lib/foo.dart', r'''
|
||||
await indexUnit('$testPackageLibPath/foo.dart', r'''
|
||||
test() {}
|
||||
foo() {}
|
||||
''');
|
||||
|
@ -637,7 +637,7 @@ void f() {
|
|||
foo();
|
||||
}
|
||||
''');
|
||||
assertFileChangeResult('/home/test/lib/foo.dart', '''
|
||||
assertFileChangeResult('$testPackageLibPath/foo.dart', '''
|
||||
newName() {}
|
||||
foo() {}
|
||||
''');
|
||||
|
|
|
@ -23,7 +23,7 @@ class ClosingLabelsComputerTest extends AbstractContextTest {
|
|||
@override
|
||||
void setUp() {
|
||||
super.setUp();
|
||||
sourcePath = convertPath('/home/test/lib/test.dart');
|
||||
sourcePath = convertPath('$testPackageLibPath/test.dart');
|
||||
}
|
||||
|
||||
Future<void> test_adjacentLinesExcluded() async {
|
||||
|
|
|
@ -192,8 +192,8 @@ class ColorComputerTest extends AbstractContextTest {
|
|||
void setUp() {
|
||||
super.setUp();
|
||||
writeTestPackageConfig(flutter: true);
|
||||
testPath = convertPath('/home/test/lib/test.dart');
|
||||
otherPath = convertPath('/home/test/lib/other_file.dart');
|
||||
testPath = convertPath('$testPackageLibPath/test.dart');
|
||||
otherPath = convertPath('$testPackageLibPath/other_file.dart');
|
||||
}
|
||||
|
||||
Future<void> test_collectionLiteral_const() async {
|
||||
|
|
|
@ -29,7 +29,7 @@ class FoldingComputerTest extends AbstractContextTest {
|
|||
@override
|
||||
void setUp() {
|
||||
super.setUp();
|
||||
sourcePath = convertPath('/home/test/lib/test.dart');
|
||||
sourcePath = convertPath('$testPackageLibPath/test.dart');
|
||||
}
|
||||
|
||||
Future<void> test_annotations() async {
|
||||
|
|
|
@ -25,7 +25,7 @@ class Highlights2ComputerTest extends AbstractContextTest {
|
|||
@override
|
||||
void setUp() {
|
||||
super.setUp();
|
||||
sourcePath = convertPath('/home/test/lib/test.dart');
|
||||
sourcePath = convertPath('$testPackageLibPath/test.dart');
|
||||
}
|
||||
|
||||
Future<void> test_comment() async {
|
||||
|
|
|
@ -57,7 +57,7 @@ class ImportElementsComputerTest extends AbstractContextTest {
|
|||
@override
|
||||
void setUp() {
|
||||
super.setUp();
|
||||
path = convertPath('/home/test/lib/test.dart');
|
||||
path = convertPath('$testPackageLibPath/test.dart');
|
||||
}
|
||||
|
||||
Future<void> test_createEdits_addImport_noDirectives() async {
|
||||
|
|
|
@ -46,7 +46,7 @@ class ImportedElementsComputerTest extends AbstractContextTest {
|
|||
@override
|
||||
void setUp() {
|
||||
super.setUp();
|
||||
sourcePath = convertPath('/home/test/lib/test.dart');
|
||||
sourcePath = convertPath('$testPackageLibPath/test.dart');
|
||||
}
|
||||
|
||||
Future<void> test_dartAsync_noPrefix() async {
|
||||
|
|
|
@ -24,7 +24,7 @@ class AbstractOutlineComputerTest extends AbstractContextTest {
|
|||
@override
|
||||
void setUp() {
|
||||
super.setUp();
|
||||
testPath = convertPath('/home/test/lib/test.dart');
|
||||
testPath = convertPath('$testPackageLibPath/test.dart');
|
||||
}
|
||||
|
||||
Future<Outline> _computeOutline(String code) async {
|
||||
|
|
|
@ -22,7 +22,7 @@ class SelectionRangeComputerTest extends AbstractContextTest {
|
|||
@override
|
||||
void setUp() {
|
||||
super.setUp();
|
||||
sourcePath = convertPath('/home/test/lib/test.dart');
|
||||
sourcePath = convertPath('$testPackageLibPath/test.dart');
|
||||
}
|
||||
|
||||
Future<void> test_arguments() async {
|
||||
|
|
|
@ -25,7 +25,7 @@ class RuntimeCompletionComputerTest extends AbstractContextTest {
|
|||
late RuntimeCompletionResult result;
|
||||
|
||||
void addContextFile(String content) {
|
||||
contextFile = convertPath('/home/test/lib/context.dart');
|
||||
contextFile = convertPath('$testPackageLibPath/context.dart');
|
||||
addSource(contextFile, content);
|
||||
|
||||
contextOffset = content.indexOf('// context line');
|
||||
|
@ -120,13 +120,13 @@ class B extends A {
|
|||
|
||||
@FailingTest(reason: 'No support for OverlayResourceProvider')
|
||||
Future<void> test_inPart() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
part 'b.dart';
|
||||
part 'context.dart';
|
||||
|
||||
int a;
|
||||
''');
|
||||
addSource('/home/test/lib/b.dart', r'''
|
||||
addSource('$testPackageLibPath/b.dart', r'''
|
||||
part of 'a.dart';
|
||||
|
||||
double b;
|
||||
|
|
|
@ -27,7 +27,7 @@ class FlutterOutlineComputerTest extends AbstractContextTest {
|
|||
void setUp() {
|
||||
super.setUp();
|
||||
writeTestPackageConfig(flutter: true);
|
||||
testPath = convertPath('/home/test/lib/test.dart');
|
||||
testPath = convertPath('$testPackageLibPath/test.dart');
|
||||
}
|
||||
|
||||
Future<void> test_attribute_namedExpression() async {
|
||||
|
@ -234,7 +234,7 @@ class MyWidget extends StatelessWidget {
|
|||
}
|
||||
|
||||
Future<void> test_children_closure_blockBody() async {
|
||||
newFile('/home/test/lib/a.dart', content: r'''
|
||||
newFile('$testPackageLibPath/a.dart', content: r'''
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class WidgetA extends StatelessWidget {
|
||||
|
@ -270,7 +270,7 @@ class MyWidget extends StatelessWidget {
|
|||
}
|
||||
|
||||
Future<void> test_children_closure_expressionBody() async {
|
||||
newFile('/home/test/lib/a.dart', content: r'''
|
||||
newFile('$testPackageLibPath/a.dart', content: r'''
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class WidgetA extends StatelessWidget {
|
||||
|
@ -443,7 +443,7 @@ class WidgetFactory {
|
|||
}
|
||||
|
||||
Future<void> test_parentAssociationLabel() async {
|
||||
newFile('/home/test/lib/a.dart', content: r'''
|
||||
newFile('$testPackageLibPath/a.dart', content: r'''
|
||||
import 'package:flutter/widgets.dart';
|
||||
|
||||
class WidgetA extends StatelessWidget {
|
||||
|
|
|
@ -84,7 +84,7 @@ void f(List<String> items) {
|
|||
}
|
||||
|
||||
Future<void> test_declaredIdentifier_addImport_dartUri() async {
|
||||
addSource('/home/test/lib/my_lib.dart', r'''
|
||||
addSource('$testPackageLibPath/my_lib.dart', r'''
|
||||
import 'dart:collection';
|
||||
List<HashMap<String, int>> getMap() => null;
|
||||
''');
|
||||
|
@ -173,7 +173,7 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_local_addImport_dartUri() async {
|
||||
addSource('/home/test/lib/my_lib.dart', r'''
|
||||
addSource('$testPackageLibPath/my_lib.dart', r'''
|
||||
import 'dart:collection';
|
||||
HashMap<String, int> getMap() => null;
|
||||
''');
|
||||
|
@ -194,7 +194,7 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_local_addImport_notLibraryUnit() async {
|
||||
addSource('/home/test/lib/my_lib.dart', r'''
|
||||
addSource('$testPackageLibPath/my_lib.dart', r'''
|
||||
import 'dart:collection';
|
||||
HashMap<String, int> getMap() => null;
|
||||
''');
|
||||
|
@ -211,7 +211,7 @@ void f() {
|
|||
}
|
||||
''');
|
||||
|
||||
var appPath = convertPath('/home/test/lib/app.dart');
|
||||
var appPath = convertPath('$testPackageLibPath/app.dart');
|
||||
addSource(appPath, appCode);
|
||||
await analyzeTestPackageFiles();
|
||||
await resolveTestFile();
|
||||
|
@ -646,7 +646,7 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_privateType_closureParameter() async {
|
||||
addSource('/home/test/lib/my_lib.dart', '''
|
||||
addSource('$testPackageLibPath/my_lib.dart', '''
|
||||
library my_lib;
|
||||
class A {}
|
||||
class _B extends A {}
|
||||
|
@ -662,7 +662,7 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_privateType_declaredIdentifier() async {
|
||||
addSource('/home/test/lib/my_lib.dart', '''
|
||||
addSource('$testPackageLibPath/my_lib.dart', '''
|
||||
library my_lib;
|
||||
class A {}
|
||||
class _B extends A {}
|
||||
|
@ -683,7 +683,7 @@ class A<T> {
|
|||
Future<void> test_privateType_list() async {
|
||||
// This is now failing because we're suggesting "List" rather than nothing.
|
||||
// Is it really better to produce nothing?
|
||||
addSource('/home/test/lib/my_lib.dart', '''
|
||||
addSource('$testPackageLibPath/my_lib.dart', '''
|
||||
library my_lib;
|
||||
class A {}
|
||||
class _B extends A {}
|
||||
|
@ -721,7 +721,7 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_privateType_variable() async {
|
||||
addSource('/home/test/lib/my_lib.dart', '''
|
||||
addSource('$testPackageLibPath/my_lib.dart', '''
|
||||
library my_lib;
|
||||
class A {}
|
||||
class _B extends A {}
|
||||
|
|
|
@ -20,12 +20,12 @@ class ConvertPartOfToUriTest extends AssistProcessorTest {
|
|||
AssistKind get kind => DartAssistKind.CONVERT_PART_OF_TO_URI;
|
||||
|
||||
Future<void> test_nonSibling() async {
|
||||
addSource('/home/test/lib/foo.dart', '''
|
||||
addSource('$testPackageLibPath/foo.dart', '''
|
||||
library foo;
|
||||
part 'src/bar.dart';
|
||||
''');
|
||||
|
||||
testFile = convertPath('/home/test/lib/src/bar.dart');
|
||||
testFile = convertPath('$testPackageLibPath/src/bar.dart');
|
||||
addTestSource('''
|
||||
part of foo;
|
||||
''');
|
||||
|
@ -38,12 +38,12 @@ part of '../foo.dart';
|
|||
}
|
||||
|
||||
Future<void> test_sibling() async {
|
||||
addSource('/home/test/lib/foo.dart', '''
|
||||
addSource('$testPackageLibPath/foo.dart', '''
|
||||
library foo;
|
||||
part 'bar.dart';
|
||||
''');
|
||||
|
||||
testFile = convertPath('/home/test/lib/bar.dart');
|
||||
testFile = convertPath('$testPackageLibPath/bar.dart');
|
||||
addTestSource('''
|
||||
part of foo;
|
||||
''');
|
||||
|
|
|
@ -21,7 +21,7 @@ class ConvertToPackageImportTest extends AssistProcessorTest {
|
|||
AssistKind get kind => DartAssistKind.CONVERT_TO_PACKAGE_IMPORT;
|
||||
|
||||
Future<void> test_fileName_onImport() async {
|
||||
addSource('/home/test/lib/foo.dart', '');
|
||||
addSource('$testPackageLibPath/foo.dart', '');
|
||||
|
||||
await resolveTestCode('''
|
||||
import 'foo.dart';
|
||||
|
@ -33,7 +33,7 @@ import 'package:test/foo.dart';
|
|||
}
|
||||
|
||||
Future<void> test_fileName_onUri() async {
|
||||
addSource('/home/test/lib/foo.dart', '');
|
||||
addSource('$testPackageLibPath/foo.dart', '');
|
||||
|
||||
await resolveTestCode('''
|
||||
import 'foo.dart';
|
||||
|
@ -52,8 +52,8 @@ import ':[invalidUri]';
|
|||
}
|
||||
|
||||
Future<void> test_nonPackage_Uri() async {
|
||||
addSource('/home/test/lib/foo.dart', '');
|
||||
testFile = convertPath('/home/test/lib/src/test.dart');
|
||||
addSource('$testPackageLibPath/foo.dart', '');
|
||||
testFile = convertPath('$testPackageLibPath/src/test.dart');
|
||||
await resolveTestCode('''
|
||||
import 'dart:core';
|
||||
''');
|
||||
|
@ -63,7 +63,7 @@ import 'dart:core';
|
|||
}
|
||||
|
||||
Future<void> test_packageUri() async {
|
||||
addSource('/home/test/lib/foo.dart', '');
|
||||
addSource('$testPackageLibPath/foo.dart', '');
|
||||
|
||||
await resolveTestCode('''
|
||||
import 'package:test/foo.dart';
|
||||
|
@ -73,9 +73,9 @@ import 'package:test/foo.dart';
|
|||
}
|
||||
|
||||
Future<void> test_path() async {
|
||||
addSource('/home/test/lib/foo/bar.dart', '');
|
||||
addSource('$testPackageLibPath/foo/bar.dart', '');
|
||||
|
||||
testFile = convertPath('/home/test/lib/src/test.dart');
|
||||
testFile = convertPath('$testPackageLibPath/src/test.dart');
|
||||
|
||||
await resolveTestCode('''
|
||||
import '../foo/bar.dart';
|
||||
|
@ -89,7 +89,7 @@ import 'package:test/foo/bar.dart';
|
|||
Future<void> test_relativeImport_noAssistWithLint() async {
|
||||
createAnalysisOptionsFile(lints: [LintNames.avoid_relative_lib_imports]);
|
||||
verifyNoTestUnitErrors = false;
|
||||
addSource('/home/test/lib/foo.dart', '');
|
||||
addSource('$testPackageLibPath/foo.dart', '');
|
||||
|
||||
await resolveTestCode('''
|
||||
import '../lib/foo.dart';
|
||||
|
|
|
@ -85,7 +85,7 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_setterOnDirective() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
void set setter(int i) {}
|
||||
''');
|
||||
await resolveTestCode('''
|
||||
|
|
|
@ -120,7 +120,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_privateType() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
_B b => _B();
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class AddLateTest extends FixProcessorTest {
|
|||
FixKind get kind => DartFixKind.ADD_LATE;
|
||||
|
||||
Future<void> test_changeInImportedLib() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class C {
|
||||
final String s;
|
||||
}
|
||||
|
@ -56,11 +56,11 @@ void f(C c) {
|
|||
class C {
|
||||
late final String s;
|
||||
}
|
||||
''', target: '/home/test/lib/a.dart');
|
||||
''', target: '$testPackageLibPath/a.dart');
|
||||
}
|
||||
|
||||
Future<void> test_changeInPart() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
part 'test.dart';
|
||||
|
||||
class C {
|
||||
|
@ -80,7 +80,7 @@ part 'test.dart';
|
|||
class C {
|
||||
late final String s;
|
||||
}
|
||||
''', target: '/home/test/lib/a.dart');
|
||||
''', target: '$testPackageLibPath/a.dart');
|
||||
}
|
||||
|
||||
Future<void> test_withFinal() async {
|
||||
|
|
|
@ -102,7 +102,7 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_constructor_single() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
class A {
|
||||
A({required int a}) {}
|
||||
}
|
||||
|
@ -126,7 +126,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_constructor_single_closure() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
typedef void VoidCallback();
|
||||
|
||||
class A {
|
||||
|
@ -152,7 +152,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_constructor_single_closure2() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
typedef void Callback(e);
|
||||
|
||||
class A {
|
||||
|
@ -178,7 +178,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_constructor_single_closure3() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
typedef void Callback(a,b,c);
|
||||
|
||||
class A {
|
||||
|
@ -204,7 +204,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_constructor_single_closure4() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
typedef int Callback(int a, String b,c);
|
||||
|
||||
class A {
|
||||
|
@ -230,7 +230,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_constructor_single_closure_nnbd() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
typedef int Callback(int? a);
|
||||
|
||||
class A {
|
||||
|
@ -256,7 +256,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_constructor_single_closure_nnbd_from_legacy() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
// @dart = 2.8
|
||||
import 'package:meta/meta.dart';
|
||||
|
||||
|
@ -287,7 +287,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_constructor_single_closure_nnbd_into_legacy() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
typedef int Callback(int? a);
|
||||
|
||||
class A {
|
||||
|
@ -315,7 +315,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_constructor_single_list() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
class A {
|
||||
A({required List<String> names}) {}
|
||||
}
|
||||
|
@ -339,7 +339,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_constructor_single_namedAnywhere() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
class A {
|
||||
A(int a, int b, {int? c, required int d}) {}
|
||||
}
|
||||
|
|
|
@ -179,7 +179,7 @@ class A {
|
|||
}
|
||||
|
||||
Future<void> test_privateType() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
_B b => _B();
|
||||
}
|
||||
|
|
|
@ -58,12 +58,12 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_method_importType() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
class A {
|
||||
static foo() {}
|
||||
}
|
||||
''');
|
||||
addSource('/home/test/lib/b.dart', r'''
|
||||
addSource('$testPackageLibPath/b.dart', r'''
|
||||
import 'package:test/a.dart';
|
||||
|
||||
class B extends A {}
|
||||
|
@ -142,12 +142,12 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_property_importType() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
class A {
|
||||
static get foo => null;
|
||||
}
|
||||
''');
|
||||
addSource('/home/test/lib/b.dart', r'''
|
||||
addSource('$testPackageLibPath/b.dart', r'''
|
||||
import 'package:test/a.dart';
|
||||
|
||||
class B extends A {}
|
||||
|
|
|
@ -57,7 +57,7 @@ f() {
|
|||
}
|
||||
|
||||
Future<void> test_privateType() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
_B b => _B();
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ class ConvertToPackageImportBulkTest extends BulkFixProcessorTest {
|
|||
@FailingTest(issue: 'https://github.com/dart-lang/sdk/issues/44673')
|
||||
Future<void> test_singleFile() async {
|
||||
writeTestPackageConfig(config: PackageConfigFileBuilder());
|
||||
addSource('/home/test/lib/bar.dart', 'class Bar {}');
|
||||
addSource('$testPackageLibPath/bar.dart', 'class Bar {}');
|
||||
|
||||
testFile = convertPath('/home/test/tool/test.dart');
|
||||
|
||||
|
@ -55,7 +55,7 @@ class ConvertToPackageImportTest extends FixProcessorLintTest {
|
|||
// This test fails because any attempt to specify a relative path that
|
||||
// includes 'lib' (which the lint requires) results in a malformed URI when
|
||||
// trying to resolve the import.
|
||||
newFile('/home/test/lib/foo/bar.dart', content: '''
|
||||
newFile('$testPackageLibPath/foo/bar.dart', content: '''
|
||||
class C {}
|
||||
''');
|
||||
await resolveTestCode('''
|
||||
|
|
|
@ -23,13 +23,13 @@ class ConvertToRelativeImportBulkTest extends BulkFixProcessorTest {
|
|||
String get lintCode => LintNames.prefer_relative_imports;
|
||||
|
||||
Future<void> test_singleFile() async {
|
||||
addSource('/home/test/lib/foo.dart', '''
|
||||
addSource('$testPackageLibPath/foo.dart', '''
|
||||
class C {}
|
||||
''');
|
||||
addSource('/home/test/lib/bar.dart', '''
|
||||
addSource('$testPackageLibPath/bar.dart', '''
|
||||
class D {}
|
||||
''');
|
||||
testFile = convertPath('/home/test/lib/src/test.dart');
|
||||
testFile = convertPath('$testPackageLibPath/src/test.dart');
|
||||
|
||||
await resolveTestCode('''
|
||||
import 'package:test/bar.dart';
|
||||
|
@ -55,10 +55,10 @@ class ConvertToRelativeImportTest extends FixProcessorLintTest {
|
|||
String get lintCode => LintNames.prefer_relative_imports;
|
||||
|
||||
Future<void> test_relativeImport() async {
|
||||
addSource('/home/test/lib/foo.dart', '''
|
||||
addSource('$testPackageLibPath/foo.dart', '''
|
||||
class C {}
|
||||
''');
|
||||
testFile = convertPath('/home/test/lib/src/test.dart');
|
||||
testFile = convertPath('$testPackageLibPath/src/test.dart');
|
||||
await resolveTestCode('''
|
||||
import 'package:test/foo.dart';
|
||||
C? c;
|
||||
|
@ -82,8 +82,8 @@ import 'package:test1/foo.dart';
|
|||
}
|
||||
|
||||
Future<void> test_relativeImportGarbledUri() async {
|
||||
addSource('/home/test/lib/foo.dart', '');
|
||||
testFile = convertPath('/home/test/lib/bar.dart');
|
||||
addSource('$testPackageLibPath/foo.dart', '');
|
||||
testFile = convertPath('$testPackageLibPath/bar.dart');
|
||||
await resolveTestCode('''
|
||||
import 'package:test/foo';
|
||||
''');
|
||||
|
@ -96,10 +96,10 @@ import 'foo';
|
|||
}
|
||||
|
||||
Future<void> test_relativeImportRespectQuoteStyle() async {
|
||||
addSource('/home/test/lib/foo.dart', '''
|
||||
addSource('$testPackageLibPath/foo.dart', '''
|
||||
class C {}
|
||||
''');
|
||||
testFile = convertPath('/home/test/lib/bar.dart');
|
||||
testFile = convertPath('$testPackageLibPath/bar.dart');
|
||||
await resolveTestCode('''
|
||||
import "package:test/foo.dart";
|
||||
C? c;
|
||||
|
@ -112,10 +112,10 @@ C? c;
|
|||
}
|
||||
|
||||
Future<void> test_relativeImportSameDirectory() async {
|
||||
addSource('/home/test/lib/foo.dart', '''
|
||||
addSource('$testPackageLibPath/foo.dart', '''
|
||||
class C {}
|
||||
''');
|
||||
testFile = convertPath('/home/test/lib/bar.dart');
|
||||
testFile = convertPath('$testPackageLibPath/bar.dart');
|
||||
await resolveTestCode('''
|
||||
import 'package:test/foo.dart';
|
||||
C? c;
|
||||
|
@ -128,10 +128,10 @@ C? c;
|
|||
}
|
||||
|
||||
Future<void> test_relativeImportSubDirectory() async {
|
||||
addSource('/home/test/lib/baz/foo.dart', '''
|
||||
addSource('$testPackageLibPath/baz/foo.dart', '''
|
||||
class C {}
|
||||
''');
|
||||
testFile = convertPath('/home/test/lib/test.dart');
|
||||
testFile = convertPath('$testPackageLibPath/test.dart');
|
||||
await resolveTestCode('''
|
||||
import 'package:test/baz/foo.dart';
|
||||
C? c;
|
||||
|
|
|
@ -73,7 +73,7 @@ class BaseClass {
|
|||
}
|
||||
|
||||
Future<void> test_inLibraryOfPrefix() async {
|
||||
addSource('/home/test/lib/lib.dart', r'''
|
||||
addSource('$testPackageLibPath/lib.dart', r'''
|
||||
class A {}
|
||||
''');
|
||||
|
||||
|
@ -92,7 +92,7 @@ class A {}
|
|||
|
||||
class Test {
|
||||
}
|
||||
''', target: '/home/test/lib/lib.dart');
|
||||
''', target: '$testPackageLibPath/lib.dart');
|
||||
expect(change.linkedEditGroups, hasLength(1));
|
||||
}
|
||||
|
||||
|
|
|
@ -50,10 +50,10 @@ class B extends A {
|
|||
}
|
||||
|
||||
Future<void> test_importType() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
class A {}
|
||||
''');
|
||||
addSource('/home/test/lib/b.dart', r'''
|
||||
addSource('$testPackageLibPath/b.dart', r'''
|
||||
import 'package:test/a.dart';
|
||||
|
||||
class B {
|
||||
|
|
|
@ -41,7 +41,7 @@ class CreateConstructorTest extends FixProcessorTest {
|
|||
FixKind get kind => DartFixKind.CREATE_CONSTRUCTOR;
|
||||
|
||||
Future<void> test_inLibrary_insteadOfSyntheticDefault() async {
|
||||
var a = newFile('/home/test/lib/a.dart', content: '''
|
||||
var a = newFile('$testPackageLibPath/a.dart', content: '''
|
||||
/// $_text200
|
||||
class A {}
|
||||
''').path;
|
||||
|
@ -61,7 +61,7 @@ class A {
|
|||
}
|
||||
|
||||
Future<void> test_inLibrary_named() async {
|
||||
var a = newFile('/home/test/lib/a.dart', content: '''
|
||||
var a = newFile('$testPackageLibPath/a.dart', content: '''
|
||||
/// $_text200
|
||||
class A {}
|
||||
''').path;
|
||||
|
|
|
@ -131,7 +131,7 @@ void f(A a) {
|
|||
}
|
||||
|
||||
Future<void> test_getter_qualified_instance_differentLibrary() async {
|
||||
addSource('/home/test/lib/other.dart', '''
|
||||
addSource('$testPackageLibPath/other.dart', '''
|
||||
/**
|
||||
* A comment to push the offset of the braces for the following class
|
||||
* declaration past the end of the content of the test file. Used to catch an
|
||||
|
@ -161,7 +161,7 @@ void f(A a) {
|
|||
class A {
|
||||
int test;
|
||||
}
|
||||
''', target: '/home/test/lib/other.dart');
|
||||
''', target: '$testPackageLibPath/other.dart');
|
||||
}
|
||||
|
||||
Future<void> test_getter_qualified_instance_dynamicType() async {
|
||||
|
@ -317,11 +317,11 @@ void f(A a) {
|
|||
}
|
||||
|
||||
Future<void> test_importType() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
class A {}
|
||||
''');
|
||||
|
||||
addSource('/home/test/lib/b.dart', r'''
|
||||
addSource('$testPackageLibPath/b.dart', r'''
|
||||
import 'package:test/a.dart';
|
||||
|
||||
A getA() => null;
|
||||
|
@ -365,7 +365,7 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_inPart_imported() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
part of lib;
|
||||
class A {}
|
||||
''');
|
||||
|
|
|
@ -29,7 +29,7 @@ export 'my_file.dart';
|
|||
var fileEdits = change.edits;
|
||||
expect(fileEdits, hasLength(1));
|
||||
var fileEdit = change.edits[0];
|
||||
expect(fileEdit.file, convertPath('/home/test/lib/my_file.dart'));
|
||||
expect(fileEdit.file, convertPath('$testPackageLibPath/my_file.dart'));
|
||||
expect(fileEdit.fileStamp, -1);
|
||||
expect(fileEdit.edits, hasLength(1));
|
||||
expect(
|
||||
|
@ -47,7 +47,7 @@ import 'my_file.dart';
|
|||
var fileEdits = change.edits;
|
||||
expect(fileEdits, hasLength(1));
|
||||
var fileEdit = change.edits[0];
|
||||
expect(fileEdit.file, convertPath('/home/test/lib/my_file.dart'));
|
||||
expect(fileEdit.file, convertPath('$testPackageLibPath/my_file.dart'));
|
||||
expect(fileEdit.fileStamp, -1);
|
||||
expect(fileEdit.edits, hasLength(1));
|
||||
expect(
|
||||
|
@ -72,7 +72,7 @@ import 'a/bb/my_lib.dart';
|
|||
var fileEdits = change.edits;
|
||||
expect(fileEdits, hasLength(1));
|
||||
var fileEdit = change.edits[0];
|
||||
expect(fileEdit.file, convertPath('/home/test/lib/a/bb/my_lib.dart'));
|
||||
expect(fileEdit.file, convertPath('$testPackageLibPath/a/bb/my_lib.dart'));
|
||||
expect(fileEdit.fileStamp, -1);
|
||||
expect(fileEdit.edits, hasLength(1));
|
||||
expect(
|
||||
|
@ -110,7 +110,7 @@ part 'my_part.dart';
|
|||
var fileEdits = change.edits;
|
||||
expect(fileEdits, hasLength(1));
|
||||
var fileEdit = change.edits[0];
|
||||
expect(fileEdit.file, convertPath('/home/test/lib/my_part.dart'));
|
||||
expect(fileEdit.file, convertPath('$testPackageLibPath/my_part.dart'));
|
||||
expect(fileEdit.fileStamp, -1);
|
||||
expect(fileEdit.edits, hasLength(1));
|
||||
expect(fileEdit.edits[0].replacement, contains("part of 'test.dart';"));
|
||||
|
@ -125,7 +125,7 @@ part 'foo/my_part.dart';
|
|||
var fileEdits = change.edits;
|
||||
expect(fileEdits, hasLength(1));
|
||||
var fileEdit = change.edits[0];
|
||||
expect(fileEdit.file, convertPath('/home/test/lib/foo/my_part.dart'));
|
||||
expect(fileEdit.file, convertPath('$testPackageLibPath/foo/my_part.dart'));
|
||||
expect(fileEdit.fileStamp, -1);
|
||||
expect(fileEdit.edits, hasLength(1));
|
||||
expect(fileEdit.edits[0].replacement, contains("part of '../test.dart';"));
|
||||
|
|
|
@ -259,10 +259,10 @@ int test(double a, String b) {
|
|||
}
|
||||
|
||||
Future<void> test_functionType_importType() async {
|
||||
addSource('/home/test/lib/a.dart', r'''
|
||||
addSource('$testPackageLibPath/a.dart', r'''
|
||||
class A {}
|
||||
''');
|
||||
addSource('/home/test/lib/b.dart', r'''
|
||||
addSource('$testPackageLibPath/b.dart', r'''
|
||||
import 'package:test/a.dart';
|
||||
|
||||
useFunction(int g(A a)) {}
|
||||
|
@ -348,7 +348,7 @@ void process(Map items) {
|
|||
}
|
||||
|
||||
Future<void> test_importType() async {
|
||||
addSource('/home/test/lib/lib.dart', r'''
|
||||
addSource('$testPackageLibPath/lib.dart', r'''
|
||||
library lib;
|
||||
import 'dart:async';
|
||||
Future getFuture() => null;
|
||||
|
|
|
@ -249,7 +249,7 @@ void f(A a) {
|
|||
}
|
||||
|
||||
Future<void> test_qualified_instance_differentLibrary() async {
|
||||
addSource('/home/test/lib/other.dart', '''
|
||||
addSource('$testPackageLibPath/other.dart', '''
|
||||
/**
|
||||
* A comment to push the offset of the braces for the following class
|
||||
* declaration past the end of the content of the test file. Used to catch an
|
||||
|
@ -279,7 +279,7 @@ void f(A a) {
|
|||
class A {
|
||||
int get test => null;
|
||||
}
|
||||
''', target: '/home/test/lib/other.dart');
|
||||
''', target: '$testPackageLibPath/other.dart');
|
||||
}
|
||||
|
||||
Future<void> test_qualified_instance_dynamicType() async {
|
||||
|
@ -307,7 +307,7 @@ class B {
|
|||
}
|
||||
|
||||
Future<void> test_qualified_instance_inPart_imported() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
part of lib;
|
||||
|
||||
class A {}
|
||||
|
|
|
@ -834,8 +834,8 @@ class D {
|
|||
}
|
||||
''';
|
||||
|
||||
addSource('/home/test/lib/test2.dart', code2);
|
||||
addSource('/home/test/lib/test3.dart', r'''
|
||||
addSource('$testPackageLibPath/test2.dart', code2);
|
||||
addSource('$testPackageLibPath/test3.dart', r'''
|
||||
library test3;
|
||||
class E {}
|
||||
''');
|
||||
|
@ -855,11 +855,11 @@ export 'test3.dart';
|
|||
class D {
|
||||
void foo(bbb.E e) {}
|
||||
}
|
||||
''', target: '/home/test/lib/test2.dart');
|
||||
''', target: '$testPackageLibPath/test2.dart');
|
||||
}
|
||||
|
||||
Future<void> test_parameterType_inTargetUnit() async {
|
||||
addSource('/home/test/lib/test2.dart', r'''
|
||||
addSource('$testPackageLibPath/test2.dart', r'''
|
||||
class D {
|
||||
}
|
||||
|
||||
|
@ -880,7 +880,7 @@ class D {
|
|||
}
|
||||
|
||||
class E {}
|
||||
''', target: '/home/test/lib/test2.dart');
|
||||
''', target: '$testPackageLibPath/test2.dart');
|
||||
}
|
||||
|
||||
Future<void> test_static() async {
|
||||
|
|
|
@ -35,7 +35,7 @@ main() {
|
|||
var libCode = r'''
|
||||
class A {}
|
||||
''';
|
||||
addSource('/home/test/lib/lib.dart', libCode);
|
||||
addSource('$testPackageLibPath/lib.dart', libCode);
|
||||
await resolveTestCode('''
|
||||
import 'lib.dart' as lib;
|
||||
|
||||
|
@ -50,7 +50,7 @@ class A {}
|
|||
|
||||
mixin Test {
|
||||
}
|
||||
''', target: '/home/test/lib/lib.dart');
|
||||
''', target: '$testPackageLibPath/lib.dart');
|
||||
expect(change.linkedEditGroups, hasLength(1));
|
||||
}
|
||||
|
||||
|
|
|
@ -245,7 +245,7 @@ void f(A a) {
|
|||
}
|
||||
|
||||
Future<void> test_qualified_instance_differentLibrary() async {
|
||||
addSource('/home/test/lib/other.dart', '''
|
||||
addSource('$testPackageLibPath/other.dart', '''
|
||||
/**
|
||||
* A comment to push the offset of the braces for the following class
|
||||
* declaration past the end of the content of the test file. Used to catch an
|
||||
|
@ -274,7 +274,7 @@ void f(A a) {
|
|||
class A {
|
||||
set test(int test) {}
|
||||
}
|
||||
''', target: '/home/test/lib/other.dart');
|
||||
''', target: '$testPackageLibPath/other.dart');
|
||||
}
|
||||
|
||||
Future<void> test_qualified_instance_dynamicType() async {
|
||||
|
@ -302,7 +302,7 @@ class B {
|
|||
}
|
||||
|
||||
Future<void> test_qualified_instance_inPart_imported() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
part of lib;
|
||||
|
||||
class A {}
|
||||
|
|
|
@ -1134,7 +1134,7 @@ transforms:
|
|||
- kind: 'rename'
|
||||
newName: 'New'
|
||||
''');
|
||||
addSource('/home/test/lib/test.config', '''
|
||||
addSource('$testPackageLibPath/test.config', '''
|
||||
'Rename to New':
|
||||
bulkApply: true
|
||||
''');
|
||||
|
|
|
@ -33,7 +33,7 @@ class TransformSetManagerTest extends AbstractContextTest {
|
|||
|
||||
addSource('/home/test/pubspec.yaml', '');
|
||||
|
||||
var testFile = convertPath('/home/test/lib/test.dart');
|
||||
var testFile = convertPath('$testPackageLibPath/test.dart');
|
||||
addSource(testFile, '');
|
||||
var result = await session.getResolvedLibraryValid(testFile);
|
||||
var sets = manager.forLibrary(result.element);
|
||||
|
@ -44,7 +44,7 @@ class TransformSetManagerTest extends AbstractContextTest {
|
|||
// addTestPackageDependency('p1', '/.pub-cache/p1');
|
||||
// addTestPackageDependency('p2', '/.pub-cache/p2');
|
||||
addSource('/home/test/pubspec.yaml', '');
|
||||
var testFile = convertPath('/home/test/lib/test.dart');
|
||||
var testFile = convertPath('$testPackageLibPath/test.dart');
|
||||
addSource(testFile, '');
|
||||
var result = await session.getResolvedLibraryValid(testFile);
|
||||
var sets = manager.forLibrary(result.element);
|
||||
|
|
|
@ -39,7 +39,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_withExtension() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
class C {}
|
||||
extension E on int {
|
||||
static String m() => '';
|
||||
|
|
|
@ -24,7 +24,7 @@ class ImportLibraryProject1Test extends FixProcessorTest {
|
|||
FixKind get kind => DartFixKind.IMPORT_LIBRARY_PROJECT1;
|
||||
|
||||
Future<void> test_alreadyImported_package() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
class A {}
|
||||
class B {}
|
||||
''');
|
||||
|
@ -40,14 +40,14 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_extension_notImported_field_onThisType_fromClass() async {
|
||||
addUnimportedFile('/home/test/lib/lib2.dart', '''
|
||||
addUnimportedFile('$testPackageLibPath/lib2.dart', '''
|
||||
import 'package:test/lib1.dart';
|
||||
|
||||
extension E on C {
|
||||
int m() => 0;
|
||||
}
|
||||
''');
|
||||
addSource('/home/test/lib/lib1.dart', '''
|
||||
addSource('$testPackageLibPath/lib1.dart', '''
|
||||
class C {}
|
||||
''');
|
||||
await resolveTestCode('''
|
||||
|
@ -68,7 +68,7 @@ class D extends C {
|
|||
}
|
||||
|
||||
Future<void> test_extension_notImported_getter() async {
|
||||
addUnimportedFile('/home/test/lib/lib.dart', '''
|
||||
addUnimportedFile('$testPackageLibPath/lib.dart', '''
|
||||
extension E on String {
|
||||
int get m => 0;
|
||||
}
|
||||
|
@ -88,7 +88,7 @@ void f(String s) {
|
|||
}
|
||||
|
||||
Future<void> test_extension_notImported_method() async {
|
||||
addUnimportedFile('/home/test/lib/lib.dart', '''
|
||||
addUnimportedFile('$testPackageLibPath/lib.dart', '''
|
||||
extension E on String {
|
||||
void m() {}
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ void f(String s) {
|
|||
}
|
||||
|
||||
Future<void> test_extension_notImported_method_extendsGeneric() async {
|
||||
addUnimportedFile('/home/test/lib/lib.dart', '''
|
||||
addUnimportedFile('$testPackageLibPath/lib.dart', '''
|
||||
import 'package:test/lib1.dart';
|
||||
|
||||
extension E<T extends num> on List<T> {
|
||||
|
@ -130,14 +130,14 @@ void f(List<int> l) {
|
|||
}
|
||||
|
||||
Future<void> test_extension_notImported_method_onThisType_fromClass() async {
|
||||
addUnimportedFile('/home/test/lib/lib2.dart', '''
|
||||
addUnimportedFile('$testPackageLibPath/lib2.dart', '''
|
||||
import 'package:test/lib1.dart';
|
||||
|
||||
extension E on C {
|
||||
void m() {}
|
||||
}
|
||||
''');
|
||||
addSource('/home/test/lib/lib1.dart', '''
|
||||
addSource('$testPackageLibPath/lib1.dart', '''
|
||||
class C {}
|
||||
''');
|
||||
await resolveTestCode('''
|
||||
|
@ -163,14 +163,14 @@ class D extends C {
|
|||
|
||||
Future<void>
|
||||
test_extension_notImported_method_onThisType_fromExtension() async {
|
||||
addUnimportedFile('/home/test/lib/lib2.dart', '''
|
||||
addUnimportedFile('$testPackageLibPath/lib2.dart', '''
|
||||
import 'package:test/lib1.dart';
|
||||
|
||||
extension E on C {
|
||||
void m() {}
|
||||
}
|
||||
''');
|
||||
addSource('/home/test/lib/lib1.dart', '''
|
||||
addSource('$testPackageLibPath/lib1.dart', '''
|
||||
class C {}
|
||||
''');
|
||||
await resolveTestCode('''
|
||||
|
@ -195,7 +195,7 @@ extension F on C {
|
|||
}
|
||||
|
||||
Future<void> test_extension_notImported_operator() async {
|
||||
addUnimportedFile('/home/test/lib/lib.dart', '''
|
||||
addUnimportedFile('$testPackageLibPath/lib.dart', '''
|
||||
extension E on String {
|
||||
String operator -(String other) => this;
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ void f(String s) {
|
|||
}
|
||||
|
||||
Future<void> test_extension_notImported_setter() async {
|
||||
addUnimportedFile('/home/test/lib/lib.dart', '''
|
||||
addUnimportedFile('$testPackageLibPath/lib.dart', '''
|
||||
extension E on String {
|
||||
set m(int v) {}
|
||||
}
|
||||
|
@ -235,7 +235,7 @@ void f(String s) {
|
|||
}
|
||||
|
||||
Future<void> test_invalidUri_interpolation() async {
|
||||
addSource('/home/test/lib/lib.dart', r'''
|
||||
addSource('$testPackageLibPath/lib.dart', r'''
|
||||
class Test {
|
||||
const Test();
|
||||
}
|
||||
|
@ -355,7 +355,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_relativeDirective() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class Foo {}
|
||||
''');
|
||||
await resolveTestCode('''
|
||||
|
@ -377,7 +377,7 @@ main() { new Foo(); }
|
|||
}
|
||||
|
||||
Future<void> test_relativeDirective_downOneDirectory() async {
|
||||
addSource('/home/test/lib/dir/a.dart', '''
|
||||
addSource('$testPackageLibPath/dir/a.dart', '''
|
||||
class Foo {}
|
||||
''');
|
||||
await resolveTestCode('''
|
||||
|
@ -394,7 +394,7 @@ main() { new Foo(); }
|
|||
|
||||
Future<void> test_relativeDirective_preferRelativeImports() async {
|
||||
createAnalysisOptionsFile(lints: [LintNames.prefer_relative_imports]);
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class Foo {}
|
||||
''');
|
||||
await resolveTestCode('''
|
||||
|
@ -416,10 +416,10 @@ main() { new Foo(); }
|
|||
}
|
||||
|
||||
Future<void> test_relativeDirective_upOneDirectory() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class Foo {}
|
||||
''');
|
||||
testFile = convertPath('/home/test/lib/dir/test.dart');
|
||||
testFile = convertPath('$testPackageLibPath/dir/test.dart');
|
||||
await resolveTestCode('''
|
||||
main() { new Foo(); }
|
||||
''');
|
||||
|
@ -433,7 +433,7 @@ main() { new Foo(); }
|
|||
}
|
||||
|
||||
Future<void> test_withClass_annotation() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
library lib;
|
||||
class Test {
|
||||
const Test(int p);
|
||||
|
@ -454,7 +454,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_withClass_catchClause() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
class Test {}
|
||||
''');
|
||||
await resolveTestCode('''
|
||||
|
@ -480,11 +480,11 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_withClass_hasOtherLibraryWithPrefix() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
library a;
|
||||
class One {}
|
||||
''');
|
||||
addSource('/home/test/lib/b.dart', '''
|
||||
addSource('$testPackageLibPath/b.dart', '''
|
||||
library b;
|
||||
class One {}
|
||||
class Two {}
|
||||
|
@ -573,7 +573,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_withClass_instanceCreation_const() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
class Test {
|
||||
const Test();
|
||||
}
|
||||
|
@ -593,7 +593,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_withClass_instanceCreation_const_namedConstructor() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
class Test {
|
||||
const Test.named();
|
||||
}
|
||||
|
@ -613,7 +613,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_withClass_instanceCreation_implicit() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
class Test {
|
||||
const Test();
|
||||
}
|
||||
|
@ -633,7 +633,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_withClass_instanceCreation_new() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
class Test {
|
||||
const Test();
|
||||
}
|
||||
|
@ -653,7 +653,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_withClass_instanceCreation_new_namedConstructor() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
class Test {
|
||||
Test.named();
|
||||
}
|
||||
|
@ -673,7 +673,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_withFunction() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
library lib;
|
||||
myFunction() {}
|
||||
''');
|
||||
|
@ -692,7 +692,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_withFunction_functionTopLevelVariable() async {
|
||||
addSource('/home/test/lib/lib.dart', 'var myFunction = () {};');
|
||||
addSource('$testPackageLibPath/lib.dart', 'var myFunction = () {};');
|
||||
await resolveTestCode('''
|
||||
main() {
|
||||
myFunction();
|
||||
|
@ -708,7 +708,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_withFunction_functionTopLevelVariableIdentifier() async {
|
||||
addSource('/home/test/lib/lib.dart', 'var myFunction = () {};');
|
||||
addSource('$testPackageLibPath/lib.dart', 'var myFunction = () {};');
|
||||
await resolveTestCode('''
|
||||
main() {
|
||||
myFunction;
|
||||
|
@ -724,7 +724,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_withFunction_identifier() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
library lib;
|
||||
myFunction() {}
|
||||
''');
|
||||
|
@ -744,7 +744,7 @@ main() {
|
|||
|
||||
@failingTest
|
||||
Future<void> test_withFunction_nonFunctionType() async {
|
||||
addSource('/home/test/lib/lib.dart', 'int zero = 0;');
|
||||
addSource('$testPackageLibPath/lib.dart', 'int zero = 0;');
|
||||
await resolveTestCode('''
|
||||
main() {
|
||||
zero();
|
||||
|
@ -754,7 +754,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_withFunction_unresolvedMethod() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
library lib;
|
||||
myFunction() {}
|
||||
''');
|
||||
|
@ -777,7 +777,7 @@ class A {
|
|||
}
|
||||
|
||||
Future<void> test_withFunctionTypeAlias() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
library lib;
|
||||
typedef MyFunction();
|
||||
''');
|
||||
|
@ -798,7 +798,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_withMixin() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
mixin Test {}
|
||||
''');
|
||||
await resolveTestCode('''
|
||||
|
@ -812,7 +812,7 @@ class X = Object with Test;
|
|||
}
|
||||
|
||||
Future<void> test_withTopLevelVariable() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
library lib;
|
||||
int MY_VAR = 42;
|
||||
''');
|
||||
|
@ -955,7 +955,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_inLibSrc_thisContextRoot() async {
|
||||
addSource('/home/test/lib/src/lib.dart', 'class Test {}');
|
||||
addSource('$testPackageLibPath/src/lib.dart', 'class Test {}');
|
||||
await resolveTestCode('''
|
||||
main() {
|
||||
Test t;
|
||||
|
@ -973,7 +973,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_inLibSrc_thisContextRoot_extension() async {
|
||||
addSource('/home/test/lib/src/lib.dart', '''
|
||||
addSource('$testPackageLibPath/src/lib.dart', '''
|
||||
extension E on int {
|
||||
static String m() => '';
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ class ImportLibraryShowTest extends FixProcessorTest {
|
|||
FixKind get kind => DartFixKind.IMPORT_LIBRARY_SHOW;
|
||||
|
||||
Future<void> test_extension_notShown_getter() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
class C {}
|
||||
extension E on String {
|
||||
int get m => 0;
|
||||
|
@ -43,7 +43,7 @@ void f(String s, C c) {
|
|||
}
|
||||
|
||||
Future<void> test_extension_notShown_method() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
class C {}
|
||||
extension E on String {
|
||||
void m() {}
|
||||
|
@ -66,7 +66,7 @@ void f(String s, C c) {
|
|||
}
|
||||
|
||||
Future<void> test_extension_notShown_operator() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
class C {}
|
||||
extension E on String {
|
||||
String operator -(String other) => this;
|
||||
|
@ -89,7 +89,7 @@ void f(String s, C c) {
|
|||
}
|
||||
|
||||
Future<void> test_extension_notShown_setter() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
class C {}
|
||||
extension E on String {
|
||||
set m(int v) {}
|
||||
|
@ -112,7 +112,7 @@ void f(String s, C c) {
|
|||
}
|
||||
|
||||
Future<void> test_override_samePackage() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
class A {}
|
||||
extension E on int {
|
||||
String m() => '';
|
||||
|
@ -133,7 +133,7 @@ void f(A a) {
|
|||
}
|
||||
|
||||
Future<void> test_package() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
class A {}
|
||||
class B {}
|
||||
''');
|
||||
|
@ -175,7 +175,7 @@ main() {
|
|||
}
|
||||
|
||||
Future<void> test_static_samePackage() async {
|
||||
addSource('/home/test/lib/lib.dart', '''
|
||||
addSource('$testPackageLibPath/lib.dart', '''
|
||||
class A {}
|
||||
extension E on int {
|
||||
static String m() => '';
|
||||
|
|
|
@ -42,12 +42,12 @@ void f(Stream<String> args) { }
|
|||
}
|
||||
|
||||
Future<void> test_organizePathImports() async {
|
||||
newFile('/home/test/lib/a.dart', content: '''
|
||||
newFile('$testPackageLibPath/a.dart', content: '''
|
||||
class A {
|
||||
static void m() {}
|
||||
}
|
||||
''');
|
||||
newFile('/home/test/lib/a/b.dart', content: '''
|
||||
newFile('$testPackageLibPath/a/b.dart', content: '''
|
||||
class B {
|
||||
static void m() {}
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ class D extends C {
|
|||
}
|
||||
|
||||
Future<void> test_class_imported() async {
|
||||
newFile('/home/test/lib/a.dart', content: '''
|
||||
newFile('$testPackageLibPath/a.dart', content: '''
|
||||
class A {
|
||||
static void m() {}
|
||||
}
|
||||
|
@ -60,7 +60,7 @@ class B extends A {
|
|||
}
|
||||
|
||||
Future<void> test_class_importedWithPrefix() async {
|
||||
newFile('/home/test/lib/a.dart', content: '''
|
||||
newFile('$testPackageLibPath/a.dart', content: '''
|
||||
class A {
|
||||
static void m() {}
|
||||
}
|
||||
|
@ -104,12 +104,12 @@ class D extends C {
|
|||
}
|
||||
|
||||
Future<void> test_class_notImported() async {
|
||||
newFile('/home/test/lib/a.dart', content: '''
|
||||
newFile('$testPackageLibPath/a.dart', content: '''
|
||||
class A {
|
||||
static void m() {}
|
||||
}
|
||||
''');
|
||||
newFile('/home/test/lib/b.dart', content: '''
|
||||
newFile('$testPackageLibPath/b.dart', content: '''
|
||||
import 'a.dart';
|
||||
class B extends A {}
|
||||
''');
|
||||
|
@ -148,7 +148,7 @@ extension E on C {
|
|||
}
|
||||
|
||||
Future<void> test_extension_imported() async {
|
||||
newFile('/home/test/lib/a.dart', content: '''
|
||||
newFile('$testPackageLibPath/a.dart', content: '''
|
||||
class A {
|
||||
static void m() {}
|
||||
}
|
||||
|
@ -165,7 +165,7 @@ extension E on A {
|
|||
}
|
||||
|
||||
Future<void> test_extension_importedWithPrefix() async {
|
||||
newFile('/home/test/lib/a.dart', content: '''
|
||||
newFile('$testPackageLibPath/a.dart', content: '''
|
||||
class A {
|
||||
static void m() {}
|
||||
}
|
||||
|
@ -209,12 +209,12 @@ extension E on C {
|
|||
}
|
||||
|
||||
Future<void> test_extension_notImported() async {
|
||||
newFile('/home/test/lib/a.dart', content: '''
|
||||
newFile('$testPackageLibPath/a.dart', content: '''
|
||||
class A {
|
||||
static void m() {}
|
||||
}
|
||||
''');
|
||||
newFile('/home/test/lib/b.dart', content: '''
|
||||
newFile('$testPackageLibPath/b.dart', content: '''
|
||||
import 'a.dart';
|
||||
class B extends A {}
|
||||
''');
|
||||
|
|
|
@ -126,7 +126,7 @@ class B extends A<int> {
|
|||
@FailingTest(issue: 'https://github.com/dart-lang/linter/issues/1997')
|
||||
Future<void> test_method_nullSafety_optIn_fromOptOut() async {
|
||||
createAnalysisOptionsFile(lints: [lintCode]);
|
||||
newFile('/home/test/lib/a.dart', content: r'''
|
||||
newFile('$testPackageLibPath/a.dart', content: r'''
|
||||
class A {
|
||||
int foo() => 0;
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ class B extends A {
|
|||
}
|
||||
|
||||
Future<void> test_privateType() async {
|
||||
addSource('/home/test/lib/a.dart', '''
|
||||
addSource('$testPackageLibPath/a.dart', '''
|
||||
class A {
|
||||
_B b => _B();
|
||||
}
|
||||
|
|
|
@ -62,7 +62,7 @@ void f() {
|
|||
}
|
||||
|
||||
Future<void> test_qualified() async {
|
||||
newFile('/home/test/lib/ext.dart', content: '''
|
||||
newFile('$testPackageLibPath/ext.dart', content: '''
|
||||
extension E on String {
|
||||
static int m() => 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue