Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(96)

Unified Diff: pkg/analysis_server/test/services/correction/fix_test.dart

Issue 2614033003: Make subclasses of AbstractContextTest asynchronous. (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/services/correction/fix_test.dart
diff --git a/pkg/analysis_server/test/services/correction/fix_test.dart b/pkg/analysis_server/test/services/correction/fix_test.dart
index f3f10f4920a30819f9bf21458da08fbe58fc6e2e..3d5ebd532f30065f45a5bd9234689923bcd6f814 100644
--- a/pkg/analysis_server/test/services/correction/fix_test.dart
+++ b/pkg/analysis_server/test/services/correction/fix_test.dart
@@ -52,7 +52,7 @@ class BaseFixProcessorTest extends AbstractSingleUnitTest {
String resultCode;
assert_undefinedFunction_create_returnType_bool(String lineWithTest) async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
bool b = true;
$lineWithTest
@@ -198,7 +198,7 @@ bool test() {
@reflectiveTest
class FixProcessorTest extends BaseFixProcessorTest {
test_addFieldFormalParameters_hasRequiredParameter() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class Test {
final int a;
final int b;
@@ -219,7 +219,7 @@ class Test {
}
test_addFieldFormalParameters_noParameters() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class Test {
final int a;
final int b;
@@ -240,7 +240,7 @@ class Test {
}
test_addFieldFormalParameters_noRequiredParameter() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class Test {
final int a;
final int b;
@@ -261,7 +261,7 @@ class Test {
}
test_addMissingParameter_function_positional_hasNamed() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
test({int a}) {}
main() {
test(1);
@@ -271,7 +271,7 @@ main() {
}
test_addMissingParameter_function_positional_hasZero() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
test() {}
main() {
test(1);
@@ -288,7 +288,7 @@ main() {
}
test_addMissingParameter_function_required_hasNamed() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
test({int a}) {}
main() {
test(1);
@@ -305,7 +305,7 @@ main() {
}
test_addMissingParameter_function_required_hasOne() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
test(int a) {}
main() {
test(1, 2.0);
@@ -322,7 +322,7 @@ main() {
}
test_addMissingParameter_function_required_hasZero() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
test() {}
main() {
test(1);
@@ -339,7 +339,7 @@ main() {
}
test_addMissingParameter_method_positional_hasOne() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
test(int a) {}
main() {
@@ -360,7 +360,7 @@ class A {
}
test_addMissingParameter_method_required_hasOne() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
test(int a) {}
main() {
@@ -381,7 +381,7 @@ class A {
}
test_addMissingParameter_method_required_hasZero() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
test() {}
main() {
@@ -409,7 +409,7 @@ class A {
class A {}
''';
addSource('/part.dart', partCode);
- resolveTestUnit('''
+ await resolveTestUnit('''
library my.lib;
part 'part.dart';
''');
@@ -435,7 +435,7 @@ class A {}
}
test_addSync_asyncFor() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:async';
void main(Stream<String> names) {
await for (String name in names) {
@@ -456,14 +456,14 @@ Future main(Stream<String> names) async {
}
test_addSync_BAD_nullFunctionBody() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
var F = await;
''');
await assertNoFix(DartFixKind.ADD_ASYNC);
}
test_addSync_blockFunctionBody() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
foo() {}
main() {
await foo();
@@ -508,7 +508,7 @@ main() async {
errorFilter = (AnalysisError error) {
return error.errorCode == StaticWarningCode.UNDEFINED_IDENTIFIER_AWAIT;
};
- resolveTestUnit('''
+ await resolveTestUnit('''
foo() {}
main() => await foo();
''');
@@ -524,7 +524,7 @@ main() async => await foo();
errorFilter = (AnalysisError error) {
return error.errorCode == StaticWarningCode.UNDEFINED_IDENTIFIER_AWAIT;
};
- resolveTestUnit('''
+ await resolveTestUnit('''
foo() {}
int main() {
await foo();
@@ -548,7 +548,7 @@ Future<int> main() async {
errorFilter = (AnalysisError error) {
return error.errorCode == StaticWarningCode.UNDEFINED_IDENTIFIER_AWAIT;
};
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:async';
foo() {}
Future<int> main() {
@@ -572,7 +572,7 @@ Future<int> main() async {
errorFilter = (AnalysisError error) {
return error.errorCode == StaticWarningCode.UNDEFINED_IDENTIFIER_AWAIT;
};
- resolveTestUnit('''
+ await resolveTestUnit('''
foo() {}
dynamic main() {
await foo();
@@ -594,7 +594,7 @@ dynamic main() async {
errorFilter = (AnalysisError error) {
return error.errorCode == StaticWarningCode.UNDEFINED_IDENTIFIER_AWAIT;
};
- resolveTestUnit('''
+ await resolveTestUnit('''
foo() {}
main() {
await foo();
@@ -613,7 +613,7 @@ main() async {
}
test_boolean() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
boolean v;
}
@@ -628,7 +628,7 @@ main() {
}
test_canBeNullAfterNullAware_chain() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(x) {
x?.a.b.c;
}
@@ -643,7 +643,7 @@ main(x) {
}
test_canBeNullAfterNullAware_methodInvocation() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(x) {
x?.a.b();
}
@@ -658,7 +658,7 @@ main(x) {
}
test_canBeNullAfterNullAware_propertyAccess() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(x) {
x?.a().b;
}
@@ -673,7 +673,7 @@ main(x) {
}
test_changeToStaticAccess_method() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
static foo() {}
}
@@ -709,7 +709,7 @@ library libB;
import 'libA.dart';
class B extends A {}
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'libB.dart';
main(B b) {
b.foo();
@@ -727,7 +727,7 @@ main(B b) {
}
test_changeToStaticAccess_method_prefixLibrary() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:async' as pref;
main(pref.Future f) {
f.wait([]);
@@ -744,7 +744,7 @@ main(pref.Future f) {
}
test_changeToStaticAccess_property() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
static get foo => 42;
}
@@ -780,7 +780,7 @@ library libB;
import 'libA.dart';
class B extends A {}
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'libB.dart';
main(B b) {
b.foo;
@@ -798,7 +798,7 @@ main(B b) {
}
test_changeTypeAnnotation_BAD_multipleVariables() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
String a, b = 42;
}
@@ -807,7 +807,7 @@ main() {
}
test_changeTypeAnnotation_BAD_notVariableDeclaration() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
String v;
v = 42;
@@ -817,7 +817,7 @@ main() {
}
test_changeTypeAnnotation_OK_generic() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
String v = <int>[];
}
@@ -832,7 +832,7 @@ main() {
}
test_changeTypeAnnotation_OK_simple() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
String v = 'abc'.length;
}
@@ -847,7 +847,7 @@ main() {
}
test_createClass() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
Test v = null;
}
@@ -866,7 +866,7 @@ class Test {
}
test_createClass_BAD_hasUnresolvedPrefix() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
prefix.Test v = null;
}
@@ -881,7 +881,7 @@ library my.lib;
class A {}
''';
addSource('/lib.dart', libCode);
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'lib.dart' as lib;
main() {
@@ -911,7 +911,7 @@ class Test {
}
test_createClass_innerLocalFunction() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
f() {
g() {
Test v = null;
@@ -934,7 +934,7 @@ class Test {
}
test_createClass_itemOfList() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
var a = [Test];
}
@@ -956,7 +956,7 @@ class Test {
errorFilter = (AnalysisError error) {
return error.errorCode == StaticWarningCode.UNDEFINED_IDENTIFIER;
};
- resolveTestUnit('''
+ await resolveTestUnit('''
class MyAnnotation {
const MyAnnotation(a, b);
}
@@ -982,7 +982,7 @@ class Test {
errorFilter = (AnalysisError error) {
return error.message.contains("'a'");
};
- resolveTestUnit('''
+ await resolveTestUnit('''
class Test {
final int a;
final int b = 2;
@@ -1003,7 +1003,7 @@ class Test {
}
test_createConstructor_insteadOfSyntheticDefault() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
int field;
@@ -1030,7 +1030,7 @@ main() {
}
test_createConstructor_named() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
method() {}
}
@@ -1054,7 +1054,7 @@ main() {
}
test_createConstructor_named_emptyClassBody() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {}
main() {
new A.named(1);
@@ -1074,7 +1074,7 @@ main() {
}
test_createConstructorForFinalFields_inTopLevelMethod() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
final int v;
}
@@ -1083,14 +1083,14 @@ main() {
}
test_createConstructorForFinalFields_topLevelField() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
final int v;
''');
await assertNoFix(DartFixKind.CREATE_CONSTRUCTOR_FOR_FINAL_FIELDS);
}
test_createConstructorSuperExplicit() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
A(bool p1, int p2, double p3, String p4, {p5});
}
@@ -1111,7 +1111,7 @@ class B extends A {
}
test_createConstructorSuperExplicit_hasInitializers() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
A(int p);
}
@@ -1134,7 +1134,7 @@ class B extends A {
}
test_createConstructorSuperExplicit_named() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
A.named(int p);
}
@@ -1155,7 +1155,7 @@ class B extends A {
}
test_createConstructorSuperExplicit_named_private() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
A._named(int p);
}
@@ -1167,7 +1167,7 @@ class B extends A {
}
test_createConstructorSuperExplicit_typeArgument() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A<T> {
A(T p);
}
@@ -1188,7 +1188,7 @@ class B extends A<int> {
}
test_createConstructorSuperImplicit() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
A(p1, int p2, List<String> p3, [int p4]);
}
@@ -1215,7 +1215,7 @@ class B extends A {
}
test_createConstructorSuperImplicit_fieldInitializer() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
int _field;
A(this._field);
@@ -1259,7 +1259,7 @@ class B {
B(A a);
}
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'libB.dart';
class C extends B {
}
@@ -1276,7 +1276,7 @@ class C extends B {
}
test_createConstructorSuperImplicit_named() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
A.named(p1, int p2);
}
@@ -1303,7 +1303,7 @@ class B extends A {
}
test_createConstructorSuperImplicit_private() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
A._named(p);
}
@@ -1314,7 +1314,7 @@ class B extends A {
}
test_createConstructorSuperImplicit_typeArgument() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class C<T> {
final T x;
C(this.x);
@@ -1334,7 +1334,7 @@ class D extends C<int> {
}
test_createField_BAD_inEnum() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
enum MyEnum {
AAA, BBB
}
@@ -1346,7 +1346,7 @@ main() {
}
test_createField_BAD_inSDK() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(List p) {
p.foo = 1;
}
@@ -1355,7 +1355,7 @@ main(List p) {
}
test_createField_getter_multiLevel() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
}
class B {
@@ -1387,7 +1387,7 @@ main(C c) {
}
test_createField_getter_qualified_instance() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
}
main(A a) {
@@ -1407,7 +1407,7 @@ main(A a) {
}
test_createField_getter_qualified_instance_dynamicType() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
B b;
void f(Object p) {
@@ -1433,7 +1433,7 @@ class B {
}
test_createField_getter_qualified_propagatedType() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
A get self => this;
}
@@ -1458,7 +1458,7 @@ main() {
}
test_createField_getter_unqualified_instance_asInvocationArgument() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
main() {
f(test);
@@ -1481,7 +1481,7 @@ f(String s) {}
}
test_createField_getter_unqualified_instance_assignmentRhs() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
main() {
int v = test;
@@ -1502,7 +1502,7 @@ class A {
}
test_createField_getter_unqualified_instance_asStatement() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
main() {
test;
@@ -1523,7 +1523,7 @@ class A {
}
test_createField_hint() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
}
main(A a) {
@@ -1545,7 +1545,7 @@ main(A a) {
}
test_createField_hint_setter() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
}
main(A a) {
@@ -1580,7 +1580,7 @@ library libB;
import 'libA.dart';
A getA() => null;
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'libB.dart';
class C {
}
@@ -1603,7 +1603,7 @@ main(C c) {
}
test_createField_setter_generic_BAD() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
}
class B<T> {
@@ -1629,7 +1629,7 @@ class B<T> {
}
test_createField_setter_generic_OK_local() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A<T> {
List<T> items;
@@ -1654,7 +1654,7 @@ class A<T> {
}
test_createField_setter_qualified_instance_hasField() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
int aaa;
int zzz;
@@ -1683,7 +1683,7 @@ main(A a) {
}
test_createField_setter_qualified_instance_hasMethod() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
existingMethod() {}
}
@@ -1706,7 +1706,7 @@ main(A a) {
}
test_createField_setter_qualified_static() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
}
main() {
@@ -1726,7 +1726,7 @@ main() {
}
test_createField_setter_unqualified_instance() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
main() {
test = 5;
@@ -1747,7 +1747,7 @@ class A {
}
test_createField_setter_unqualified_static() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
static main() {
test = 5;
@@ -1769,7 +1769,7 @@ class A {
test_createFile_forImport() async {
testFile = '/my/project/bin/test.dart';
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'my_file.dart';
''');
AnalysisError error = _findErrorToFix();
@@ -1788,7 +1788,7 @@ import 'my_file.dart';
test_createFile_forImport_BAD_inPackage_lib_justLib() async {
provider.newFile('/projects/my_package/pubspec.yaml', 'name: my_package');
testFile = '/projects/my_package/test.dart';
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'lib';
''');
await assertNoFix(DartFixKind.CREATE_FILE);
@@ -1796,7 +1796,7 @@ import 'lib';
test_createFile_forImport_BAD_notDart() async {
testFile = '/my/project/bin/test.dart';
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'my_file.txt';
''');
await assertNoFix(DartFixKind.CREATE_FILE);
@@ -1806,7 +1806,7 @@ import 'my_file.txt';
provider.newFile('/projects/my_package/pubspec.yaml', 'name: my_package');
testFile = '/projects/my_package/lib/test.dart';
provider.newFolder('/projects/my_package/lib');
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'a/bb/c_cc/my_lib.dart';
''');
AnalysisError error = _findErrorToFix();
@@ -1826,7 +1826,7 @@ import 'a/bb/c_cc/my_lib.dart';
test_createFile_forImport_inPackage_test() async {
provider.newFile('/projects/my_package/pubspec.yaml', 'name: my_package');
testFile = '/projects/my_package/test/misc/test_all.dart';
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'a/bb/my_lib.dart';
''');
AnalysisError error = _findErrorToFix();
@@ -1845,7 +1845,7 @@ import 'a/bb/my_lib.dart';
test_createFile_forPart() async {
testFile = '/my/project/bin/test.dart';
- resolveTestUnit('''
+ await resolveTestUnit('''
library my.lib;
part 'my_part.dart';
''');
@@ -1882,7 +1882,7 @@ part 'my_part.dart';
context.sourceFactory = new SourceFactory(
[AbstractContextTest.SDK_RESOLVER, pkgResolver, resourceResolver]);
// prepare fix
- testUnit = resolveLibraryUnit(testSource);
+ testUnit = await resolveLibraryUnit(testSource);
AnalysisError error = _findErrorToFix();
fix = await _assertHasFix(DartFixKind.CREATE_FILE, error);
change = fix.change;
@@ -1897,7 +1897,7 @@ part 'my_part.dart';
}
test_createGetter_BAD_inSDK() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(List p) {
int v = p.foo;
}
@@ -1906,7 +1906,7 @@ main(List p) {
}
test_createGetter_hint_getter() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
}
main(A a) {
@@ -1928,7 +1928,7 @@ main(A a) {
}
test_createGetter_location_afterLastGetter() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
int existingField;
@@ -1959,7 +1959,7 @@ main(A a) {
}
test_createGetter_multiLevel() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
}
class B {
@@ -1991,7 +1991,7 @@ main(C c) {
}
test_createGetter_qualified_instance() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
}
main(A a) {
@@ -2011,7 +2011,7 @@ main(A a) {
}
test_createGetter_qualified_instance_dynamicType() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
B b;
void f(Object p) {
@@ -2037,7 +2037,7 @@ class B {
}
test_createGetter_qualified_propagatedType() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
A get self => this;
}
@@ -2062,7 +2062,7 @@ main() {
}
test_createGetter_setterContext() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
}
main(A a) {
@@ -2073,7 +2073,7 @@ main(A a) {
}
test_createGetter_unqualified_instance_asInvocationArgument() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
main() {
f(test);
@@ -2096,7 +2096,7 @@ f(String s) {}
}
test_createGetter_unqualified_instance_assignmentLhs() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
main() {
test = 42;
@@ -2107,7 +2107,7 @@ class A {
}
test_createGetter_unqualified_instance_assignmentRhs() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
main() {
int v = test;
@@ -2128,7 +2128,7 @@ class A {
}
test_createGetter_unqualified_instance_asStatement() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
main() {
test;
@@ -2149,7 +2149,7 @@ class A {
}
test_createLocalVariable_functionType_named() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
typedef MY_FUNCTION(int p);
foo(MY_FUNCTION f) {}
main() {
@@ -2169,7 +2169,7 @@ main() {
}
test_createLocalVariable_functionType_synthetic() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
foo(f(int p)) {}
main() {
foo(bar);
@@ -2179,7 +2179,7 @@ main() {
}
test_createLocalVariable_read_typeAssignment() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
int a = test;
}
@@ -2195,7 +2195,7 @@ main() {
}
test_createLocalVariable_read_typeCondition() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
if (!test) {
print(42);
@@ -2215,7 +2215,7 @@ main() {
}
test_createLocalVariable_read_typeInvocationArgument() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
f(test);
}
@@ -2235,7 +2235,7 @@ f(String p) {}
}
test_createLocalVariable_read_typeInvocationTarget() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
test.add('hello');
}
@@ -2252,7 +2252,7 @@ main() {
}
test_createLocalVariable_write_assignment() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
test = 42;
}
@@ -2267,7 +2267,7 @@ main() {
}
test_createLocalVariable_write_assignment_compound() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
test += 42;
}
@@ -2283,7 +2283,7 @@ main() {
}
test_createMissingMethodCall() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class C implements Function {
}
''');
@@ -2299,7 +2299,7 @@ class C implements Function {
}
test_createMissingOverrides_field_untyped() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
var f;
}
@@ -2322,7 +2322,7 @@ class B implements A {
}
test_createMissingOverrides_functionTypeAlias() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
typedef int Binary(int left, int right);
abstract class Emulator {
@@ -2351,7 +2351,7 @@ class MyEmulator extends Emulator {
}
test_createMissingOverrides_functionTypedParameter() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
abstract class A {
forEach(int f(double p1, String p2));
}
@@ -2376,7 +2376,7 @@ class B extends A {
}
test_createMissingOverrides_generics_typeArguments() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class Iterator<T> {
}
@@ -2406,7 +2406,7 @@ class Test extends IterableMixin<int> {
}
test_createMissingOverrides_generics_typeParameters() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
abstract class ItemProvider<T> {
List<T> getItems();
}
@@ -2431,7 +2431,7 @@ class Test<V> extends ItemProvider<V> {
}
test_createMissingOverrides_getter() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
abstract class A {
get g1;
int get g2;
@@ -2461,7 +2461,7 @@ class B extends A {
}
test_createMissingOverrides_importPrefix() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:async' as aaa;
abstract class A {
Map<aaa.Future, List<aaa.Future>> g(aaa.Future p);
@@ -2488,7 +2488,7 @@ class B extends A {
}
test_createMissingOverrides_mergeToField_getterSetter() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
int ma;
void mb() {}
@@ -2523,7 +2523,7 @@ class B implements A {
}
test_createMissingOverrides_method() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
abstract class A {
m1();
int m2();
@@ -2596,7 +2596,7 @@ class B extends A {
}
test_createMissingOverrides_method_emptyClassBody() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
abstract class A {
void foo();
}
@@ -2620,7 +2620,7 @@ class B extends A {
}
test_createMissingOverrides_method_generic() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class C<T> {}
class V<E> {}
@@ -2651,7 +2651,7 @@ class B implements A {
}
test_createMissingOverrides_operator() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
abstract class A {
int operator [](int index);
void operator []=(int index, String value);
@@ -2683,7 +2683,7 @@ class B extends A {
}
test_createMissingOverrides_setter() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
abstract class A {
set s1(x);
set s2(int x);
@@ -2722,7 +2722,7 @@ class B extends A {
}
test_createNoSuchMethod() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
abstract class A {
m1();
int m2();
@@ -2749,7 +2749,7 @@ class B extends A {
}
test_creationFunction_forFunctionType_cascadeSecond() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
B ma() => null;
}
@@ -2783,7 +2783,7 @@ int test(double a, String b) {
}
test_creationFunction_forFunctionType_coreFunction() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
useFunction(g: test);
}
@@ -2803,7 +2803,7 @@ test() {
}
test_creationFunction_forFunctionType_dynamicArgument() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
useFunction(test);
}
@@ -2823,7 +2823,7 @@ int test(a, b) {
}
test_creationFunction_forFunctionType_function() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
useFunction(test);
}
@@ -2843,7 +2843,7 @@ int test(double a, String b) {
}
test_creationFunction_forFunctionType_function_namedArgument() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
useFunction(g: test);
}
@@ -2876,7 +2876,7 @@ library libB;
import 'libA.dart';
useFunction(int g(A a)) {}
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'libB.dart';
main() {
useFunction(test);
@@ -2897,7 +2897,7 @@ int test(A a) {
}
test_creationFunction_forFunctionType_method_enclosingClass_static() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
static foo() {
useFunction(test);
@@ -2921,7 +2921,7 @@ useFunction(int g(double a, String b)) {}
}
test_creationFunction_forFunctionType_method_enclosingClass_static2() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
var f;
A() : f = useFunction(test);
@@ -2943,7 +2943,7 @@ useFunction(int g(double a, String b)) {}
}
test_creationFunction_forFunctionType_method_targetClass() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(A a) {
useFunction(a.test);
}
@@ -2966,7 +2966,7 @@ useFunction(int g(double a, String b)) {}
}
test_creationFunction_forFunctionType_method_targetClass_hasOtherMember() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(A a) {
useFunction(a.test);
}
@@ -2992,7 +2992,7 @@ useFunction(int g(double a, String b)) {}
}
test_creationFunction_forFunctionType_notFunctionType() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(A a) {
useFunction(a.test);
}
@@ -3004,7 +3004,7 @@ useFunction(g) {}
}
test_creationFunction_forFunctionType_unknownTarget() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(A a) {
useFunction(a.test);
}
@@ -3016,7 +3016,7 @@ useFunction(g) {}
}
test_expectedToken_semicolon() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
print(0)
}
@@ -3034,7 +3034,7 @@ main() {
errorFilter = (AnalysisError error) {
return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE;
};
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:async';
var v;int main() async => 0;
''');
@@ -3050,7 +3050,7 @@ var v;Future<int> main() async => 0;
errorFilter = (AnalysisError error) {
return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE;
};
- resolveTestUnit('''
+ await resolveTestUnit('''
library main;
int main() async {
}
@@ -3070,7 +3070,7 @@ Future<int> main() async {
errorFilter = (AnalysisError error) {
return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE;
};
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:async' as al;
int main() async {
}
@@ -3088,7 +3088,7 @@ al.Future<int> main() async {
errorFilter = (AnalysisError error) {
return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE;
};
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:async';
List<int> main() async {
}
@@ -3106,7 +3106,7 @@ Future<List<int>> main() async {
errorFilter = (AnalysisError error) {
return error.errorCode == StaticTypeWarningCode.ILLEGAL_ASYNC_RETURN_TYPE;
};
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:async';
void main() async {
}
@@ -3122,7 +3122,7 @@ Future main() async {
test_importLibraryPackage_preferDirectOverExport() async {
_configureMyPkg({'b.dart': 'class Test {}', 'a.dart': "export 'b.dart';"});
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
Test test = null;
}
@@ -3151,7 +3151,7 @@ main() {
test_importLibraryPackage_preferDirectOverExport_src() async {
myPkgLibPath = '/my/src/packages/my_pkg/lib';
_configureMyPkg({'b.dart': 'class Test {}', 'a.dart': "export 'b.dart';"});
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
Test test = null;
}
@@ -3180,7 +3180,7 @@ main() {
test_importLibraryPackage_preferPublicOverPrivate() async {
_configureMyPkg(
{'src/a.dart': 'class Test {}', 'b.dart': "export 'src/a.dart';"});
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
Test test = null;
}
@@ -3215,7 +3215,7 @@ class Test {
const Test(int p);
}
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
@Test(0)
main() {
}
@@ -3240,7 +3240,7 @@ class Test {
const Test();
}
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
const Test();
}
@@ -3272,7 +3272,7 @@ library b;
class One {}
class Two {}
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'b.dart' show Two;
main () {
new Two();
@@ -3300,7 +3300,7 @@ main () {
library lib;
class Test {}
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
Test t = null;
}
@@ -3325,7 +3325,7 @@ main() {
library lib;
class Test {}
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
Test t = null;
}
@@ -3350,7 +3350,7 @@ main() {
library lib;
class Test {}
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
Test t = null;
}
@@ -3374,7 +3374,7 @@ main() {
library lib;
myFunction() {}
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
myFunction();
}
@@ -3398,7 +3398,7 @@ main() {
library lib;
myFunction() {}
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
main() {
myFunction();
@@ -3427,7 +3427,7 @@ class A {
library lib;
typedef MyFunction();
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
MyFunction t = null;
}
@@ -3451,7 +3451,7 @@ main() {
library lib;
int MY_VAR = 42;
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
print(MY_VAR);
}
@@ -3469,7 +3469,7 @@ main() {
}
test_importLibrarySdk_withClass_AsExpression() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(p) {
p as Future;
}
@@ -3486,7 +3486,7 @@ main(p) {
}
test_importLibrarySdk_withClass_invocationTarget() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
Future.wait(null);
}
@@ -3503,7 +3503,7 @@ main() {
}
test_importLibrarySdk_withClass_IsExpression() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(p) {
p is Future;
}
@@ -3520,7 +3520,7 @@ main(p) {
}
test_importLibrarySdk_withClass_itemOfList() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
var a = [Future];
}
@@ -3541,7 +3541,7 @@ main() {
errorFilter = (AnalysisError error) {
return error.errorCode == StaticWarningCode.UNDEFINED_IDENTIFIER;
};
- resolveTestUnit('''
+ await resolveTestUnit('''
class MyAnnotation {
const MyAnnotation(a, b);
}
@@ -3562,7 +3562,7 @@ main() {}
}
test_importLibrarySdk_withClass_typeAnnotation() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
Future f = null;
}
@@ -3579,7 +3579,7 @@ main() {
}
test_importLibrarySdk_withClass_typeAnnotation_PrefixedIdentifier() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
Future.wait;
}
@@ -3596,7 +3596,7 @@ main() {
}
test_importLibrarySdk_withClass_typeArgument() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
List<Future> futures = [];
}
@@ -3613,7 +3613,7 @@ main() {
}
test_importLibrarySdk_withTopLevelVariable() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
print(PI);
}
@@ -3631,7 +3631,7 @@ main() {
}
test_importLibrarySdk_withTopLevelVariable_annotation() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
@PI
main() {
}
@@ -3656,7 +3656,7 @@ main() {
class A {}
class B {}
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'lib.dart' show A;
main() {
A a;
@@ -3677,7 +3677,7 @@ main() {
}
test_importLibraryShow_sdk() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:async' show Stream;
main() {
Stream s = null;
@@ -3697,7 +3697,7 @@ main() {
}
test_isNotNull() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(p) {
p is! Null;
}
@@ -3712,7 +3712,7 @@ main(p) {
}
test_isNull() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(p) {
p is Null;
}
@@ -3727,7 +3727,7 @@ main(p) {
}
test_makeEnclosingClassAbstract_declaresAbstractMethod() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
m();
}
@@ -3742,7 +3742,7 @@ abstract class A {
}
test_makeEnclosingClassAbstract_inheritsAbstractMethod() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
abstract class A {
m();
}
@@ -3761,7 +3761,7 @@ abstract class B extends A {
}
test_makeFieldNotFinal_hasType() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
final int fff = 1;
main() {
@@ -3782,7 +3782,7 @@ class A {
}
test_makeFieldNotFinal_noType() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
final fff = 1;
main() {
@@ -3803,7 +3803,7 @@ class A {
}
test_noException_1() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(p) {
p i s Null;
}''');
@@ -3814,7 +3814,7 @@ main(p) {
}
test_nonBoolCondition_addNotNull() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(String p) {
if (p) {
print(p);
@@ -3833,7 +3833,7 @@ main(String p) {
}
test_removeDeadCode_condition() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(int p) {
if (true || p > 5) {
print(1);
@@ -3852,7 +3852,7 @@ main(int p) {
}
test_removeDeadCode_statements_one() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
int main() {
print(0);
return 42;
@@ -3870,7 +3870,7 @@ int main() {
}
test_removeDeadCode_statements_two() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
int main() {
print(0);
return 42;
@@ -3889,7 +3889,7 @@ int main() {
}
test_removeParentheses_inGetterDeclaration() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
int get foo() => 0;
}
@@ -3904,7 +3904,7 @@ class A {
}
test_removeParentheses_inGetterInvocation() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
int get foo => 0;
}
@@ -3925,7 +3925,7 @@ main(A a) {
}
test_removeUnnecessaryCast_assignment() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(Object p) {
if (p is String) {
String v = ((p as String));
@@ -3945,7 +3945,7 @@ main(Object p) {
test_removeUnusedCatchClause() async {
errorFilter = (AnalysisError error) => true;
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
try {
throw 42;
@@ -3967,7 +3967,7 @@ main() {
test_removeUnusedCatchStack() async {
errorFilter = (AnalysisError error) => true;
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
try {
throw 42;
@@ -3988,7 +3988,7 @@ main() {
}
test_removeUnusedImport() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:math';
main() {
}
@@ -4002,7 +4002,7 @@ main() {
}
test_removeUnusedImport_anotherImportOnLine() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:math'; import 'dart:async';
main() {
@@ -4021,7 +4021,7 @@ main() {
}
test_removeUnusedImport_severalLines() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
import
'dart:math';
main() {
@@ -4038,7 +4038,7 @@ main() {
test_replaceImportUri_inProject() async {
testFile = '/project/bin/test.dart';
addSource('/project/foo/bar/lib.dart', '');
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'no/matter/lib.dart';
''');
performAllAnalysisTasks();
@@ -4051,7 +4051,7 @@ import '../foo/bar/lib.dart';
test_replaceImportUri_package() async {
_configureMyPkg({'my_lib.dart': ''});
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'no/matter/my_lib.dart';
''');
performAllAnalysisTasks();
@@ -4066,7 +4066,7 @@ import 'package:my_pkg/my_lib.dart';
errorFilter = (AnalysisError error) {
return error.errorCode == ParserErrorCode.VAR_AS_TYPE_NAME;
};
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
Map<String, var> m;
}
@@ -4081,7 +4081,7 @@ class A {
}
test_replaceWithConstInstanceCreation() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
const A();
}
@@ -4098,7 +4098,7 @@ const a = const A();
}
test_undefinedClass_useSimilar_BAD_prefixed() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:async' as c;
main() {
c.Fture v = null;
@@ -4115,7 +4115,7 @@ main() {
}
test_undefinedClass_useSimilar_fromImport() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
Stirng s = 'abc';
}
@@ -4130,7 +4130,7 @@ main() {
}
test_undefinedClass_useSimilar_fromThisLibrary() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class MyClass {}
main() {
MyCalss v = null;
@@ -4147,7 +4147,7 @@ main() {
}
test_undefinedFunction_create_duplicateArgumentNames() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class C {
int x;
}
@@ -4173,7 +4173,7 @@ void bar(int x, int x2) {
}
test_undefinedFunction_create_dynamicArgument() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
dynamic v;
test(v);
@@ -4193,7 +4193,7 @@ void test(v) {
}
test_undefinedFunction_create_dynamicReturnType() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
dynamic v = test();
}
@@ -4211,7 +4211,7 @@ test() {
}
test_undefinedFunction_create_fromFunction() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
int v = myUndefinedFunction(1, 2.0, '3');
}
@@ -4229,7 +4229,7 @@ int myUndefinedFunction(int i, double d, String s) {
}
test_undefinedFunction_create_fromMethod() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
main() {
int v = myUndefinedFunction(1, 2.0, '3');
@@ -4251,7 +4251,7 @@ int myUndefinedFunction(int i, double d, String s) {
}
test_undefinedFunction_create_generic_BAD() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A<T> {
Map<int, T> items;
main() {
@@ -4275,7 +4275,7 @@ void process(Map items) {
}
test_undefinedFunction_create_generic_OK() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
List<int> items;
main() {
@@ -4315,7 +4315,7 @@ library lib;
import 'dart:async';
Future getFuture() => null;
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'lib.dart';
main() {
test(getFuture());
@@ -4336,7 +4336,7 @@ void test(Future future) {
}
test_undefinedFunction_create_nullArgument() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
test(null);
}
@@ -4371,7 +4371,7 @@ void test(arg0) {
}
test_undefinedFunction_create_returnType_fromAssignment_eq() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
int v;
v = myUndefinedFunction();
@@ -4391,7 +4391,7 @@ int myUndefinedFunction() {
}
test_undefinedFunction_create_returnType_fromAssignment_plusEq() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
int v;
v += myUndefinedFunction();
@@ -4411,7 +4411,7 @@ num myUndefinedFunction() {
}
test_undefinedFunction_create_returnType_fromBinary_right() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
0 + myUndefinedFunction();
}
@@ -4429,7 +4429,7 @@ num myUndefinedFunction() {
}
test_undefinedFunction_create_returnType_fromInitializer() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
int v = myUndefinedFunction();
}
@@ -4447,7 +4447,7 @@ int myUndefinedFunction() {
}
test_undefinedFunction_create_returnType_fromInvocationArgument() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
foo(int p) {}
main() {
foo( myUndefinedFunction() );
@@ -4467,7 +4467,7 @@ int myUndefinedFunction() {
}
test_undefinedFunction_create_returnType_fromReturn() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
int main() {
return myUndefinedFunction();
}
@@ -4485,7 +4485,7 @@ int myUndefinedFunction() {
}
test_undefinedFunction_create_returnType_void() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
myUndefinedFunction();
}
@@ -4503,7 +4503,7 @@ void myUndefinedFunction() {
}
test_undefinedFunction_useSimilar_fromImport() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
pritn(0);
}
@@ -4518,7 +4518,7 @@ main() {
}
test_undefinedFunction_useSimilar_prefixed_fromImport() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:core' as c;
main() {
c.prnt(42);
@@ -4535,7 +4535,7 @@ main() {
}
test_undefinedFunction_useSimilar_prefixed_ignoreLocal() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:async' as c;
main() {
c.main();
@@ -4545,7 +4545,7 @@ main() {
}
test_undefinedFunction_useSimilar_thisLibrary() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
myFunction() {}
main() {
myFuntcion();
@@ -4562,7 +4562,7 @@ main() {
}
test_undefinedGetter_useSimilar_hint() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
int myField;
}
@@ -4585,7 +4585,7 @@ main(A a) {
}
test_undefinedGetter_useSimilar_qualified() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
int myField;
}
@@ -4606,7 +4606,7 @@ main(A a) {
}
test_undefinedGetter_useSimilar_qualified_static() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
static int MY_NAME = 1;
}
@@ -4627,7 +4627,7 @@ main() {
}
test_undefinedGetter_useSimilar_unqualified() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
int myField;
main() {
@@ -4648,7 +4648,7 @@ class A {
}
test_undefinedMethod_create_BAD_inSDK() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
List.foo();
}
@@ -4657,7 +4657,7 @@ main() {
}
test_undefinedMethod_create_BAD_targetIsEnum() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
enum MyEnum {A, B}
main() {
MyEnum.foo();
@@ -4667,7 +4667,7 @@ main() {
}
test_undefinedMethod_create_generic_BAD_argumentType() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A<T> {
B b;
Map<int, T> items;
@@ -4697,7 +4697,7 @@ class B {
}
test_undefinedMethod_create_generic_BAD_returnType() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A<T> {
main() {
T t = new B().compute();
@@ -4723,7 +4723,7 @@ class B {
}
test_undefinedMethod_create_generic_OK_literal() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
B b;
List<int> items;
@@ -4752,7 +4752,7 @@ class B {
}
test_undefinedMethod_create_generic_OK_local() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A<T> {
List<T> items;
main() {
@@ -4775,7 +4775,7 @@ class A<T> {
}
test_undefinedMethod_createQualified_emptyClassBody() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {}
main() {
A.myUndefinedMethod();
@@ -4794,7 +4794,7 @@ main() {
}
test_undefinedMethod_createQualified_fromClass() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
}
main() {
@@ -4814,7 +4814,7 @@ main() {
}
test_undefinedMethod_createQualified_fromClass_hasOtherMember() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
foo() {}
}
@@ -4837,7 +4837,7 @@ main() {
}
test_undefinedMethod_createQualified_fromInstance() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
}
main(A a) {
@@ -4857,7 +4857,7 @@ main(A a) {
}
test_undefinedMethod_createQualified_targetIsFunctionType() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
typedef A();
main() {
A.myUndefinedMethod();
@@ -4867,7 +4867,7 @@ main() {
}
test_undefinedMethod_createQualified_targetIsUnresolved() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
NoSuchClass.myUndefinedMethod();
}
@@ -4876,7 +4876,7 @@ main() {
}
test_undefinedMethod_createUnqualified_duplicateArgumentNames() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class C {
int x;
}
@@ -4903,7 +4903,7 @@ class D {
}
test_undefinedMethod_createUnqualified_parameters() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
main() {
myUndefinedMethod(0, 1.0, '3');
@@ -4948,7 +4948,7 @@ class A {
}
test_undefinedMethod_createUnqualified_parameters_named() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
main() {
myUndefinedMethod(0, bbb: 1.0, ccc: '2');
@@ -4991,7 +4991,7 @@ class A {
}
test_undefinedMethod_createUnqualified_returnType() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
main() {
int v = myUndefinedMethod();
@@ -5016,7 +5016,7 @@ class A {
}
test_undefinedMethod_createUnqualified_staticFromField() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
static var f = myUndefinedMethod();
}
@@ -5033,7 +5033,7 @@ class A {
}
test_undefinedMethod_createUnqualified_staticFromMethod() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
static main() {
myUndefinedMethod();
@@ -5054,7 +5054,7 @@ class A {
}
test_undefinedMethod_hint_createQualified_fromInstance() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
}
main() {
@@ -5090,7 +5090,7 @@ class D {
library test3;
class E {}
''');
- resolveTestUnit('''
+ await resolveTestUnit('''
library test;
import 'test2.dart' as aaa;
main(aaa.D d, aaa.E e) {
@@ -5125,7 +5125,7 @@ class D {
class E {}
''';
addSource('/test2.dart', code2);
- resolveTestUnit('''
+ await resolveTestUnit('''
library test;
import 'test2.dart' as test2;
main(test2.D d, test2.E e) {
@@ -5152,7 +5152,7 @@ class E {}
}
test_undefinedMethod_useSimilar_ignoreOperators() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main(Object object) {
object.then();
}
@@ -5161,7 +5161,7 @@ main(Object object) {
}
test_undefinedMethod_useSimilar_qualified() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
myMethod() {}
}
@@ -5184,7 +5184,7 @@ main() {
}
test_undefinedMethod_useSimilar_unqualified_superClass() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
myMethod() {}
}
@@ -5209,7 +5209,7 @@ class B extends A {
}
test_undefinedMethod_useSimilar_unqualified_thisClass() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
myMethod() {}
main() {
@@ -5230,7 +5230,7 @@ class A {
}
test_undefinedSetter_useSimilar_hint() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
int myField;
}
@@ -5253,7 +5253,7 @@ main(A a) {
}
test_undefinedSetter_useSimilar_qualified() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
int myField;
}
@@ -5274,7 +5274,7 @@ main(A a) {
}
test_undefinedSetter_useSimilar_unqualified() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
class A {
int myField;
main() {
@@ -5295,7 +5295,7 @@ class A {
}
test_useEffectiveIntegerDivision() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
main() {
var a = 5;
var b = 2;
@@ -5314,7 +5314,7 @@ main() {
}
test_useImportPrefix_withClass() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:async' as pref;
main() {
pref.Stream s = null;
@@ -5333,7 +5333,7 @@ main() {
}
test_useImportPrefix_withTopLevelVariable() async {
- resolveTestUnit('''
+ await resolveTestUnit('''
import 'dart:math' as pref;
main() {
print(pref.E);
@@ -5365,9 +5365,9 @@ class LintFixTest extends BaseFixProcessorTest {
resultCode = SourceEdit.applySequence(testCode, change.edits[0].edits);
}
- void findLint(String src, String lintCode, {int length: 1}) {
+ Future<Null> findLint(String src, String lintCode, {int length: 1}) async {
int errorOffset = src.indexOf('/*LINT*/');
- resolveTestUnit(src.replaceAll('/*LINT*/', ''));
+ await resolveTestUnit(src.replaceAll('/*LINT*/', ''));
error = new AnalysisError(
resolutionMap.elementDeclaredByCompilationUnit(testUnit).source,
errorOffset,
@@ -5384,7 +5384,7 @@ class Sub extends Test {
int /*LINT*/t = 42;
}
''';
- findLint(src, LintNames.annotate_overrides);
+ await findLint(src, LintNames.annotate_overrides);
await applyFix(DartFixKind.LINT_ADD_OVERRIDE);
@@ -5408,7 +5408,7 @@ class Sub extends Test {
int get /*LINT*/t => null;
}
''';
- findLint(src, LintNames.annotate_overrides);
+ await findLint(src, LintNames.annotate_overrides);
await applyFix(DartFixKind.LINT_ADD_OVERRIDE);
@@ -5432,7 +5432,7 @@ class Sub extends Test {
void /*LINT*/t() { }
}
''';
- findLint(src, LintNames.annotate_overrides);
+ await findLint(src, LintNames.annotate_overrides);
await applyFix(DartFixKind.LINT_ADD_OVERRIDE);
@@ -5457,7 +5457,7 @@ class Sub extends Test {
void /*LINT*/t() { }
}
''';
- findLint(src, LintNames.annotate_overrides);
+ await findLint(src, LintNames.annotate_overrides);
await applyFix(DartFixKind.LINT_ADD_OVERRIDE);
@@ -5485,7 +5485,7 @@ class Sub extends Test {
void /*LINT*/t() { }
}
''';
- findLint(src, LintNames.annotate_overrides);
+ await findLint(src, LintNames.annotate_overrides);
await applyFix(DartFixKind.LINT_ADD_OVERRIDE);
@@ -5514,7 +5514,7 @@ class Sub extends Test {
void /*LINT*/t() { }
}
''';
- findLint(src, LintNames.annotate_overrides);
+ await findLint(src, LintNames.annotate_overrides);
await applyFix(DartFixKind.LINT_ADD_OVERRIDE);
@@ -5541,7 +5541,7 @@ class Sub extends Test {
void /*LINT*/t() { }
}
''';
- findLint(src, LintNames.annotate_overrides);
+ await findLint(src, LintNames.annotate_overrides);
await applyFix(DartFixKind.LINT_ADD_OVERRIDE);
@@ -5564,7 +5564,8 @@ main() {
print('v: /*LINT*/${ v}');
}
''';
- findLint(src, LintNames.unnecessary_brace_in_string_interp, length: 4);
+ await findLint(src, LintNames.unnecessary_brace_in_string_interp,
+ length: 4);
await applyFix(DartFixKind.LINT_REMOVE_INTERPOLATION_BRACES);
verifyResult(r'''
main() {

Powered by Google App Engine
This is Rietveld 408576698