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

Unified Diff: pkg/analyzer/test/generated/non_error_resolver_test.dart

Issue 2624793002: Make error producing tests ansynchronous. (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/analyzer/test/generated/non_error_resolver_test.dart
diff --git a/pkg/analyzer/test/generated/non_error_resolver_test.dart b/pkg/analyzer/test/generated/non_error_resolver_test.dart
index 793cb792ba5b9d06fa52a04cb7980441c348b4d6..bf7b82b91d45908833ba577f13ba9dacfcec0259 100644
--- a/pkg/analyzer/test/generated/non_error_resolver_test.dart
+++ b/pkg/analyzer/test/generated/non_error_resolver_test.dart
@@ -4,6 +4,8 @@
library analyzer.test.generated.non_error_resolver_test;
+import 'dart:async';
+
import 'package:analyzer/dart/ast/ast.dart';
import 'package:analyzer/dart/ast/standard_resolution_map.dart';
import 'package:analyzer/dart/element/element.dart';
@@ -26,18 +28,17 @@ main() {
@reflectiveTest
class NonErrorResolverTest extends ResolverTestCase {
- void fail_undefinedEnumConstant() {
+ fail_undefinedEnumConstant() async {
Source source = addSource(r'''
enum E { ONE }
E e() {
return E.TWO;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void
- test_abstractSuperMemberReference_superHasConcrete_mixinHasAbstract_method() {
+ test_abstractSuperMemberReference_superHasConcrete_mixinHasAbstract_method() async {
Source source = addSource('''
class A {
void method() {}
@@ -53,11 +54,11 @@ class C extends A with B {
}
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_abstractSuperMemberReference_superHasNoSuchMethod() {
+ test_abstractSuperMemberReference_superHasNoSuchMethod() async {
Source source = addSource('''
abstract class A {
int m();
@@ -68,11 +69,11 @@ class B extends A {
int m() => super.m();
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_abstractSuperMemberReference_superSuperHasConcrete_getter() {
+ test_abstractSuperMemberReference_superSuperHasConcrete_getter() async {
Source source = addSource('''
abstract class A {
int get m => 0;
@@ -86,11 +87,11 @@ class C extends B {
int get m => super.m;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_abstractSuperMemberReference_superSuperHasConcrete_method() {
+ test_abstractSuperMemberReference_superSuperHasConcrete_method() async {
Source source = addSource('''
void main() {
print(new C().m());
@@ -108,11 +109,11 @@ class C extends B {
int m() => super.m();
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_abstractSuperMemberReference_superSuperHasConcrete_setter() {
+ test_abstractSuperMemberReference_superSuperHasConcrete_setter() async {
Source source = addSource('''
abstract class A {
void set m(int v) {}
@@ -128,11 +129,11 @@ class C extends B {
}
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_ambiguousExport() {
+ test_ambiguousExport() async {
Source source = addSource(r'''
library L;
export 'lib1.dart';
@@ -147,11 +148,11 @@ class M {}''');
r'''
library lib2;
class N {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_ambiguousExport_combinators_hide() {
+ test_ambiguousExport_combinators_hide() async {
Source source = addSource(r'''
library L;
export 'lib1.dart';
@@ -168,11 +169,11 @@ class B {}''');
library L2;
class B {}
class C {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_ambiguousExport_combinators_show() {
+ test_ambiguousExport_combinators_show() async {
Source source = addSource(r'''
library L;
export 'lib1.dart';
@@ -189,11 +190,11 @@ class B {}''');
library L2;
class B {}
class C {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_ambiguousExport_sameDeclaration() {
+ test_ambiguousExport_sameDeclaration() async {
Source source = addSource(r'''
library L;
export 'lib.dart';
@@ -203,11 +204,11 @@ export 'lib.dart';''');
r'''
library lib;
class N {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_ambiguousImport_hideCombinator() {
+ test_ambiguousImport_hideCombinator() async {
Source source = addSource(r'''
import 'lib1.dart';
import 'lib2.dart';
@@ -235,10 +236,10 @@ class N2 {}''');
library lib3;
class N {}
class N3 {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
}
- void test_ambiguousImport_showCombinator() {
+ test_ambiguousImport_showCombinator() async {
Source source = addSource(r'''
import 'lib1.dart';
import 'lib2.dart' show N, N2;
@@ -258,17 +259,17 @@ class N1 {}''');
library lib2;
class N {}
class N2 {}''');
- assertErrors(source, [HintCode.UNUSED_SHOWN_NAME]);
+ await assertErrors(source, [HintCode.UNUSED_SHOWN_NAME]);
}
- void test_annotated_partOfDeclaration() {
+ test_annotated_partOfDeclaration() async {
Source source = addSource('library L; part "part.dart";');
addNamedSource('/part.dart', '@deprecated part of L;');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_argumentTypeNotAssignable_classWithCall_Function() {
+ test_argumentTypeNotAssignable_classWithCall_Function() async {
Source source = addSource(r'''
caller(Function callee) {
callee();
@@ -281,11 +282,11 @@ class N2 {}''');
main() {
caller(new CallMeBack());
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_argumentTypeNotAssignable_fieldFormalParameterElement_member() {
+ test_argumentTypeNotAssignable_fieldFormalParameterElement_member() async {
Source source = addSource(r'''
class ObjectSink<T> {
void sink(T object) {
@@ -296,42 +297,42 @@ class TimestampedObject<E> {
E object2;
TimestampedObject(this.object2);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_argumentTypeNotAssignable_invocation_functionParameter_generic() {
+ test_argumentTypeNotAssignable_invocation_functionParameter_generic() async {
Source source = addSource(r'''
class A<K> {
m(f(K k), K v) {
f(v);
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_argumentTypeNotAssignable_invocation_typedef_generic() {
+ test_argumentTypeNotAssignable_invocation_typedef_generic() async {
Source source = addSource(r'''
typedef A<T>(T p);
f(A<int> a) {
a(1);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_argumentTypeNotAssignable_Object_Function() {
+ test_argumentTypeNotAssignable_Object_Function() async {
Source source = addSource(r'''
main() {
process(() {});
}
process(Object x) {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_argumentTypeNotAssignable_typedef_local() {
+ test_argumentTypeNotAssignable_typedef_local() async {
Source source = addSource(r'''
typedef A(int p1, String p2);
A getA() => null;
@@ -339,21 +340,21 @@ f() {
A a = getA();
a(1, '2');
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_argumentTypeNotAssignable_typedef_parameter() {
+ test_argumentTypeNotAssignable_typedef_parameter() async {
Source source = addSource(r'''
typedef A(int p1, String p2);
f(A a) {
a(1, '2');
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_assert_with_message_await() {
+ test_assert_with_message_await() async {
Source source = addSource('''
import 'dart:async';
f() async {
@@ -361,63 +362,63 @@ f() async {
}
Future<String> g() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_assert_with_message_dynamic() {
+ test_assert_with_message_dynamic() async {
Source source = addSource('''
f() {
assert(false, g());
}
g() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_assert_with_message_non_string() {
+ test_assert_with_message_non_string() async {
Source source = addSource('''
f() {
assert(false, 3);
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_assert_with_message_null() {
+ test_assert_with_message_null() async {
Source source = addSource('''
f() {
assert(false, null);
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_assert_with_message_string() {
+ test_assert_with_message_string() async {
Source source = addSource('''
f() {
assert(false, 'message');
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_assert_with_message_suppresses_unused_var_hint() {
+ test_assert_with_message_suppresses_unused_var_hint() async {
Source source = addSource('''
f() {
String message = 'msg';
assert(true, message);
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_assignability_function_expr_rettype_from_typedef_cls() {
+ test_assignability_function_expr_rettype_from_typedef_cls() async {
// In the code below, the type of (() => f()) has a return type which is
// a class, and that class is inferred from the return type of the typedef
// F.
@@ -429,11 +430,11 @@ main() {
F f2 = (() => f());
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_assignability_function_expr_rettype_from_typedef_typedef() {
+ test_assignability_function_expr_rettype_from_typedef_typedef() async {
// In the code below, the type of (() => f()) has a return type which is
// a typedef, and that typedef is inferred from the return type of the
// typedef F.
@@ -445,21 +446,21 @@ main() {
F f2 = (() => f());
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_assignmentToFinal_prefixNegate() {
+ test_assignmentToFinal_prefixNegate() async {
Source source = addSource(r'''
f() {
final x = 0;
-x;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_assignmentToFinalNoSetter_prefixedIdentifier() {
+ test_assignmentToFinalNoSetter_prefixedIdentifier() async {
Source source = addSource(r'''
class A {
int get x => 0;
@@ -469,11 +470,11 @@ main() {
A a = new A();
a.x = 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_assignmentToFinalNoSetter_propertyAccess() {
+ test_assignmentToFinalNoSetter_propertyAccess() async {
Source source = addSource(r'''
class A {
int get x => 0;
@@ -485,11 +486,11 @@ class B {
main() {
B.a.x = 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_assignmentToFinals_importWithPrefix() {
+ test_assignmentToFinals_importWithPrefix() async {
Source source = addSource(r'''
library lib;
import 'lib1.dart' as foo;
@@ -501,39 +502,39 @@ main() {
r'''
library lib1;
bool x = false;''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_dynamic_with_return() {
+ test_async_dynamic_with_return() async {
Source source = addSource('''
dynamic f() async {
return;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_dynamic_with_return_value() {
+ test_async_dynamic_with_return_value() async {
Source source = addSource('''
dynamic f() async {
return 5;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_dynamic_without_return() {
+ test_async_dynamic_without_return() async {
Source source = addSource('''
dynamic f() async {}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_expression_function_type() {
+ test_async_expression_function_type() async {
Source source = addSource('''
import 'dart:async';
typedef Future<int> F(int i);
@@ -541,11 +542,11 @@ main() {
F f = (int i) async => i;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_flattened() {
+ test_async_flattened() async {
Source source = addSource('''
import 'dart:async';
typedef Future<int> CreatesFutureInt();
@@ -556,146 +557,146 @@ main() {
}
Future<int> f() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_future_dynamic_with_return() {
+ test_async_future_dynamic_with_return() async {
Source source = addSource('''
import 'dart:async';
Future<dynamic> f() async {
return;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_future_dynamic_with_return_value() {
+ test_async_future_dynamic_with_return_value() async {
Source source = addSource('''
import 'dart:async';
Future<dynamic> f() async {
return 5;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_future_dynamic_without_return() {
+ test_async_future_dynamic_without_return() async {
Source source = addSource('''
import 'dart:async';
Future<dynamic> f() async {}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_future_int_with_return_future_int() {
+ test_async_future_int_with_return_future_int() async {
Source source = addSource('''
import 'dart:async';
Future<int> f() async {
return new Future<int>.value(5);
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_future_int_with_return_value() {
+ test_async_future_int_with_return_value() async {
Source source = addSource('''
import 'dart:async';
Future<int> f() async {
return 5;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_future_null_with_return() {
+ test_async_future_null_with_return() async {
Source source = addSource('''
import 'dart:async';
Future<Null> f() async {
return;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_future_null_without_return() {
+ test_async_future_null_without_return() async {
Source source = addSource('''
import 'dart:async';
Future<Null> f() async {}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_future_object_with_return() {
+ test_async_future_object_with_return() async {
Source source = addSource('''
import 'dart:async';
Future<Object> f() async {
return;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_future_object_with_return_value() {
+ test_async_future_object_with_return_value() async {
Source source = addSource('''
import 'dart:async';
Future<Object> f() async {
return 5;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_future_object_without_return() {
+ test_async_future_object_without_return() async {
Source source = addSource('''
import 'dart:async';
Future<Object> f() async {}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_future_with_return() {
+ test_async_future_with_return() async {
Source source = addSource('''
import 'dart:async';
Future f() async {
return;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_future_with_return_value() {
+ test_async_future_with_return_value() async {
Source source = addSource('''
import 'dart:async';
Future f() async {
return 5;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_future_without_return() {
+ test_async_future_without_return() async {
Source source = addSource('''
import 'dart:async';
Future f() async {}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_return_flattens_futures() {
+ test_async_return_flattens_futures() async {
Source source = addSource('''
import 'dart:async';
Future<int> f() async {
@@ -703,59 +704,59 @@ Future<int> f() async {
}
Future<Future<int>> g() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_with_return() {
+ test_async_with_return() async {
Source source = addSource('''
f() async {
return;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_with_return_value() {
+ test_async_with_return_value() async {
Source source = addSource('''
f() async {
return 5;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_async_without_return() {
+ test_async_without_return() async {
Source source = addSource('''
f() async {}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_asyncForInWrongContext_async() {
+ test_asyncForInWrongContext_async() async {
Source source = addSource(r'''
f(list) async {
await for (var e in list) {
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_asyncForInWrongContext_asyncStar() {
+ test_asyncForInWrongContext_asyncStar() async {
Source source = addSource(r'''
f(list) async* {
await for (var e in list) {
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_await_flattened() {
+ test_await_flattened() async {
Source source = addSource('''
import 'dart:async';
Future<Future<int>> ffi() => null;
@@ -763,11 +764,11 @@ f() async {
int b = await ffi();
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_await_simple() {
+ test_await_simple() async {
Source source = addSource('''
import 'dart:async';
Future<int> fi() => null;
@@ -775,29 +776,29 @@ f() async {
int a = await fi();
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_awaitInWrongContext_async() {
+ test_awaitInWrongContext_async() async {
Source source = addSource(r'''
f(x, y) async {
return await x + await y;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_awaitInWrongContext_asyncStar() {
+ test_awaitInWrongContext_asyncStar() async {
Source source = addSource(r'''
f(x, y) async* {
yield await x + await y;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_breakWithoutLabelInSwitch() {
+ test_breakWithoutLabelInSwitch() async {
Source source = addSource(r'''
class A {
void m(int i) {
@@ -807,11 +808,11 @@ class A {
}
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_bug_24539_getter() {
+ test_bug_24539_getter() async {
Source source = addSource('''
class C<T> {
List<Foo> get x => null;
@@ -819,11 +820,11 @@ class C<T> {
typedef Foo(param);
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_bug_24539_setter() {
+ test_bug_24539_setter() async {
Source source = addSource('''
class C<T> {
void set x(List<Foo> value) {}
@@ -831,20 +832,20 @@ class C<T> {
typedef Foo(param);
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_builtInIdentifierAsType_dynamic() {
+ test_builtInIdentifierAsType_dynamic() async {
Source source = addSource(r'''
f() {
dynamic x;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_caseBlockNotTerminated() {
+ test_caseBlockNotTerminated() async {
Source source = addSource(r'''
f(int p) {
for (int i = 0; i < 10; i++) {
@@ -866,11 +867,11 @@ f(int p) {
}
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_caseBlockNotTerminated_lastCase() {
+ test_caseBlockNotTerminated_lastCase() async {
Source source = addSource(r'''
f(int p) {
switch (p) {
@@ -878,11 +879,11 @@ f(int p) {
p = p + 1;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_caseExpressionTypeImplementsEquals() {
+ test_caseExpressionTypeImplementsEquals() async {
Source source = addSource(r'''
print(p) {}
@@ -904,11 +905,11 @@ void doSwitch(c) {
case const C(1): print('Switch: 1'); break;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_caseExpressionTypeImplementsEquals_int() {
+ test_caseExpressionTypeImplementsEquals_int() async {
Source source = addSource(r'''
f(int i) {
switch(i) {
@@ -916,11 +917,11 @@ f(int i) {
default: return 0;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_caseExpressionTypeImplementsEquals_Object() {
+ test_caseExpressionTypeImplementsEquals_Object() async {
Source source = addSource(r'''
class IntWrapper {
final int value;
@@ -933,11 +934,11 @@ f(IntWrapper intWrapper) {
default: return 0;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_caseExpressionTypeImplementsEquals_String() {
+ test_caseExpressionTypeImplementsEquals_String() async {
Source source = addSource(r'''
f(String s) {
switch(s) {
@@ -945,11 +946,11 @@ f(String s) {
default: return 0;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_class_type_alias_documentationComment() {
+ test_class_type_alias_documentationComment() async {
Source source = addSource('''
/**
* Documentation
@@ -958,24 +959,24 @@ class C = D with E;
class D {}
class E {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
- CompilationUnit unit = _getResolvedLibraryUnit(source);
+ CompilationUnit unit = await _getResolvedLibraryUnit(source);
ClassElement classC =
resolutionMap.elementDeclaredByCompilationUnit(unit).getType('C');
expect(classC.documentationComment, isNotNull);
}
- void test_commentReference_beforeConstructor() {
+ test_commentReference_beforeConstructor() async {
String code = r'''
abstract class A {
/// [p]
A(int p) {}
}''';
Source source = addSource(code);
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
- CompilationUnit unit = _getResolvedLibraryUnit(source);
+ CompilationUnit unit = await _getResolvedLibraryUnit(source);
{
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, "p]");
@@ -983,7 +984,7 @@ abstract class A {
}
}
- void test_commentReference_beforeEnum() {
+ test_commentReference_beforeEnum() async {
String code = r'''
/// This is the [Samurai] kind.
enum Samurai {
@@ -993,9 +994,9 @@ enum Samurai {
WITHOUT_SWORD
}''';
Source source = addSource(code);
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
- CompilationUnit unit = _getResolvedLibraryUnit(source);
+ CompilationUnit unit = await _getResolvedLibraryUnit(source);
{
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, 'Samurai]');
@@ -1019,57 +1020,57 @@ enum Samurai {
}
}
- void test_commentReference_beforeFunction_blockBody() {
+ test_commentReference_beforeFunction_blockBody() async {
String code = r'''
/// [p]
foo(int p) {
}''';
Source source = addSource(code);
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
- CompilationUnit unit = _getResolvedLibraryUnit(source);
+ CompilationUnit unit = await _getResolvedLibraryUnit(source);
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, 'p]');
expect(ref.staticElement, new isInstanceOf<ParameterElement>());
}
- void test_commentReference_beforeFunction_expressionBody() {
+ test_commentReference_beforeFunction_expressionBody() async {
String code = r'''
/// [p]
foo(int p) => null;''';
Source source = addSource(code);
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
- CompilationUnit unit = _getResolvedLibraryUnit(source);
+ CompilationUnit unit = await _getResolvedLibraryUnit(source);
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, 'p]');
expect(ref.staticElement, new isInstanceOf<ParameterElement>());
}
- void test_commentReference_beforeFunctionTypeAlias() {
+ test_commentReference_beforeFunctionTypeAlias() async {
String code = r'''
/// [p]
typedef Foo(int p);
''';
Source source = addSource(code);
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
- CompilationUnit unit = _getResolvedLibraryUnit(source);
+ CompilationUnit unit = await _getResolvedLibraryUnit(source);
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, 'p]');
expect(ref.staticElement, new isInstanceOf<ParameterElement>());
}
- void test_commentReference_beforeGetter() {
+ test_commentReference_beforeGetter() async {
String code = r'''
abstract class A {
/// [int]
get g => null;
}''';
Source source = addSource(code);
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
- CompilationUnit unit = _getResolvedLibraryUnit(source);
+ CompilationUnit unit = await _getResolvedLibraryUnit(source);
{
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, 'int]');
@@ -1077,7 +1078,7 @@ abstract class A {
}
}
- void test_commentReference_beforeMethod() {
+ test_commentReference_beforeMethod() async {
String code = r'''
abstract class A {
/// [p1]
@@ -1090,9 +1091,9 @@ abstract class A {
md(int p5, {int p6});
}''';
Source source = addSource(code);
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
- CompilationUnit unit = _getResolvedLibraryUnit(source);
+ CompilationUnit unit = await _getResolvedLibraryUnit(source);
assertIsParameter(String search) {
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, search);
@@ -1107,22 +1108,22 @@ abstract class A {
assertIsParameter('p6');
}
- void test_commentReference_class() {
+ test_commentReference_class() async {
String code = r'''
/// [foo]
class A {
foo() {}
}''';
Source source = addSource(code);
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
- CompilationUnit unit = _getResolvedLibraryUnit(source);
+ CompilationUnit unit = await _getResolvedLibraryUnit(source);
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, 'foo]');
expect(ref.staticElement, new isInstanceOf<MethodElement>());
}
- void test_commentReference_setter() {
+ test_commentReference_setter() async {
String code = r'''
class A {
/// [x] in A
@@ -1135,9 +1136,9 @@ class B extends A {
}
''';
Source source = addSource(code);
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
- CompilationUnit unit = _getResolvedLibraryUnit(source);
+ CompilationUnit unit = await _getResolvedLibraryUnit(source);
{
SimpleIdentifier ref =
EngineTestCase.findSimpleIdentifier(unit, code, "x] in A");
@@ -1150,16 +1151,16 @@ class B extends A {
}
}
- void test_concreteClassWithAbstractMember() {
+ test_concreteClassWithAbstractMember() async {
Source source = addSource(r'''
abstract class A {
m();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_concreteClassWithAbstractMember_inherited() {
+ test_concreteClassWithAbstractMember_inherited() async {
Source source = addSource(r'''
class A {
m() {}
@@ -1167,11 +1168,11 @@ class A {
class B extends A {
m();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_conflictingInstanceGetterAndSuperclassMember_instance() {
+ test_conflictingInstanceGetterAndSuperclassMember_instance() async {
Source source = addSource(r'''
class A {
get v => 0;
@@ -1179,50 +1180,50 @@ class A {
class B extends A {
get v => 1;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_conflictingStaticGetterAndInstanceSetter_thisClass() {
+ test_conflictingStaticGetterAndInstanceSetter_thisClass() async {
Source source = addSource(r'''
class A {
static get x => 0;
static set x(int p) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_conflictingStaticSetterAndInstanceMember_thisClass_method() {
+ test_conflictingStaticSetterAndInstanceMember_thisClass_method() async {
Source source = addSource(r'''
class A {
static x() {}
static set x(int p) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_const_constructor_with_named_generic_parameter() {
+ test_const_constructor_with_named_generic_parameter() async {
Source source = addSource('''
class C<T> {
const C({T t});
}
const c = const C(t: 1);
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_const_dynamic() {
+ test_const_dynamic() async {
Source source = addSource('''
const Type d = dynamic;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constConstructorWithNonConstSuper_explicit() {
+ test_constConstructorWithNonConstSuper_explicit() async {
Source source = addSource(r'''
class A {
const A();
@@ -1230,11 +1231,11 @@ class A {
class B extends A {
const B(): super();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constConstructorWithNonConstSuper_redirectingFactory() {
+ test_constConstructorWithNonConstSuper_redirectingFactory() async {
Source source = addSource(r'''
class A {
A();
@@ -1245,11 +1246,11 @@ class B implements C {
class C extends A {
const factory C() = B;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constConstructorWithNonConstSuper_unresolved() {
+ test_constConstructorWithNonConstSuper_unresolved() async {
Source source = addSource(r'''
class A {
A.a();
@@ -1257,22 +1258,22 @@ class A {
class B extends A {
const B(): super();
}''');
- assertErrors(source,
+ await assertErrors(source,
[CompileTimeErrorCode.UNDEFINED_CONSTRUCTOR_IN_INITIALIZER_DEFAULT]);
verify([source]);
}
- void test_constConstructorWithNonFinalField_finalInstanceVar() {
+ test_constConstructorWithNonFinalField_finalInstanceVar() async {
Source source = addSource(r'''
class A {
final int x = 0;
const A();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constConstructorWithNonFinalField_mixin() {
+ test_constConstructorWithNonFinalField_mixin() async {
Source source = addSource(r'''
class A {
a() {}
@@ -1280,33 +1281,34 @@ class A {
class B extends Object with A {
const B();
}''');
- assertErrors(source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN]);
+ await assertErrors(
+ source, [CompileTimeErrorCode.CONST_CONSTRUCTOR_WITH_MIXIN]);
verify([source]);
}
- void test_constConstructorWithNonFinalField_static() {
+ test_constConstructorWithNonFinalField_static() async {
Source source = addSource(r'''
class A {
static int x;
const A();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constConstructorWithNonFinalField_syntheticField() {
+ test_constConstructorWithNonFinalField_syntheticField() async {
Source source = addSource(r'''
class A {
const A();
set x(value) {}
get x {return 0;}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constDeferredClass_new() {
- resolveWithErrors(<String>[
+ test_constDeferredClass_new() async {
+ await resolveWithErrors(<String>[
r'''
library lib1;
class A {
@@ -1321,15 +1323,15 @@ main() {
], <ErrorCode>[]);
}
- void test_constEval_functionTypeLiteral() {
+ test_constEval_functionTypeLiteral() async {
Source source = addSource(r'''
typedef F();
const C = F;''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constEval_propertyExtraction_fieldStatic_targetType() {
+ test_constEval_propertyExtraction_fieldStatic_targetType() async {
addNamedSource(
"/math.dart",
r'''
@@ -1338,22 +1340,22 @@ const PI = 3.14;''');
Source source = addSource(r'''
import 'math.dart' as math;
const C = math.PI;''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constEval_propertyExtraction_methodStatic_targetType() {
+ test_constEval_propertyExtraction_methodStatic_targetType() async {
Source source = addSource(r'''
class A {
const A();
static m() {}
}
const C = A.m;''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constEval_symbol() {
+ test_constEval_symbol() async {
addNamedSource(
"/math.dart",
r'''
@@ -1362,11 +1364,11 @@ const PI = 3.14;''');
Source source = addSource(r'''
const C = #foo;
foo() {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constEvalTypeBoolNumString_equal() {
+ test_constEvalTypeBoolNumString_equal() async {
Source source = addSource(r'''
class A {
const A();
@@ -1391,10 +1393,10 @@ class B {
const B.n1(num p) : v = p == null;
const B.n2(num p) : v = null == p;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
}
- void test_constEvalTypeBoolNumString_notEqual() {
+ test_constEvalTypeBoolNumString_notEqual() async {
Source source = addSource(r'''
class A {
const A();
@@ -1419,20 +1421,20 @@ class B {
const B.n1(num p) : v = p != null;
const B.n2(num p) : v = null != p;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constEvelTypeNum_String() {
+ test_constEvelTypeNum_String() async {
Source source = addSource(r'''
const String A = 'a';
const String B = A + 'b';
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constMapKeyExpressionTypeImplementsEquals_abstract() {
+ test_constMapKeyExpressionTypeImplementsEquals_abstract() async {
Source source = addSource(r'''
abstract class B {
final id;
@@ -1449,29 +1451,29 @@ class C extends B {
Map getMap() {
return const { const C(0): 'Map: 0' };
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constNotInitialized_field() {
+ test_constNotInitialized_field() async {
Source source = addSource(r'''
class A {
static const int x = 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constNotInitialized_local() {
+ test_constNotInitialized_local() async {
Source source = addSource(r'''
main() {
const int x = 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constRedirectSkipsSupertype() {
+ test_constRedirectSkipsSupertype() async {
// Since C redirects to C.named, it doesn't implicitly refer to B's
// unnamed constructor. Therefore there is no cycle.
Source source = addSource('''
@@ -1486,21 +1488,21 @@ class C extends B {
}
const y = const C();
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constructorDeclaration_scope_signature() {
+ test_constructorDeclaration_scope_signature() async {
Source source = addSource(r'''
const app = 0;
class A {
A(@app int app) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constWithNonConstantArgument_constField() {
+ test_constWithNonConstantArgument_constField() async {
Source source = addSource(r'''
class A {
const A(x);
@@ -1508,31 +1510,31 @@ class A {
main() {
const A(double.INFINITY);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constWithNonConstantArgument_literals() {
+ test_constWithNonConstantArgument_literals() async {
Source source = addSource(r'''
class A {
const A(a, b, c, d);
}
f() { return const A(true, 0, 1.0, '2'); }''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constWithTypeParameters_direct() {
+ test_constWithTypeParameters_direct() async {
Source source = addSource(r'''
class A<T> {
static const V = const A<int>();
const A();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constWithUndefinedConstructor() {
+ test_constWithUndefinedConstructor() async {
Source source = addSource(r'''
class A {
const A.name();
@@ -1540,11 +1542,11 @@ class A {
f() {
return const A.name();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_constWithUndefinedConstructorDefault() {
+ test_constWithUndefinedConstructorDefault() async {
Source source = addSource(r'''
class A {
const A();
@@ -1552,29 +1554,29 @@ class A {
f() {
return const A();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_defaultValueInFunctionTypeAlias() {
+ test_defaultValueInFunctionTypeAlias() async {
Source source = addSource("typedef F([x]);");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_defaultValueInFunctionTypedParameter_named() {
+ test_defaultValueInFunctionTypedParameter_named() async {
Source source = addSource("f(g({p})) {}");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_defaultValueInFunctionTypedParameter_optional() {
+ test_defaultValueInFunctionTypedParameter_optional() async {
Source source = addSource("f(g([p])) {}");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_deprecatedMemberUse_hide() {
+ test_deprecatedMemberUse_hide() async {
Source source = addSource(r'''
library lib;
import 'lib1.dart' hide B;
@@ -1586,11 +1588,11 @@ library lib1;
class A {}
@deprecated
class B {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_duplicateDefinition_emptyName() {
+ test_duplicateDefinition_emptyName() async {
// Note: This code has two FunctionElements '() {}' with an empty name,
// this tests that the empty string is not put into the scope
// (more than once).
@@ -1599,17 +1601,17 @@ Map _globalMap = {
'a' : () {},
'b' : () {}
};''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_duplicateDefinition_getter() {
+ test_duplicateDefinition_getter() async {
Source source = addSource("bool get a => true;");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_duplicatePart() {
+ test_duplicatePart() async {
addNamedSource('/part1.dart', 'part of lib;');
addNamedSource('/part2.dart', 'part of lib;');
Source source = addSource(r'''
@@ -1617,105 +1619,105 @@ library lib;
part 'part1.dart';
part 'part2.dart';
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_dynamicIdentifier() {
+ test_dynamicIdentifier() async {
Source source = addSource(r'''
main() {
var v = dynamic;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_empty_generator_async() {
+ test_empty_generator_async() async {
Source source = addSource('''
import 'dart:async';
Stream<int> f() async* {
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_empty_generator_sync() {
+ test_empty_generator_sync() async {
Source source = addSource('''
Iterable<int> f() sync* {
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_expectedOneListTypeArgument() {
+ test_expectedOneListTypeArgument() async {
Source source = addSource(r'''
main() {
<int> [];
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_expectedTwoMapTypeArguments() {
+ test_expectedTwoMapTypeArguments() async {
Source source = addSource(r'''
main() {
<int, int> {};
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_exportDuplicatedLibraryUnnamed() {
+ test_exportDuplicatedLibraryUnnamed() async {
Source source = addSource(r'''
library test;
export 'lib1.dart';
export 'lib2.dart';''');
addNamedSource("/lib1.dart", "");
addNamedSource("/lib2.dart", "");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_exportOfNonLibrary_libraryDeclared() {
+ test_exportOfNonLibrary_libraryDeclared() async {
Source source = addSource(r'''
library L;
export 'lib1.dart';''');
addNamedSource("/lib1.dart", "library lib1;");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_exportOfNonLibrary_libraryNotDeclared() {
+ test_exportOfNonLibrary_libraryNotDeclared() async {
Source source = addSource(r'''
library L;
export 'lib1.dart';''');
addNamedSource("/lib1.dart", "");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_extraPositionalArguments_function() {
+ test_extraPositionalArguments_function() async {
Source source = addSource(r'''
f(p1, p2) {}
main() {
f(1, 2);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_extraPositionalArguments_Function() {
+ test_extraPositionalArguments_Function() async {
Source source = addSource(r'''
f(Function a) {
a(1, 2);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_extraPositionalArguments_implicitConstructor() {
+ test_extraPositionalArguments_implicitConstructor() async {
Source source = addSource(r'''
class A<E extends num> {
A(E x, E y);
@@ -1725,11 +1727,11 @@ class B<E extends num> = A<E> with M;
void main() {
B<int> x = new B<int>(0,0);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_extraPositionalArguments_typedef_local() {
+ test_extraPositionalArguments_typedef_local() async {
Source source = addSource(r'''
typedef A(p1, p2);
A getA() => null;
@@ -1737,72 +1739,72 @@ f() {
A a = getA();
a(1, 2);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_extraPositionalArguments_typedef_parameter() {
+ test_extraPositionalArguments_typedef_parameter() async {
Source source = addSource(r'''
typedef A(p1, p2);
f(A a) {
a(1, 2);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_fieldInitializedByMultipleInitializers() {
+ test_fieldInitializedByMultipleInitializers() async {
Source source = addSource(r'''
class A {
int x;
int y;
A() : x = 0, y = 0 {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_fieldInitializedInInitializerAndDeclaration_fieldNotFinal() {
+ test_fieldInitializedInInitializerAndDeclaration_fieldNotFinal() async {
Source source = addSource(r'''
class A {
int x = 0;
A() : x = 1 {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_fieldInitializedInInitializerAndDeclaration_finalFieldNotSet() {
+ test_fieldInitializedInInitializerAndDeclaration_finalFieldNotSet() async {
Source source = addSource(r'''
class A {
final int x;
A() : x = 1 {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_fieldInitializerOutsideConstructor() {
+ test_fieldInitializerOutsideConstructor() async {
Source source = addSource(r'''
class A {
int x;
A(this.x) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_fieldInitializerOutsideConstructor_defaultParameters() {
+ test_fieldInitializerOutsideConstructor_defaultParameters() async {
Source source = addSource(r'''
class A {
int x;
A([this.x]) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_fieldInitializerRedirectingConstructor_super() {
+ test_fieldInitializerRedirectingConstructor_super() async {
Source source = addSource(r'''
class A {
A() {}
@@ -1811,129 +1813,131 @@ class B extends A {
int x;
B(this.x) : super();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_finalInitializedInDeclarationAndConstructor_initializer() {
+ test_finalInitializedInDeclarationAndConstructor_initializer() async {
Source source = addSource(r'''
class A {
final x;
A() : x = 1 {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_finalInitializedInDeclarationAndConstructor_initializingFormal() {
+ test_finalInitializedInDeclarationAndConstructor_initializingFormal() async {
Source source = addSource(r'''
class A {
final x;
A(this.x) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_finalNotInitialized_atDeclaration() {
+ test_finalNotInitialized_atDeclaration() async {
Source source = addSource(r'''
class A {
final int x = 0;
A() {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_finalNotInitialized_fieldFormal() {
+ test_finalNotInitialized_fieldFormal() async {
Source source = addSource(r'''
class A {
final int x = 0;
A() {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_finalNotInitialized_functionTypedFieldFormal() {
+ test_finalNotInitialized_functionTypedFieldFormal() async {
Source source = addSource(r'''
class A {
final Function x;
A(int this.x(int p)) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_finalNotInitialized_hasNativeClause_hasConstructor() {
+ test_finalNotInitialized_hasNativeClause_hasConstructor() async {
Source source = addSource(r'''
class A native 'something' {
final int x;
A() {}
}''');
- assertErrors(source, [ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE]);
+ await assertErrors(
+ source, [ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE]);
verify([source]);
}
- void test_finalNotInitialized_hasNativeClause_noConstructor() {
+ test_finalNotInitialized_hasNativeClause_noConstructor() async {
Source source = addSource(r'''
class A native 'something' {
final int x;
}''');
- assertErrors(source, [ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE]);
+ await assertErrors(
+ source, [ParserErrorCode.NATIVE_CLAUSE_IN_NON_SDK_CODE]);
verify([source]);
}
- void test_finalNotInitialized_initializer() {
+ test_finalNotInitialized_initializer() async {
Source source = addSource(r'''
class A {
final int x;
A() : x = 0 {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_finalNotInitialized_redirectingConstructor() {
+ test_finalNotInitialized_redirectingConstructor() async {
Source source = addSource(r'''
class A {
final int x;
A(this.x);
A.named() : this (42);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_functionDeclaration_scope_returnType() {
+ test_functionDeclaration_scope_returnType() async {
Source source = addSource("int f(int) { return 0; }");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_functionDeclaration_scope_signature() {
+ test_functionDeclaration_scope_signature() async {
Source source = addSource(r'''
const app = 0;
f(@app int app) {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_functionTypeAlias_scope_returnType() {
+ test_functionTypeAlias_scope_returnType() async {
Source source = addSource("typedef int f(int);");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_functionTypeAlias_scope_signature() {
+ test_functionTypeAlias_scope_signature() async {
Source source = addSource(r'''
const app = 0;
typedef int f(@app int app);''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_functionWithoutCall() {
+ test_functionWithoutCall() async {
Source source = addSource(r'''
abstract class A implements Function {
}
@@ -1945,28 +1949,28 @@ class C extends A {
}
class D extends C {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_functionWithoutCall_doesNotImplementFunction() {
+ test_functionWithoutCall_doesNotImplementFunction() async {
Source source = addSource("class A {}");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_functionWithoutCall_staticCallMethod() {
+ test_functionWithoutCall_staticCallMethod() async {
Source source = addSource(r'''
class A { }
class B extends A {
static call() { }
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_functionWithoutCall_withNoSuchMethod() {
+ test_functionWithoutCall_withNoSuchMethod() async {
// 16078
Source source = addSource(r'''
class A implements Function {
@@ -1974,33 +1978,33 @@ class A implements Function {
return 42;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_functionWithoutCall_withNoSuchMethod_mixin() {
+ test_functionWithoutCall_withNoSuchMethod_mixin() async {
Source source = addSource(r'''
class A {
noSuchMethod(inv) {}
}
class B extends Object with A implements Function {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_functionWithoutCall_withNoSuchMethod_superclass() {
+ test_functionWithoutCall_withNoSuchMethod_superclass() async {
Source source = addSource(r'''
class A {
noSuchMethod(inv) {}
}
class B extends A implements Function {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_implicitConstructorDependencies() {
+ test_implicitConstructorDependencies() async {
// No warning should be generated for the code below; this requires that
// implicit constructors are generated for C1 before C2, even though C1
// follows C2 in the file. See dartbug.com/21600.
@@ -2018,11 +2022,11 @@ main() {
new C2(5);
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_implicitThisReferenceInInitializer_constructorName() {
+ test_implicitThisReferenceInInitializer_constructorName() async {
Source source = addSource(r'''
class A {
A.named() {}
@@ -2031,21 +2035,21 @@ class B {
var v;
B() : v = new A.named();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_implicitThisReferenceInInitializer_importPrefix() {
+ test_implicitThisReferenceInInitializer_importPrefix() async {
Source source = addSource(r'''
import 'dart:async' as abstract;
class A {
var v = new abstract.Completer();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_implicitThisReferenceInInitializer_prefixedIdentifier() {
+ test_implicitThisReferenceInInitializer_prefixedIdentifier() async {
Source source = addSource(r'''
class A {
var f;
@@ -2054,11 +2058,11 @@ class B {
var v;
B(A a) : v = a.f;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_implicitThisReferenceInInitializer_qualifiedMethodInvocation() {
+ test_implicitThisReferenceInInitializer_qualifiedMethodInvocation() async {
Source source = addSource(r'''
class A {
f() {}
@@ -2067,11 +2071,11 @@ class B {
var v;
B() : v = new A().f();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_implicitThisReferenceInInitializer_qualifiedPropertyAccess() {
+ test_implicitThisReferenceInInitializer_qualifiedPropertyAccess() async {
Source source = addSource(r'''
class A {
var f;
@@ -2080,93 +2084,93 @@ class B {
var v;
B() : v = new A().f;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_implicitThisReferenceInInitializer_staticField_thisClass() {
+ test_implicitThisReferenceInInitializer_staticField_thisClass() async {
Source source = addSource(r'''
class A {
var v;
A() : v = f;
static var f;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_implicitThisReferenceInInitializer_staticGetter() {
+ test_implicitThisReferenceInInitializer_staticGetter() async {
Source source = addSource(r'''
class A {
var v;
A() : v = f;
static get f => 42;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_implicitThisReferenceInInitializer_staticMethod() {
+ test_implicitThisReferenceInInitializer_staticMethod() async {
Source source = addSource(r'''
class A {
var v;
A() : v = f();
static f() => 42;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_implicitThisReferenceInInitializer_topLevelField() {
+ test_implicitThisReferenceInInitializer_topLevelField() async {
Source source = addSource(r'''
class A {
var v;
A() : v = f;
}
var f = 42;''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_implicitThisReferenceInInitializer_topLevelFunction() {
+ test_implicitThisReferenceInInitializer_topLevelFunction() async {
Source source = addSource(r'''
class A {
var v;
A() : v = f();
}
f() => 42;''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_implicitThisReferenceInInitializer_topLevelGetter() {
+ test_implicitThisReferenceInInitializer_topLevelGetter() async {
Source source = addSource(r'''
class A {
var v;
A() : v = f;
}
get f => 42;''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_implicitThisReferenceInInitializer_typeParameter() {
+ test_implicitThisReferenceInInitializer_typeParameter() async {
Source source = addSource(r'''
class A<T> {
var v;
A(p) : v = (p is T);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_importDuplicatedLibraryName() {
+ test_importDuplicatedLibraryName() async {
Source source = addSource(r'''
library test;
import 'lib.dart';
import 'lib.dart';''');
addNamedSource("/lib.dart", "library lib;");
- assertErrors(source, [
+ await assertErrors(source, [
HintCode.UNUSED_IMPORT,
HintCode.UNUSED_IMPORT,
HintCode.DUPLICATE_IMPORT
@@ -2174,14 +2178,14 @@ import 'lib.dart';''');
verify([source]);
}
- void test_importDuplicatedLibraryUnnamed() {
+ test_importDuplicatedLibraryUnnamed() async {
Source source = addSource(r'''
library test;
import 'lib1.dart';
import 'lib2.dart';''');
addNamedSource("/lib1.dart", "");
addNamedSource("/lib2.dart", "");
- assertErrors(source, [
+ await assertErrors(source, [
// No warning on duplicate import (https://github.com/dart-lang/sdk/issues/24156)
HintCode.UNUSED_IMPORT,
HintCode.UNUSED_IMPORT
@@ -2189,7 +2193,7 @@ import 'lib2.dart';''');
verify([source]);
}
- void test_importOfNonLibrary_libraryDeclared() {
+ test_importOfNonLibrary_libraryDeclared() async {
Source source = addSource(r'''
library lib;
import 'part.dart';
@@ -2199,21 +2203,21 @@ A a;''');
r'''
library lib1;
class A {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_importOfNonLibrary_libraryNotDeclared() {
+ test_importOfNonLibrary_libraryNotDeclared() async {
Source source = addSource(r'''
library lib;
import 'part.dart';
A a;''');
addNamedSource("/part.dart", "class A {}");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_importPrefixes_withFirstLetterDifference() {
+ test_importPrefixes_withFirstLetterDifference() async {
Source source = addSource(r'''
library L;
import 'lib1.dart' as math;
@@ -2232,11 +2236,11 @@ test1() {}''');
r'''
library lib2;
test2() {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_inconsistentCaseExpressionTypes() {
+ test_inconsistentCaseExpressionTypes() async {
Source source = addSource(r'''
f(var p) {
switch (p) {
@@ -2246,11 +2250,11 @@ f(var p) {
break;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_inconsistentMethodInheritance_accessors_typeParameter2() {
+ test_inconsistentMethodInheritance_accessors_typeParameter2() async {
Source source = addSource(r'''
abstract class A<E> {
E get x {return null;}
@@ -2259,11 +2263,11 @@ class B<E> {
E get x {return null;}
}
class C<E> extends A<E> implements B<E> {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_inconsistentMethodInheritance_accessors_typeParameters1() {
+ test_inconsistentMethodInheritance_accessors_typeParameters1() async {
Source source = addSource(r'''
abstract class A<E> {
E get x;
@@ -2274,11 +2278,11 @@ abstract class B<E> {
class C<E> implements A<E>, B<E> {
E get x => null;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_inconsistentMethodInheritance_accessors_typeParameters_diamond() {
+ test_inconsistentMethodInheritance_accessors_typeParameters_diamond() async {
Source source = addSource(r'''
abstract class F<E> extends B<E> {}
class D<E> extends F<E> {
@@ -2292,11 +2296,11 @@ abstract class B<E> implements C<E> {
}
class A<E> extends B<E> implements D<E> {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_inconsistentMethodInheritance_methods_typeParameter2() {
+ test_inconsistentMethodInheritance_methods_typeParameter2() async {
Source source = addSource(r'''
class A<E> {
x(E e) {}
@@ -2307,11 +2311,11 @@ class B<E> {
class C<E> extends A<E> implements B<E> {
x(E e) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_inconsistentMethodInheritance_methods_typeParameters1() {
+ test_inconsistentMethodInheritance_methods_typeParameters1() async {
Source source = addSource(r'''
class A<E> {
x(E e) {}
@@ -2322,11 +2326,11 @@ class B<E> {
class C<E> implements A<E>, B<E> {
x(E e) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_inconsistentMethodInheritance_overrideTrumpsInherits_getter() {
+ test_inconsistentMethodInheritance_overrideTrumpsInherits_getter() async {
// 16134
Source source = addSource(r'''
class B<S> {
@@ -2338,11 +2342,11 @@ abstract class I<U> {
class C extends B<double> implements I<int> {
num get g => null;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_inconsistentMethodInheritance_overrideTrumpsInherits_method() {
+ test_inconsistentMethodInheritance_overrideTrumpsInherits_method() async {
// 16134
Source source = addSource(r'''
class B<S> {
@@ -2354,11 +2358,11 @@ abstract class I<U> {
class C extends B<double> implements I<int> {
m(num n) => null;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_inconsistentMethodInheritance_overrideTrumpsInherits_setter() {
+ test_inconsistentMethodInheritance_overrideTrumpsInherits_setter() async {
// 16134
Source source = addSource(r'''
class B<S> {
@@ -2370,11 +2374,11 @@ abstract class I<U> {
class C extends B<double> implements I<int> {
set t(num n) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_inconsistentMethodInheritance_simple() {
+ test_inconsistentMethodInheritance_simple() async {
Source source = addSource(r'''
abstract class A {
x();
@@ -2385,21 +2389,21 @@ abstract class B {
class C implements A, B {
x() {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_initializingFormalForNonExistentField() {
+ test_initializingFormalForNonExistentField() async {
Source source = addSource(r'''
class A {
int x;
A(this.x) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_instance_creation_inside_annotation() {
+ test_instance_creation_inside_annotation() async {
Source source = addSource('''
class C {
const C();
@@ -2411,11 +2415,11 @@ class D {
@D(const C())
f() {}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_instanceAccessToStaticMember_fromComment() {
+ test_instanceAccessToStaticMember_fromComment() async {
Source source = addSource(r'''
class A {
static m() {}
@@ -2423,21 +2427,21 @@ class A {
/// [A.m]
main() {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_instanceAccessToStaticMember_topLevel() {
+ test_instanceAccessToStaticMember_topLevel() async {
Source source = addSource(r'''
m() {}
main() {
m();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_instanceMemberAccessFromStatic_fromComment() {
+ test_instanceMemberAccessFromStatic_fromComment() async {
Source source = addSource(r'''
class A {
m() {}
@@ -2445,11 +2449,11 @@ class A {
static foo() {
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_instanceMethodNameCollidesWithSuperclassStatic_field() {
+ test_instanceMethodNameCollidesWithSuperclassStatic_field() async {
Source source = addSource(r'''
import 'lib.dart';
class B extends A {
@@ -2462,11 +2466,11 @@ library L;
class A {
static var _m;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_instanceMethodNameCollidesWithSuperclassStatic_method() {
+ test_instanceMethodNameCollidesWithSuperclassStatic_method() async {
Source source = addSource(r'''
import 'lib.dart';
class B extends A {
@@ -2479,21 +2483,21 @@ library L;
class A {
static _m() {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAnnotation_constantVariable_field() {
+ test_invalidAnnotation_constantVariable_field() async {
Source source = addSource(r'''
@A.C
class A {
static const C = 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAnnotation_constantVariable_field_importWithPrefix() {
+ test_invalidAnnotation_constantVariable_field_importWithPrefix() async {
addNamedSource(
"/lib.dart",
r'''
@@ -2506,21 +2510,21 @@ import 'lib.dart' as p;
@p.A.C
main() {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAnnotation_constantVariable_topLevel() {
+ test_invalidAnnotation_constantVariable_topLevel() async {
Source source = addSource(r'''
const C = 0;
@C
main() {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAnnotation_constantVariable_topLevel_importWithPrefix() {
+ test_invalidAnnotation_constantVariable_topLevel_importWithPrefix() async {
addNamedSource(
"/lib.dart",
r'''
@@ -2531,11 +2535,11 @@ import 'lib.dart' as p;
@p.C
main() {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAnnotation_constConstructor_importWithPrefix() {
+ test_invalidAnnotation_constConstructor_importWithPrefix() async {
addNamedSource(
"/lib.dart",
r'''
@@ -2548,11 +2552,11 @@ import 'lib.dart' as p;
@p.A(42)
main() {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAnnotation_constConstructor_named_importWithPrefix() {
+ test_invalidAnnotation_constConstructor_named_importWithPrefix() async {
addNamedSource(
"/lib.dart",
r'''
@@ -2565,22 +2569,22 @@ import 'lib.dart' as p;
@p.A.named(42)
main() {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAssignment() {
+ test_invalidAssignment() async {
Source source = addSource(r'''
f() {
var x;
var y;
x = y;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAssignment_compoundAssignment() {
+ test_invalidAssignment_compoundAssignment() async {
Source source = addSource(r'''
class byte {
int _value;
@@ -2592,49 +2596,49 @@ void main() {
byte b = new byte(52);
b += 3;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAssignment_defaultValue_named() {
+ test_invalidAssignment_defaultValue_named() async {
Source source = addSource(r'''
f({String x: '0'}) {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAssignment_defaultValue_optional() {
+ test_invalidAssignment_defaultValue_optional() async {
Source source = addSource(r'''
f([String x = '0']) {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAssignment_ifNullAssignment_compatibleType() {
+ test_invalidAssignment_ifNullAssignment_compatibleType() async {
Source source = addSource('''
void f(int i) {
num n;
n ??= i;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAssignment_ifNullAssignment_sameType() {
+ test_invalidAssignment_ifNullAssignment_sameType() async {
Source source = addSource('''
void f(int i) {
int j;
j ??= i;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAssignment_implicitlyImplementFunctionViaCall_1() {
+ test_invalidAssignment_implicitlyImplementFunctionViaCall_1() async {
// 18341
//
// This test and
@@ -2650,11 +2654,11 @@ class C implements I {
}
typedef int IntToInt(int x);
IntToInt f = new I();''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAssignment_implicitlyImplementFunctionViaCall_2() {
+ test_invalidAssignment_implicitlyImplementFunctionViaCall_2() async {
// 18341
//
// Here 'C' checks as a subtype of 'I', but 'C' does not
@@ -2670,11 +2674,11 @@ class C implements I {
}
typedef int IntToInt(int x);
IntToInt f = new C();''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAssignment_implicitlyImplementFunctionViaCall_3() {
+ test_invalidAssignment_implicitlyImplementFunctionViaCall_3() async {
// 18341
//
// Like 'test_invalidAssignment_implicitlyImplementFunctionViaCall_2()',
@@ -2688,11 +2692,11 @@ class C implements I {
}
typedef int IntToInt(int x);
Function f = new C();''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAssignment_implicitlyImplementFunctionViaCall_4() {
+ test_invalidAssignment_implicitlyImplementFunctionViaCall_4() async {
// 18341
//
// Like 'test_invalidAssignment_implicitlyImplementFunctionViaCall_2()',
@@ -2713,30 +2717,30 @@ class C implements I {
}
typedef int VoidToInt();
VoidToInt f = new C();''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidAssignment_toDynamic() {
+ test_invalidAssignment_toDynamic() async {
Source source = addSource(r'''
f() {
var g;
g = () => 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidFactoryNameNotAClass() {
+ test_invalidFactoryNameNotAClass() async {
Source source = addSource(r'''
class A {
factory A() => null;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidIdentifierInAsync() {
+ test_invalidIdentifierInAsync() async {
Source source = addSource(r'''
class A {
m() {
@@ -2745,11 +2749,11 @@ class A {
int yield;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidMethodOverrideNamedParamType() {
+ test_invalidMethodOverrideNamedParamType() async {
Source source = addSource(r'''
class A {
m({int a}) {}
@@ -2757,11 +2761,11 @@ class A {
class B implements A {
m({int a, int b}) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideDifferentDefaultValues_named() {
+ test_invalidOverrideDifferentDefaultValues_named() async {
Source source = addSource(r'''
class A {
m({int p : 0}) {}
@@ -2769,11 +2773,11 @@ class A {
class B extends A {
m({int p : 0}) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideDifferentDefaultValues_named_function() {
+ test_invalidOverrideDifferentDefaultValues_named_function() async {
Source source = addSource(r'''
nothing() => 'nothing';
class A {
@@ -2782,11 +2786,11 @@ class A {
class B extends A {
thing(String a, {orElse : nothing}) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideDifferentDefaultValues_positional() {
+ test_invalidOverrideDifferentDefaultValues_positional() async {
Source source = addSource(r'''
class A {
m([int p = 0]) {}
@@ -2794,11 +2798,11 @@ class A {
class B extends A {
m([int p = 0]) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideDifferentDefaultValues_positional_changedOrder() {
+ test_invalidOverrideDifferentDefaultValues_positional_changedOrder() async {
Source source = addSource(r'''
class A {
m([int a = 0, String b = '0']) {}
@@ -2806,11 +2810,11 @@ class A {
class B extends A {
m([int b = 0, String a = '0']) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideDifferentDefaultValues_positional_function() {
+ test_invalidOverrideDifferentDefaultValues_positional_function() async {
Source source = addSource(r'''
nothing() => 'nothing';
class A {
@@ -2819,11 +2823,11 @@ class A {
class B extends A {
thing(String a, [orElse = nothing]) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideNamed_unorderedNamedParameter() {
+ test_invalidOverrideNamed_unorderedNamedParameter() async {
Source source = addSource(r'''
class A {
m({a, b}) {}
@@ -2831,11 +2835,11 @@ class A {
class B extends A {
m({b, a}) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideRequired_less() {
+ test_invalidOverrideRequired_less() async {
Source source = addSource(r'''
class A {
m(a, b) {}
@@ -2843,11 +2847,11 @@ class A {
class B extends A {
m(a, [b]) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideRequired_same() {
+ test_invalidOverrideRequired_same() async {
Source source = addSource(r'''
class A {
m(a) {}
@@ -2855,11 +2859,11 @@ class A {
class B extends A {
m(a) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideReturnType_returnType_interface() {
+ test_invalidOverrideReturnType_returnType_interface() async {
Source source = addNamedSource(
"/test.dart",
r'''
@@ -2869,11 +2873,11 @@ abstract class A {
class B implements A {
int m() { return 1; }
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideReturnType_returnType_interface2() {
+ test_invalidOverrideReturnType_returnType_interface2() async {
Source source = addNamedSource(
"/test.dart",
r'''
@@ -2885,11 +2889,11 @@ abstract class B implements A {
class C implements B {
int m() { return 1; }
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideReturnType_returnType_mixin() {
+ test_invalidOverrideReturnType_returnType_mixin() async {
Source source = addNamedSource(
"/test.dart",
r'''
@@ -2899,11 +2903,11 @@ class A {
class B extends Object with A {
int m() { return 1; }
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideReturnType_returnType_parameterizedTypes() {
+ test_invalidOverrideReturnType_returnType_parameterizedTypes() async {
Source source = addSource(r'''
abstract class A<E> {
List<E> m();
@@ -2911,11 +2915,11 @@ abstract class A<E> {
class B extends A<dynamic> {
List<dynamic> m() { return new List<dynamic>(); }
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideReturnType_returnType_sameType() {
+ test_invalidOverrideReturnType_returnType_sameType() async {
Source source = addNamedSource(
"/test.dart",
r'''
@@ -2925,11 +2929,11 @@ class A {
class B extends A {
int m() { return 1; }
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideReturnType_returnType_superclass() {
+ test_invalidOverrideReturnType_returnType_superclass() async {
Source source = addNamedSource(
"/test.dart",
r'''
@@ -2939,11 +2943,11 @@ class A {
class B extends A {
int m() { return 1; }
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideReturnType_returnType_superclass2() {
+ test_invalidOverrideReturnType_returnType_superclass2() async {
Source source = addNamedSource(
"/test.dart",
r'''
@@ -2955,11 +2959,11 @@ class B extends A {
class C extends B {
int m() { return 1; }
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidOverrideReturnType_returnType_void() {
+ test_invalidOverrideReturnType_returnType_void() async {
Source source = addSource(r'''
class A {
void m() {}
@@ -2967,66 +2971,66 @@ class A {
class B extends A {
int m() { return 0; }
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidReferenceToThis_constructor() {
+ test_invalidReferenceToThis_constructor() async {
Source source = addSource(r'''
class A {
A() {
var v = this;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidReferenceToThis_instanceMethod() {
+ test_invalidReferenceToThis_instanceMethod() async {
Source source = addSource(r'''
class A {
m() {
var v = this;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidTypeArgumentForKey() {
+ test_invalidTypeArgumentForKey() async {
Source source = addSource(r'''
class A {
m() {
return const <int, int>{};
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidTypeArgumentInConstList() {
+ test_invalidTypeArgumentInConstList() async {
Source source = addSource(r'''
class A<E> {
m() {
return <E>[];
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invalidTypeArgumentInConstMap() {
+ test_invalidTypeArgumentInConstMap() async {
Source source = addSource(r'''
class A<E> {
m() {
return <String, E>{};
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invocationOfNonFunction_dynamic() {
+ test_invocationOfNonFunction_dynamic() async {
Source source = addSource(r'''
class A {
var f;
@@ -3036,11 +3040,11 @@ class B extends A {
f();
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invocationOfNonFunction_functionTypeTypeParameter() {
+ test_invocationOfNonFunction_functionTypeTypeParameter() async {
Source source = addSource(r'''
typedef void Action<T>(T x);
class C<T, U extends Action<T>> {
@@ -3052,11 +3056,11 @@ class C<T, U extends Action<T>> {
}
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invocationOfNonFunction_getter() {
+ test_invocationOfNonFunction_getter() async {
Source source = addSource(r'''
class A {
var g;
@@ -3065,32 +3069,32 @@ f() {
A a;
a.g();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invocationOfNonFunction_localVariable() {
+ test_invocationOfNonFunction_localVariable() async {
Source source = addSource(r'''
f() {
var g;
g();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invocationOfNonFunction_localVariable_dynamic() {
+ test_invocationOfNonFunction_localVariable_dynamic() async {
Source source = addSource(r'''
f() {}
main() {
var v = f;
v();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invocationOfNonFunction_localVariable_dynamic2() {
+ test_invocationOfNonFunction_localVariable_dynamic2() async {
Source source = addSource(r'''
f() {}
main() {
@@ -3098,21 +3102,21 @@ main() {
v = 1;
v();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invocationOfNonFunction_Object() {
+ test_invocationOfNonFunction_Object() async {
Source source = addSource(r'''
main() {
Object v = null;
v();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_invocationOfNonFunction_proxyOnFunctionClass() {
+ test_invocationOfNonFunction_proxyOnFunctionClass() async {
// 16078
Source source = addSource(r'''
@proxy
@@ -3125,11 +3129,11 @@ main() {
Functor f = new Functor();
f();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_issue_24191() {
+ test_issue_24191() async {
Source source = addSource('''
import 'dart:async';
@@ -3140,20 +3144,20 @@ f(S s) async {
}
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_listElementTypeNotAssignable() {
+ test_listElementTypeNotAssignable() async {
Source source = addSource(r'''
var v1 = <int> [42];
var v2 = const <int> [42];''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_loadLibraryDefined() {
- resolveWithErrors(<String>[
+ test_loadLibraryDefined() async {
+ await resolveWithErrors(<String>[
r'''
library lib1;
foo() => 22;''',
@@ -3165,106 +3169,106 @@ main() {
], <ErrorCode>[]);
}
- void test_local_generator_async() {
+ test_local_generator_async() async {
Source source = addSource('''
f() {
return () async* { yield 0; };
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_local_generator_sync() {
+ test_local_generator_sync() async {
Source source = addSource('''
f() {
return () sync* { yield 0; };
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_mapKeyTypeNotAssignable() {
+ test_mapKeyTypeNotAssignable() async {
Source source = addSource("var v = <String, int > {'a' : 1};");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_memberWithClassName_setter() {
+ test_memberWithClassName_setter() async {
Source source = addSource(r'''
class A {
set A(v) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_methodDeclaration_scope_signature() {
+ test_methodDeclaration_scope_signature() async {
Source source = addSource(r'''
const app = 0;
class A {
foo(@app int app) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_misMatchedGetterAndSetterTypes_instance_sameTypes() {
+ test_misMatchedGetterAndSetterTypes_instance_sameTypes() async {
Source source = addSource(r'''
class C {
int get x => 0;
set x(int v) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_misMatchedGetterAndSetterTypes_instance_unspecifiedGetter() {
+ test_misMatchedGetterAndSetterTypes_instance_unspecifiedGetter() async {
Source source = addSource(r'''
class C {
get x => 0;
set x(String v) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_misMatchedGetterAndSetterTypes_instance_unspecifiedSetter() {
+ test_misMatchedGetterAndSetterTypes_instance_unspecifiedSetter() async {
Source source = addSource(r'''
class C {
int get x => 0;
set x(v) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_misMatchedGetterAndSetterTypes_topLevel_sameTypes() {
+ test_misMatchedGetterAndSetterTypes_topLevel_sameTypes() async {
Source source = addSource(r'''
int get x => 0;
set x(int v) {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_misMatchedGetterAndSetterTypes_topLevel_unspecifiedGetter() {
+ test_misMatchedGetterAndSetterTypes_topLevel_unspecifiedGetter() async {
Source source = addSource(r'''
get x => 0;
set x(String v) {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_misMatchedGetterAndSetterTypes_topLevel_unspecifiedSetter() {
+ test_misMatchedGetterAndSetterTypes_topLevel_unspecifiedSetter() async {
Source source = addSource(r'''
int get x => 0;
set x(v) {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_missingEnumConstantInSwitch_all() {
+ test_missingEnumConstantInSwitch_all() async {
Source source = addSource(r'''
enum E { A, B, C }
@@ -3275,11 +3279,11 @@ f(E e) {
case E.C: break;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_missingEnumConstantInSwitch_default() {
+ test_missingEnumConstantInSwitch_default() async {
Source source = addSource(r'''
enum E { A, B, C }
@@ -3289,11 +3293,11 @@ f(E e) {
default: break;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_mixedReturnTypes_differentScopes() {
+ test_mixedReturnTypes_differentScopes() async {
Source source = addSource(r'''
class C {
m(int x) {
@@ -3304,21 +3308,21 @@ class C {
return 0;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_mixedReturnTypes_ignoreImplicit() {
+ test_mixedReturnTypes_ignoreImplicit() async {
Source source = addSource(r'''
f(bool p) {
if (p) return 42;
// implicit 'return;' is ignored
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_mixedReturnTypes_ignoreImplicit2() {
+ test_mixedReturnTypes_ignoreImplicit2() async {
Source source = addSource(r'''
f(bool p) {
if (p) {
@@ -3328,11 +3332,11 @@ f(bool p) {
}
// implicit 'return;' is ignored
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_mixedReturnTypes_sameKind() {
+ test_mixedReturnTypes_sameKind() async {
Source source = addSource(r'''
class C {
m(int x) {
@@ -3342,31 +3346,31 @@ class C {
return 0;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_mixinDeclaresConstructor() {
+ test_mixinDeclaresConstructor() async {
Source source = addSource(r'''
class A {
m() {}
}
class B extends Object with A {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_mixinDeclaresConstructor_factory() {
+ test_mixinDeclaresConstructor_factory() async {
Source source = addSource(r'''
class A {
factory A() => null;
}
class B extends Object with A {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_mixinInheritsFromNotObject_classDeclaration_extends() {
+ test_mixinInheritsFromNotObject_classDeclaration_extends() async {
AnalysisOptionsImpl options = new AnalysisOptionsImpl();
options.enableSuperMixins = true;
resetWithOptions(options);
@@ -3374,20 +3378,20 @@ class B extends Object with A {}''');
class A {}
class B extends A {}
class C extends Object with B {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_mixinInheritsFromNotObject_classDeclaration_mixTypeAlias() {
+ test_mixinInheritsFromNotObject_classDeclaration_mixTypeAlias() async {
Source source = addSource(r'''
class A {}
class B = Object with A;
class C extends Object with B {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_mixinInheritsFromNotObject_classDeclaration_with() {
+ test_mixinInheritsFromNotObject_classDeclaration_with() async {
AnalysisOptionsImpl options = new AnalysisOptionsImpl();
options.enableSuperMixins = true;
resetWithOptions(options);
@@ -3395,11 +3399,11 @@ class C extends Object with B {}''');
class A {}
class B extends Object with A {}
class C extends Object with B {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_mixinInheritsFromNotObject_typeAlias_extends() {
+ test_mixinInheritsFromNotObject_typeAlias_extends() async {
AnalysisOptionsImpl options = new AnalysisOptionsImpl();
options.enableSuperMixins = true;
resetWithOptions(options);
@@ -3407,11 +3411,11 @@ class C extends Object with B {}''');
class A {}
class B extends A {}
class C = Object with B;''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_mixinInheritsFromNotObject_typeAlias_with() {
+ test_mixinInheritsFromNotObject_typeAlias_with() async {
AnalysisOptionsImpl options = new AnalysisOptionsImpl();
options.enableSuperMixins = true;
resetWithOptions(options);
@@ -3419,20 +3423,20 @@ class C = Object with B;''');
class A {}
class B extends Object with A {}
class C = Object with B;''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_mixinInheritsFromNotObject_typedef_mixTypeAlias() {
+ test_mixinInheritsFromNotObject_typedef_mixTypeAlias() async {
Source source = addSource(r'''
class A {}
class B = Object with A;
class C = Object with B;''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_mixinReferencesSuper() {
+ test_mixinReferencesSuper() async {
AnalysisOptionsImpl options = new AnalysisOptionsImpl();
options.enableSuperMixins = true;
resetWithOptions(options);
@@ -3441,50 +3445,50 @@ class A {
toString() => super.toString();
}
class B extends Object with A {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_multipleSuperInitializers_no() {
+ test_multipleSuperInitializers_no() async {
Source source = addSource(r'''
class A {}
class B extends A {
B() {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_multipleSuperInitializers_single() {
+ test_multipleSuperInitializers_single() async {
Source source = addSource(r'''
class A {}
class B extends A {
B() : super() {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nativeConstConstructor() {
+ test_nativeConstConstructor() async {
Source source = addSource(r'''
import 'dart-ext:x';
class Foo {
const Foo() native 'Foo_Foo';
const factory Foo.foo() native 'Foo_Foo_foo';
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
// Cannot verify the AST because the import's URI cannot be resolved.
}
- void test_nativeFunctionBodyInNonSDKCode_function() {
+ test_nativeFunctionBodyInNonSDKCode_function() async {
Source source = addSource(r'''
import 'dart-ext:x';
int m(a) native 'string';''');
- assertNoErrors(source);
+ await assertNoErrors(source);
// Cannot verify the AST because the import's URI cannot be resolved.
}
- void test_newWithAbstractClass_factory() {
+ test_newWithAbstractClass_factory() async {
Source source = addSource(r'''
abstract class A {
factory A() { return new B(); }
@@ -3495,11 +3499,11 @@ class B implements A {
A f() {
return new A();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_newWithUndefinedConstructor() {
+ test_newWithUndefinedConstructor() async {
Source source = addSource(r'''
class A {
A.name() {}
@@ -3507,11 +3511,11 @@ class A {
f() {
new A.name();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_newWithUndefinedConstructorDefault() {
+ test_newWithUndefinedConstructorDefault() async {
Source source = addSource(r'''
class A {
A() {}
@@ -3519,12 +3523,11 @@ class A {
f() {
new A();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void
- test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_getter() {
+ test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_getter() async {
Source source = addSource(r'''
class A {
int get g => 0;
@@ -3533,12 +3536,11 @@ abstract class B extends A {
int get g;
}
class C extends B {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void
- test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_method() {
+ test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_method() async {
Source source = addSource(r'''
class A {
m(p) {}
@@ -3547,12 +3549,11 @@ abstract class B extends A {
m(p);
}
class C extends B {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void
- test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_setter() {
+ test_nonAbstractClassInheritsAbstractMemberOne_abstractsDontOverrideConcretes_setter() async {
Source source = addSource(r'''
class A {
set s(v) {}
@@ -3561,12 +3562,11 @@ abstract class B extends A {
set s(v);
}
class C extends B {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void
- test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_interface() {
+ test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_interface() async {
// 15979
Source source = addSource(r'''
abstract class M {}
@@ -3575,11 +3575,11 @@ abstract class I {
m();
}
abstract class B = A with M implements I;''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_mixin() {
+ test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_mixin() async {
// 15979
Source source = addSource(r'''
abstract class M {
@@ -3587,12 +3587,11 @@ abstract class M {
}
abstract class A {}
abstract class B = A with M;''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void
- test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_superclass() {
+ test_nonAbstractClassInheritsAbstractMemberOne_classTypeAlias_superclass() async {
// 15979
Source source = addSource(r'''
class M {}
@@ -3600,11 +3599,11 @@ abstract class A {
m();
}
abstract class B = A with M;''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonAbstractClassInheritsAbstractMemberOne_mixin_getter() {
+ test_nonAbstractClassInheritsAbstractMemberOne_mixin_getter() async {
// 17034
Source source = addSource(r'''
class A {
@@ -3615,11 +3614,11 @@ abstract class M {
}
class B extends A with M {}
class C extends B {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonAbstractClassInheritsAbstractMemberOne_mixin_method() {
+ test_nonAbstractClassInheritsAbstractMemberOne_mixin_method() async {
Source source = addSource(r'''
class A {
m() {}
@@ -3629,11 +3628,11 @@ abstract class M {
}
class B extends A with M {}
class C extends B {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonAbstractClassInheritsAbstractMemberOne_mixin_setter() {
+ test_nonAbstractClassInheritsAbstractMemberOne_mixin_setter() async {
Source source = addSource(r'''
class A {
var a;
@@ -3643,11 +3642,11 @@ abstract class M {
}
class B extends A with M {}
class C extends B {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_accessor() {
+ test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_accessor() async {
Source source = addSource(r'''
abstract class A {
int get g;
@@ -3655,11 +3654,11 @@ abstract class A {
class B extends A {
noSuchMethod(v) => '';
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_method() {
+ test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_method() async {
Source source = addSource(r'''
abstract class A {
m(p);
@@ -3667,11 +3666,11 @@ abstract class A {
class B extends A {
noSuchMethod(v) => '';
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_mixin() {
+ test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_mixin() async {
Source source = addSource(r'''
class A {
noSuchMethod(v) => '';
@@ -3679,12 +3678,11 @@ class A {
class B extends Object with A {
m(p);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void
- test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_superclass() {
+ test_nonAbstractClassInheritsAbstractMemberOne_noSuchMethod_superclass() async {
Source source = addSource(r'''
class A {
noSuchMethod(v) => '';
@@ -3692,42 +3690,41 @@ class A {
class B extends A {
m(p);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void
- test_nonAbstractClassInheritsAbstractMemberOne_overridesMethodInObject() {
+ test_nonAbstractClassInheritsAbstractMemberOne_overridesMethodInObject() async {
Source source = addSource(r'''
class A {
String toString([String prefix = '']) => '${prefix}Hello';
}
class C {}
class B extends A with C {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonBoolExpression_functionType() {
+ test_nonBoolExpression_functionType() async {
Source source = addSource(r'''
bool makeAssertion() => true;
f() {
assert(makeAssertion);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonBoolExpression_interfaceType() {
+ test_nonBoolExpression_interfaceType() async {
Source source = addSource(r'''
f() {
assert(true);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonBoolNegationExpression() {
+ test_nonBoolNegationExpression() async {
Source source = addSource(r'''
f(bool pb, pd) {
!true;
@@ -3735,11 +3732,11 @@ f(bool pb, pd) {
!pb;
!pd;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonBoolNegationExpression_dynamic() {
+ test_nonBoolNegationExpression_dynamic() async {
Source source = addSource(r'''
f1(bool dynamic) {
!dynamic;
@@ -3749,103 +3746,103 @@ f2() {
!dynamic;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonBoolOperand_and_bool() {
+ test_nonBoolOperand_and_bool() async {
Source source = addSource(r'''
bool f(bool left, bool right) {
return left && right;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonBoolOperand_and_dynamic() {
+ test_nonBoolOperand_and_dynamic() async {
Source source = addSource(r'''
bool f(left, dynamic right) {
return left && right;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonBoolOperand_or_bool() {
+ test_nonBoolOperand_or_bool() async {
Source source = addSource(r'''
bool f(bool left, bool right) {
return left || right;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonBoolOperand_or_dynamic() {
+ test_nonBoolOperand_or_dynamic() async {
Source source = addSource(r'''
bool f(dynamic left, right) {
return left || right;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstantDefaultValue_constField() {
+ test_nonConstantDefaultValue_constField() async {
Source source = addSource(r'''
f([a = double.INFINITY]) {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstantDefaultValue_function_named() {
+ test_nonConstantDefaultValue_function_named() async {
Source source = addSource("f({x : 2 + 3}) {}");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstantDefaultValue_function_positional() {
+ test_nonConstantDefaultValue_function_positional() async {
Source source = addSource("f([x = 2 + 3]) {}");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstantDefaultValue_inConstructor_named() {
+ test_nonConstantDefaultValue_inConstructor_named() async {
Source source = addSource(r'''
class A {
A({x : 2 + 3}) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstantDefaultValue_inConstructor_positional() {
+ test_nonConstantDefaultValue_inConstructor_positional() async {
Source source = addSource(r'''
class A {
A([x = 2 + 3]) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstantDefaultValue_method_named() {
+ test_nonConstantDefaultValue_method_named() async {
Source source = addSource(r'''
class A {
m({x : 2 + 3}) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstantDefaultValue_method_positional() {
+ test_nonConstantDefaultValue_method_positional() async {
Source source = addSource(r'''
class A {
m([x = 2 + 3]) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstantDefaultValue_typedConstList() {
+ test_nonConstantDefaultValue_typedConstList() async {
Source source = addSource(r'''
class A {
m([p111 = const <String>[]]) {}
@@ -3853,11 +3850,11 @@ class A {
class B extends A {
m([p222 = const <String>[]]) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstantValueInInitializer_namedArgument() {
+ test_nonConstantValueInInitializer_namedArgument() async {
Source source = addSource(r'''
class A {
final a;
@@ -3866,11 +3863,11 @@ class A {
class B extends A {
const B({b}) : super(a: b);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstCaseExpression_constField() {
+ test_nonConstCaseExpression_constField() async {
Source source = addSource(r'''
f(double p) {
switch (p) {
@@ -3880,12 +3877,12 @@ f(double p) {
return false;
}
}''');
- assertErrors(
+ await assertErrors(
source, [CompileTimeErrorCode.CASE_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
verify([source]);
}
- void test_nonConstCaseExpression_typeLiteral() {
+ test_nonConstCaseExpression_typeLiteral() async {
Source source = addSource(r'''
f(Type t) {
switch (t) {
@@ -3896,66 +3893,66 @@ f(Type t) {
return false;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstListElement_constField() {
+ test_nonConstListElement_constField() async {
Source source = addSource(r'''
main() {
const [double.INFINITY];
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstMapAsExpressionStatement_const() {
+ test_nonConstMapAsExpressionStatement_const() async {
Source source = addSource(r'''
f() {
const {'a' : 0, 'b' : 1};
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstMapAsExpressionStatement_notExpressionStatement() {
+ test_nonConstMapAsExpressionStatement_notExpressionStatement() async {
Source source = addSource(r'''
f() {
var m = {'a' : 0, 'b' : 1};
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstMapAsExpressionStatement_typeArguments() {
+ test_nonConstMapAsExpressionStatement_typeArguments() async {
Source source = addSource(r'''
f() {
<String, int> {'a' : 0, 'b' : 1};
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstMapKey_constField() {
+ test_nonConstMapKey_constField() async {
Source source = addSource(r'''
main() {
const {double.INFINITY: 0};
}''');
- assertErrors(source,
+ await assertErrors(source,
[CompileTimeErrorCode.CONST_MAP_KEY_EXPRESSION_TYPE_IMPLEMENTS_EQUALS]);
verify([source]);
}
- void test_nonConstMapValue_constField() {
+ test_nonConstMapValue_constField() async {
Source source = addSource(r'''
main() {
const {0: double.INFINITY};
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstValueInInitializer_binary_bool() {
+ test_nonConstValueInInitializer_binary_bool() async {
Source source = addSource(r'''
class A {
final v;
@@ -3964,11 +3961,11 @@ class A {
const A.b1(bool p) : v = p || true;
const A.b2(bool p) : v = true || p;
}''');
- assertErrors(source, [HintCode.DEAD_CODE]);
+ await assertErrors(source, [HintCode.DEAD_CODE]);
verify([source]);
}
- void test_nonConstValueInInitializer_binary_dynamic() {
+ test_nonConstValueInInitializer_binary_dynamic() async {
Source source = addSource(r'''
class A {
final v;
@@ -3993,11 +3990,11 @@ class A {
const A.j1(p) : v = p % 5;
const A.j2(p) : v = 5 % p;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
// operations on "p" are not resolved
}
- void test_nonConstValueInInitializer_binary_int() {
+ test_nonConstValueInInitializer_binary_int() async {
Source source = addSource(r'''
class A {
final v;
@@ -4012,11 +4009,11 @@ class A {
const A.e1(int p) : v = p << 5;
const A.e2(int p) : v = 5 << p;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstValueInInitializer_binary_num() {
+ test_nonConstValueInInitializer_binary_num() async {
Source source = addSource(r'''
class A {
final v;
@@ -4041,31 +4038,31 @@ class A {
const A.j1(num p) : v = p % 5;
const A.j2(num p) : v = 5 % p;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstValueInInitializer_field() {
+ test_nonConstValueInInitializer_field() async {
Source source = addSource(r'''
class A {
final int a;
const A() : a = 5;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstValueInInitializer_redirecting() {
+ test_nonConstValueInInitializer_redirecting() async {
Source source = addSource(r'''
class A {
const A.named(p);
const A() : this.named(42);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstValueInInitializer_super() {
+ test_nonConstValueInInitializer_super() async {
Source source = addSource(r'''
class A {
const A(p);
@@ -4073,11 +4070,11 @@ class A {
class B extends A {
const B() : super(42);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonConstValueInInitializer_unary() {
+ test_nonConstValueInInitializer_unary() async {
Source source = addSource(r'''
class A {
final v;
@@ -4085,11 +4082,11 @@ class A {
const A.b(int p) : v = ~p;
const A.c(num p) : v = -p;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonGenerativeConstructor() {
+ test_nonGenerativeConstructor() async {
Source source = addSource(r'''
class A {
A.named() {}
@@ -4098,22 +4095,22 @@ class A {
class B extends A {
B() : super.named();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonTypeInCatchClause_isClass() {
+ test_nonTypeInCatchClause_isClass() async {
Source source = addSource(r'''
f() {
try {
} on String catch (e) {
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonTypeInCatchClause_isFunctionTypeAlias() {
+ test_nonTypeInCatchClause_isFunctionTypeAlias() async {
Source source = addSource(r'''
typedef F();
f() {
@@ -4121,11 +4118,11 @@ f() {
} on F catch (e) {
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonTypeInCatchClause_isTypeParameter() {
+ test_nonTypeInCatchClause_isTypeParameter() async {
Source source = addSource(r'''
class A<T> {
f() {
@@ -4134,105 +4131,105 @@ class A<T> {
}
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonTypeInCatchClause_noType() {
+ test_nonTypeInCatchClause_noType() async {
Source source = addSource(r'''
f() {
try {
} catch (e) {
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonVoidReturnForOperator_no() {
+ test_nonVoidReturnForOperator_no() async {
Source source = addSource(r'''
class A {
operator []=(a, b) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonVoidReturnForOperator_void() {
+ test_nonVoidReturnForOperator_void() async {
Source source = addSource(r'''
class A {
void operator []=(a, b) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonVoidReturnForSetter_function_no() {
+ test_nonVoidReturnForSetter_function_no() async {
Source source = addSource("set x(v) {}");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonVoidReturnForSetter_function_void() {
+ test_nonVoidReturnForSetter_function_void() async {
Source source = addSource("void set x(v) {}");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonVoidReturnForSetter_method_no() {
+ test_nonVoidReturnForSetter_method_no() async {
Source source = addSource(r'''
class A {
set x(v) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_nonVoidReturnForSetter_method_void() {
+ test_nonVoidReturnForSetter_method_void() async {
Source source = addSource(r'''
class A {
void set x(v) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_null_callMethod() {
+ test_null_callMethod() async {
Source source = addSource(r'''
main() {
null.m();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
}
- void test_null_callOperator() {
+ test_null_callOperator() async {
Source source = addSource(r'''
main() {
null + 5;
null == 5;
null[0];
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
}
- void test_optionalParameterInOperator_required() {
+ test_optionalParameterInOperator_required() async {
Source source = addSource(r'''
class A {
operator +(p) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_parameterDefaultDoesNotReferToParameterName() {
+ test_parameterDefaultDoesNotReferToParameterName() async {
// The final "f" should refer to the toplevel function "f", not to the
// parameter called "f". See dartbug.com/13179.
Source source = addSource('void f([void f([x]) = f]) {}');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_parameterScope_local() {
+ test_parameterScope_local() async {
// Parameter names shouldn't conflict with the name of the function they
// are enclosed in.
Source source = addSource(r'''
@@ -4243,11 +4240,11 @@ f() {
}
h(x) {}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_parameterScope_method() {
+ test_parameterScope_method() async {
// Parameter names shouldn't conflict with the name of the function they
// are enclosed in.
Source source = addSource(r'''
@@ -4258,11 +4255,11 @@ class C {
}
h(x) {}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_parameterScope_toplevel() {
+ test_parameterScope_toplevel() async {
// Parameter names shouldn't conflict with the name of the function they
// are enclosed in.
Source source = addSource(r'''
@@ -4271,11 +4268,11 @@ g(g) {
}
h(x) {}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_prefixCollidesWithTopLevelMembers() {
+ test_prefixCollidesWithTopLevelMembers() async {
addNamedSource(
"/lib.dart",
r'''
@@ -4288,21 +4285,21 @@ p2() {}
var p3;
class p4 {}
p.A a;''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_propagateTypeArgs_intoBounds() {
+ test_propagateTypeArgs_intoBounds() async {
Source source = addSource(r'''
abstract class A<E> {}
abstract class B<F> implements A<F>{}
abstract class C<G, H extends A<G>> {}
class D<I> extends C<I, B<I>> {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_propagateTypeArgs_intoSupertype() {
+ test_propagateTypeArgs_intoSupertype() async {
Source source = addSource(r'''
class A<T> {
A(T p);
@@ -4312,11 +4309,11 @@ class B<S> extends A<S> {
B(S p) : super(p);
B.named(S p) : super.named(p);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_proxy_annotation_prefixed() {
+ test_proxy_annotation_prefixed() async {
Source source = addSource(r'''
library L;
@proxy
@@ -4329,10 +4326,10 @@ f(A a) {
a++;
++a;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
}
- void test_proxy_annotation_prefixed2() {
+ test_proxy_annotation_prefixed2() async {
Source source = addSource(r'''
library L;
@proxy
@@ -4347,10 +4344,10 @@ class B {
++a;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
}
- void test_proxy_annotation_prefixed3() {
+ test_proxy_annotation_prefixed3() async {
Source source = addSource(r'''
library L;
class B {
@@ -4365,10 +4362,10 @@ class B {
}
@proxy
class A {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
}
- void test_proxy_annotation_proxyHasPrefixedIdentifier() {
+ test_proxy_annotation_proxyHasPrefixedIdentifier() async {
Source source = addSource(r'''
library L;
import 'dart:core' as core;
@@ -4377,10 +4374,10 @@ main() {
new PrefixProxy().foo;
new PrefixProxy().foo();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
}
- void test_proxy_annotation_simple() {
+ test_proxy_annotation_simple() async {
Source source = addSource(r'''
library L;
@proxy
@@ -4392,10 +4389,10 @@ class B {
var y = this + this;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
}
- void test_proxy_annotation_superclass() {
+ test_proxy_annotation_superclass() async {
Source source = addSource(r'''
library L;
class B extends A {
@@ -4408,10 +4405,10 @@ class B extends A {
}
@proxy
class A {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
}
- void test_proxy_annotation_superclass_mixin() {
+ test_proxy_annotation_superclass_mixin() async {
Source source = addSource(r'''
library L;
class B extends Object with A {
@@ -4424,10 +4421,10 @@ class B extends Object with A {
}
@proxy
class A {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
}
- void test_proxy_annotation_superinterface() {
+ test_proxy_annotation_superinterface() async {
Source source = addSource(r'''
library L;
class B implements A {
@@ -4440,10 +4437,10 @@ class B implements A {
}
@proxy
class A {}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
}
- void test_proxy_annotation_superinterface_infiniteLoop() {
+ test_proxy_annotation_superinterface_infiniteLoop() async {
addSource(r'''
library L;
class C implements A {
@@ -4460,18 +4457,18 @@ class A implements B{}''');
// (previous line), no need to assert error set.
}
- void test_recursiveConstructorRedirect() {
+ test_recursiveConstructorRedirect() async {
Source source = addSource(r'''
class A {
A.a() : this.b();
A.b() : this.c();
A.c() {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_recursiveFactoryRedirect() {
+ test_recursiveFactoryRedirect() async {
Source source = addSource(r'''
class A {
factory A() = B;
@@ -4482,11 +4479,11 @@ class B implements A {
class C implements B {
factory C() => null;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_redirectToInvalidFunctionType() {
+ test_redirectToInvalidFunctionType() async {
Source source = addSource(r'''
class A implements B {
A(int p) {}
@@ -4494,11 +4491,11 @@ class A implements B {
class B {
factory B(int p) = A;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_redirectToInvalidReturnType() {
+ test_redirectToInvalidReturnType() async {
Source source = addSource(r'''
class A {
A() {}
@@ -4506,21 +4503,21 @@ class A {
class B extends A {
factory B() = A;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_redirectToNonConstConstructor() {
+ test_redirectToNonConstConstructor() async {
Source source = addSource(r'''
class A {
const A.a();
const factory A.b() = A.a;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_referencedBeforeDeclaration_cascade() {
+ test_referencedBeforeDeclaration_cascade() async {
Source source = addSource(r'''
testRequestHandler() {}
@@ -4531,11 +4528,11 @@ main() {
var stream = 123;
print(stream);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_referenceToDeclaredVariableInInitializer_constructorName() {
+ test_referenceToDeclaredVariableInInitializer_constructorName() async {
Source source = addSource(r'''
class A {
A.x() {}
@@ -4543,11 +4540,11 @@ class A {
f() {
var x = new A.x();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_referenceToDeclaredVariableInInitializer_methodName() {
+ test_referenceToDeclaredVariableInInitializer_methodName() async {
Source source = addSource(r'''
class A {
x() {}
@@ -4555,11 +4552,11 @@ class A {
f(A a) {
var x = a.x();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_referenceToDeclaredVariableInInitializer_propertyName() {
+ test_referenceToDeclaredVariableInInitializer_propertyName() async {
Source source = addSource(r'''
class A {
var x;
@@ -4567,70 +4564,70 @@ class A {
f(A a) {
var x = a.x;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_rethrowOutsideCatch() {
+ test_rethrowOutsideCatch() async {
Source source = addSource(r'''
class A {
void m() {
try {} catch (e) {rethrow;}
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_return_in_generator_async() {
+ test_return_in_generator_async() async {
Source source = addSource('''
import 'dart:async';
Stream<int> f() async* {
return;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_return_in_generator_sync() {
+ test_return_in_generator_sync() async {
Source source = addSource('''
Iterable<int> f() sync* {
return;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_returnInGenerativeConstructor() {
+ test_returnInGenerativeConstructor() async {
Source source = addSource(r'''
class A {
A() { return; }
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_returnInGenerator_async() {
+ test_returnInGenerator_async() async {
Source source = addSource(r'''
f() async {
return 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_returnInGenerator_sync() {
+ test_returnInGenerator_sync() async {
Source source = addSource(r'''
f() {
return 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_returnOfInvalidType_async() {
+ test_returnOfInvalidType_async() async {
Source source = addSource(r'''
import 'dart:async';
class A {
@@ -4638,11 +4635,11 @@ class A {
return 0;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_returnOfInvalidType_dynamic() {
+ test_returnOfInvalidType_dynamic() async {
Source source = addSource(r'''
class TypeError {}
class A {
@@ -4656,40 +4653,40 @@ class A {
}
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_returnOfInvalidType_dynamicAsTypeArgument() {
+ test_returnOfInvalidType_dynamicAsTypeArgument() async {
Source source = addSource(r'''
class I<T> {
factory I() => new A<T>();
}
class A<T> implements I {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_returnOfInvalidType_subtype() {
+ test_returnOfInvalidType_subtype() async {
Source source = addSource(r'''
class A {}
class B extends A {}
A f(B b) { return b; }''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_returnOfInvalidType_supertype() {
+ test_returnOfInvalidType_supertype() async {
Source source = addSource(r'''
class A {}
class B extends A {}
B f(A a) { return a; }''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_returnOfInvalidType_typeParameter_18468() {
+ test_returnOfInvalidType_typeParameter_18468() async {
// https://code.google.com/p/dart/issues/detail?id=18468
//
// This test verifies that the type of T is more specific than Type,
@@ -4704,11 +4701,11 @@ B f(A a) { return a; }''');
class Foo<T> {
Type get t => T;
}''');
- assertErrors(source);
+ await assertErrors(source);
verify([source]);
}
- void test_returnOfInvalidType_void() {
+ test_returnOfInvalidType_void() async {
Source source = addSource(r'''
void f1() {}
void f2() { return; }
@@ -4718,23 +4715,23 @@ void f5() { return g2(); }
g1() {}
void g2() {}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_returnWithoutValue_noReturnType() {
+ test_returnWithoutValue_noReturnType() async {
Source source = addSource("f() { return; }");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_returnWithoutValue_void() {
+ test_returnWithoutValue_void() async {
Source source = addSource("void f() { return; }");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_reversedTypeArguments() {
+ test_reversedTypeArguments() async {
Source source = addSource(r'''
class Codec<S1, T1> {
Codec<T1, S1> get inverted => new _InvertedCodec<T1, S1>(this);
@@ -4742,12 +4739,12 @@ class Codec<S1, T1> {
class _InvertedCodec<T2, S2> extends Codec<T2, S2> {
_InvertedCodec(Codec<S2, T2> codec);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_sharedDeferredPrefix() {
- resolveWithErrors(<String>[
+ test_sharedDeferredPrefix() async {
+ await resolveWithErrors(<String>[
r'''
library lib1;
f1() {}''',
@@ -4766,7 +4763,7 @@ main() { lib1.f1(); lib.f2(); lib.f3(); }'''
], <ErrorCode>[]);
}
- void test_staticAccessToInstanceMember_annotation() {
+ test_staticAccessToInstanceMember_annotation() async {
Source source = addSource(r'''
class A {
const A.name();
@@ -4774,11 +4771,11 @@ class A {
@A.name()
main() {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_staticAccessToInstanceMember_method() {
+ test_staticAccessToInstanceMember_method() async {
Source source = addSource(r'''
class A {
static m() {}
@@ -4787,11 +4784,11 @@ main() {
A.m;
A.m();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_staticAccessToInstanceMember_propertyAccess_field() {
+ test_staticAccessToInstanceMember_propertyAccess_field() async {
Source source = addSource(r'''
class A {
static var f;
@@ -4800,11 +4797,11 @@ main() {
A.f;
A.f = 1;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_staticAccessToInstanceMember_propertyAccess_propertyAccessor() {
+ test_staticAccessToInstanceMember_propertyAccess_propertyAccessor() async {
Source source = addSource(r'''
class A {
static get f => 42;
@@ -4814,11 +4811,11 @@ main() {
A.f;
A.f = 1;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_superInInvalidContext() {
+ test_superInInvalidContext() async {
Source source = addSource(r'''
class A {
m() {}
@@ -4831,21 +4828,21 @@ class B extends A {
var v = super.m();
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typeAliasCannotReferenceItself_returnClass_withTypeAlias() {
+ test_typeAliasCannotReferenceItself_returnClass_withTypeAlias() async {
Source source = addSource(r'''
typedef B A();
class B {
A a;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typeArgumentNotMatchingBounds_const() {
+ test_typeArgumentNotMatchingBounds_const() async {
Source source = addSource(r'''
class A {}
class B extends A {}
@@ -4853,21 +4850,21 @@ class G<E extends A> {
const G();
}
f() { return const G<B>(); }''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typeArgumentNotMatchingBounds_new() {
+ test_typeArgumentNotMatchingBounds_new() async {
Source source = addSource(r'''
class A {}
class B extends A {}
class G<E extends A> {}
f() { return new G<B>(); }''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_hasBound() {
+ test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_hasBound() async {
Source source = addSource(r'''
class A {}
class B extends A {}
@@ -4875,11 +4872,11 @@ typedef F<T extends A>();
F<A> fa;
F<B> fb;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_hasBound2() {
+ test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_hasBound2() async {
Source source = addSource(r'''
class MyClass<T> {}
typedef MyFunction<T, P extends MyClass<T>>();
@@ -4887,60 +4884,59 @@ class A<T, P extends MyClass<T>> {
MyFunction<T, P> f;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_noBound() {
+ test_typeArgumentNotMatchingBounds_ofFunctionTypeAlias_noBound() async {
Source source = addSource(r'''
typedef F<T>();
F<int> f1;
F<String> f2;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typeArgumentNotMatchingBounds_typeArgumentList_0() {
+ test_typeArgumentNotMatchingBounds_typeArgumentList_0() async {
Source source = addSource("abstract class A<T extends A>{}");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typeArgumentNotMatchingBounds_typeArgumentList_1() {
+ test_typeArgumentNotMatchingBounds_typeArgumentList_1() async {
Source source = addSource("abstract class A<T extends A<A>>{}");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typeArgumentNotMatchingBounds_typeArgumentList_20() {
+ test_typeArgumentNotMatchingBounds_typeArgumentList_20() async {
Source source = addSource(
"abstract class A<T extends A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A<A>>>>>>>>>>>>>>>>>>>>>{}");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_booleanAnd_useInRight() {
+ test_typePromotion_booleanAnd_useInRight() async {
Source source = addSource(r'''
main(Object p) {
p is String && p.length != 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void
- test_typePromotion_booleanAnd_useInRight_accessedInClosureRight_noAssignment() {
+ test_typePromotion_booleanAnd_useInRight_accessedInClosureRight_noAssignment() async {
Source source = addSource(r'''
callMe(f()) { f(); }
main(Object p) {
(p is String) && callMe(() { p.length; });
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_conditional_issue14655() {
+ test_typePromotion_conditional_issue14655() async {
Source source = addSource(r'''
class A {}
class B extends A {}
@@ -4951,31 +4947,30 @@ print(_) {}
main(A p) {
(p is C) && (print(() => p) && (p is B)) ? p.mc() : p = null;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_conditional_useInThen() {
+ test_typePromotion_conditional_useInThen() async {
Source source = addSource(r'''
main(Object p) {
p is String ? p.length : 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void
- test_typePromotion_conditional_useInThen_accessedInClosure_noAssignment() {
+ test_typePromotion_conditional_useInThen_accessedInClosure_noAssignment() async {
Source source = addSource(r'''
callMe(f()) { f(); }
main(Object p) {
p is String ? callMe(() { p.length; }) : 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_functionType_arg_ignoreIfNotMoreSpecific() {
+ test_typePromotion_functionType_arg_ignoreIfNotMoreSpecific() async {
Source source = addSource(r'''
typedef FuncB(B b);
typedef FuncA(A a);
@@ -4986,11 +4981,11 @@ main(FuncA f) {
f(new A());
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_functionType_return_ignoreIfNotMoreSpecific() {
+ test_typePromotion_functionType_return_ignoreIfNotMoreSpecific() async {
Source source = addSource(r'''
class A {}
typedef FuncAtoDyn(A a);
@@ -5000,11 +4995,11 @@ main(FuncAtoDyn f) {
A a = f(new A());
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_functionType_return_voidToDynamic() {
+ test_typePromotion_functionType_return_voidToDynamic() async {
Source source = addSource(r'''
typedef FuncDynToDyn(x);
typedef void FuncDynToVoid(x);
@@ -5014,11 +5009,11 @@ main(FuncDynToVoid f) {
A a = f(null);
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_if_accessedInClosure_noAssignment() {
+ test_typePromotion_if_accessedInClosure_noAssignment() async {
Source source = addSource(r'''
callMe(f()) { f(); }
main(Object p) {
@@ -5028,11 +5023,11 @@ main(Object p) {
});
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_if_extends_moreSpecific() {
+ test_typePromotion_if_extends_moreSpecific() async {
Source source = addSource(r'''
class V {}
class VP extends V {}
@@ -5046,11 +5041,11 @@ main(A<V> p) {
p.b;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_if_hasAssignment_outsideAfter() {
+ test_typePromotion_if_hasAssignment_outsideAfter() async {
Source source = addSource(r'''
main(Object p) {
if (p is String) {
@@ -5058,11 +5053,11 @@ main(Object p) {
}
p = 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_if_hasAssignment_outsideBefore() {
+ test_typePromotion_if_hasAssignment_outsideBefore() async {
Source source = addSource(r'''
main(Object p, Object p2) {
p = p2;
@@ -5070,11 +5065,11 @@ main(Object p, Object p2) {
p.length;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_if_implements_moreSpecific() {
+ test_typePromotion_if_implements_moreSpecific() async {
Source source = addSource(r'''
class V {}
class VP extends V {}
@@ -5088,11 +5083,11 @@ main(A<V> p) {
p.b;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_if_inClosure_assignedAfter_inSameFunction() {
+ test_typePromotion_if_inClosure_assignedAfter_inSameFunction() async {
Source source = addSource(r'''
main() {
f(Object p) {
@@ -5102,11 +5097,11 @@ main() {
p = 0;
};
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_if_is_and_left() {
+ test_typePromotion_if_is_and_left() async {
Source source = addSource(r'''
bool tt() => true;
main(Object p) {
@@ -5114,11 +5109,11 @@ main(Object p) {
p.length;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_if_is_and_right() {
+ test_typePromotion_if_is_and_right() async {
Source source = addSource(r'''
bool tt() => true;
main(Object p) {
@@ -5126,11 +5121,11 @@ main(Object p) {
p.length;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_if_is_and_subThenSuper() {
+ test_typePromotion_if_is_and_subThenSuper() async {
Source source = addSource(r'''
class A {
var a;
@@ -5144,33 +5139,33 @@ main(Object p) {
p.b;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_if_is_parenthesized() {
+ test_typePromotion_if_is_parenthesized() async {
Source source = addSource(r'''
main(Object p) {
if ((p is String)) {
p.length;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_if_is_single() {
+ test_typePromotion_if_is_single() async {
Source source = addSource(r'''
main(Object p) {
if (p is String) {
p.length;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typePromotion_parentheses() {
+ test_typePromotion_parentheses() async {
Source source = addSource(r'''
main(Object p) {
(p is String) ? p.length : 0;
@@ -5178,22 +5173,22 @@ main(Object p) {
((p)) is String ? p.length : 0;
((p) is String) ? p.length : 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typeType_class() {
+ test_typeType_class() async {
Source source = addSource(r'''
class C {}
f(Type t) {}
main() {
f(C);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typeType_class_prefixed() {
+ test_typeType_class_prefixed() async {
addNamedSource(
"/lib.dart",
r'''
@@ -5205,22 +5200,22 @@ f(Type t) {}
main() {
f(p.C);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typeType_functionTypeAlias() {
+ test_typeType_functionTypeAlias() async {
Source source = addSource(r'''
typedef F();
f(Type t) {}
main() {
f(F);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_typeType_functionTypeAlias_prefixed() {
+ test_typeType_functionTypeAlias_prefixed() async {
addNamedSource(
"/lib.dart",
r'''
@@ -5232,11 +5227,11 @@ f(Type t) {}
main() {
f(p.F);
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_undefinedConstructorInInitializer_explicit_named() {
+ test_undefinedConstructorInInitializer_explicit_named() async {
Source source = addSource(r'''
class A {
A.named() {}
@@ -5244,11 +5239,11 @@ class A {
class B extends A {
B() : super.named();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_undefinedConstructorInInitializer_explicit_unnamed() {
+ test_undefinedConstructorInInitializer_explicit_unnamed() async {
Source source = addSource(r'''
class A {
A() {}
@@ -5256,11 +5251,11 @@ class A {
class B extends A {
B() : super();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_undefinedConstructorInInitializer_hasOptionalParameters() {
+ test_undefinedConstructorInInitializer_hasOptionalParameters() async {
Source source = addSource(r'''
class A {
A([p]) {}
@@ -5268,11 +5263,11 @@ class A {
class B extends A {
B();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_undefinedConstructorInInitializer_implicit() {
+ test_undefinedConstructorInInitializer_implicit() async {
Source source = addSource(r'''
class A {
A() {}
@@ -5280,22 +5275,22 @@ class A {
class B extends A {
B();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_undefinedConstructorInInitializer_implicit_typeAlias() {
+ test_undefinedConstructorInInitializer_implicit_typeAlias() async {
Source source = addSource(r'''
class M {}
class A = Object with M;
class B extends A {
B();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_undefinedConstructorInInitializer_redirecting() {
+ test_undefinedConstructorInInitializer_redirecting() async {
Source source = addSource(r'''
class Foo {
Foo.ctor();
@@ -5304,11 +5299,11 @@ class Bar extends Foo {
Bar() : this.ctor();
Bar.ctor() : super.ctor();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_undefinedGetter_static_conditionalAccess() {
+ test_undefinedGetter_static_conditionalAccess() async {
// The conditional access operator '?.' can be used to access static
// fields.
Source source = addSource('''
@@ -5317,11 +5312,11 @@ class A {
}
var a = A?.x;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_undefinedGetter_typeSubstitution() {
+ test_undefinedGetter_typeSubstitution() async {
Source source = addSource(r'''
class A<E> {
E element;
@@ -5331,47 +5326,47 @@ class B extends A<List> {
element.last;
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_undefinedIdentifier_synthetic_whenExpression() {
+ test_undefinedIdentifier_synthetic_whenExpression() async {
Source source = addSource(r'''
print(x) {}
main() {
print(is String);
}''');
- assertErrors(source, [ParserErrorCode.MISSING_IDENTIFIER]);
+ await assertErrors(source, [ParserErrorCode.MISSING_IDENTIFIER]);
}
- void test_undefinedIdentifier_synthetic_whenMethodName() {
+ test_undefinedIdentifier_synthetic_whenMethodName() async {
Source source = addSource(r'''
print(x) {}
main(int p) {
p.();
}''');
- assertErrors(source, [ParserErrorCode.MISSING_IDENTIFIER]);
+ await assertErrors(source, [ParserErrorCode.MISSING_IDENTIFIER]);
}
- void test_undefinedMethod_functionExpression_callMethod() {
+ test_undefinedMethod_functionExpression_callMethod() async {
Source source = addSource(r'''
main() {
(() => null).call();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
// A call to verify(source) fails as '.call()' isn't resolved.
}
- void test_undefinedMethod_functionExpression_directCall() {
+ test_undefinedMethod_functionExpression_directCall() async {
Source source = addSource(r'''
main() {
(() => null)();
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
// A call to verify(source) fails as '(() => null)()' isn't resolved.
}
- void test_undefinedMethod_static_conditionalAccess() {
+ test_undefinedMethod_static_conditionalAccess() async {
// The conditional access operator '?.' can be used to access static
// methods.
Source source = addSource('''
@@ -5380,11 +5375,11 @@ class A {
}
f() { A?.m(); }
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_undefinedOperator_index() {
+ test_undefinedOperator_index() async {
Source source = addSource(r'''
class A {
operator [](a) {}
@@ -5394,19 +5389,19 @@ f(A a) {
a[0];
a[0] = 1;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_undefinedOperator_tilde() {
+ test_undefinedOperator_tilde() async {
Source source = addSource(r'''
const A = 3;
const B = ~((1 << A) - 1);''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_undefinedSetter_importWithPrefix() {
+ test_undefinedSetter_importWithPrefix() async {
addNamedSource(
"/lib.dart",
r'''
@@ -5417,11 +5412,11 @@ import 'lib.dart' as x;
main() {
x.y = 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_undefinedSetter_static_conditionalAccess() {
+ test_undefinedSetter_static_conditionalAccess() async {
// The conditional access operator '?.' can be used to access static
// fields.
Source source = addSource('''
@@ -5430,11 +5425,11 @@ class A {
}
f() { A?.x = 1; }
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_undefinedSuperMethod_field() {
+ test_undefinedSuperMethod_field() async {
Source source = addSource(r'''
class A {
var m;
@@ -5444,11 +5439,11 @@ class B extends A {
super.m();
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_undefinedSuperMethod_method() {
+ test_undefinedSuperMethod_method() async {
Source source = addSource(r'''
class A {
m() {}
@@ -5458,11 +5453,11 @@ class B extends A {
super.m();
}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_unqualifiedReferenceToNonLocalStaticMember_fromComment_new() {
+ test_unqualifiedReferenceToNonLocalStaticMember_fromComment_new() async {
Source source = addSource(r'''
class A {
A() {}
@@ -5471,133 +5466,133 @@ class A {
/// [new A] or [new A.named]
main() {
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_unusedShownName_unresolved() {
+ test_unusedShownName_unresolved() async {
Source source = addSource(r'''
import 'dart:math' show max, FooBar;
main() {
print(max(1, 2));
}
''');
- assertErrors(source, [HintCode.UNDEFINED_SHOWN_NAME]);
+ await assertErrors(source, [HintCode.UNDEFINED_SHOWN_NAME]);
}
- void test_uriDoesNotExist_dll() {
+ test_uriDoesNotExist_dll() async {
addNamedSource("/lib.dll", "");
Source source = addSource("import 'dart-ext:lib';");
- assertNoErrors(source);
+ await assertNoErrors(source);
}
- void test_uriDoesNotExist_dylib() {
+ test_uriDoesNotExist_dylib() async {
addNamedSource("/lib.dylib", "");
Source source = addSource("import 'dart-ext:lib';");
- assertNoErrors(source);
+ await assertNoErrors(source);
}
- void test_uriDoesNotExist_so() {
+ test_uriDoesNotExist_so() async {
addNamedSource("/lib.so", "");
Source source = addSource("import 'dart-ext:lib';");
- assertNoErrors(source);
+ await assertNoErrors(source);
}
- void test_wrongNumberOfParametersForOperator1() {
- _check_wrongNumberOfParametersForOperator1("<");
- _check_wrongNumberOfParametersForOperator1(">");
- _check_wrongNumberOfParametersForOperator1("<=");
- _check_wrongNumberOfParametersForOperator1(">=");
- _check_wrongNumberOfParametersForOperator1("+");
- _check_wrongNumberOfParametersForOperator1("/");
- _check_wrongNumberOfParametersForOperator1("~/");
- _check_wrongNumberOfParametersForOperator1("*");
- _check_wrongNumberOfParametersForOperator1("%");
- _check_wrongNumberOfParametersForOperator1("|");
- _check_wrongNumberOfParametersForOperator1("^");
- _check_wrongNumberOfParametersForOperator1("&");
- _check_wrongNumberOfParametersForOperator1("<<");
- _check_wrongNumberOfParametersForOperator1(">>");
- _check_wrongNumberOfParametersForOperator1("[]");
+ test_wrongNumberOfParametersForOperator1() async {
+ await _check_wrongNumberOfParametersForOperator1("<");
+ await _check_wrongNumberOfParametersForOperator1(">");
+ await _check_wrongNumberOfParametersForOperator1("<=");
+ await _check_wrongNumberOfParametersForOperator1(">=");
+ await _check_wrongNumberOfParametersForOperator1("+");
+ await _check_wrongNumberOfParametersForOperator1("/");
+ await _check_wrongNumberOfParametersForOperator1("~/");
+ await _check_wrongNumberOfParametersForOperator1("*");
+ await _check_wrongNumberOfParametersForOperator1("%");
+ await _check_wrongNumberOfParametersForOperator1("|");
+ await _check_wrongNumberOfParametersForOperator1("^");
+ await _check_wrongNumberOfParametersForOperator1("&");
+ await _check_wrongNumberOfParametersForOperator1("<<");
+ await _check_wrongNumberOfParametersForOperator1(">>");
+ await _check_wrongNumberOfParametersForOperator1("[]");
}
- void test_wrongNumberOfParametersForOperator_index() {
+ test_wrongNumberOfParametersForOperator_index() async {
Source source = addSource(r'''
class A {
operator []=(a, b) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_wrongNumberOfParametersForOperator_minus() {
- _check_wrongNumberOfParametersForOperator("-", "");
- _check_wrongNumberOfParametersForOperator("-", "a");
+ test_wrongNumberOfParametersForOperator_minus() async {
+ await _check_wrongNumberOfParametersForOperator("-", "");
+ await _check_wrongNumberOfParametersForOperator("-", "a");
}
- void test_wrongNumberOfParametersForSetter() {
+ test_wrongNumberOfParametersForSetter() async {
Source source = addSource(r'''
class A {
set x(a) {}
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_async_to_dynamic_type() {
+ test_yield_async_to_dynamic_type() async {
Source source = addSource('''
dynamic f() async* {
yield 3;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_async_to_generic_type() {
+ test_yield_async_to_generic_type() async {
Source source = addSource('''
import 'dart:async';
Stream f() async* {
yield 3;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_async_to_parameterized_type() {
+ test_yield_async_to_parameterized_type() async {
Source source = addSource('''
import 'dart:async';
Stream<int> f() async* {
yield 3;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_async_to_untyped() {
+ test_yield_async_to_untyped() async {
Source source = addSource('''
f() async* {
yield 3;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_each_async_dynamic_to_dynamic() {
+ test_yield_each_async_dynamic_to_dynamic() async {
Source source = addSource('''
f() async* {
yield* g();
}
g() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_each_async_dynamic_to_stream() {
+ test_yield_each_async_dynamic_to_stream() async {
Source source = addSource('''
import 'dart:async';
Stream f() async* {
@@ -5605,11 +5600,11 @@ Stream f() async* {
}
g() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_each_async_dynamic_to_typed_stream() {
+ test_yield_each_async_dynamic_to_typed_stream() async {
Source source = addSource('''
import 'dart:async';
Stream<int> f() async* {
@@ -5617,11 +5612,11 @@ Stream<int> f() async* {
}
g() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_each_async_stream_to_dynamic() {
+ test_yield_each_async_stream_to_dynamic() async {
Source source = addSource('''
import 'dart:async';
f() async* {
@@ -5629,11 +5624,11 @@ f() async* {
}
Stream g() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_each_async_typed_stream_to_dynamic() {
+ test_yield_each_async_typed_stream_to_dynamic() async {
Source source = addSource('''
import 'dart:async';
f() async* {
@@ -5641,11 +5636,11 @@ f() async* {
}
Stream<int> g() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_each_async_typed_stream_to_typed_stream() {
+ test_yield_each_async_typed_stream_to_typed_stream() async {
Source source = addSource('''
import 'dart:async';
Stream<int> f() async* {
@@ -5653,149 +5648,150 @@ Stream<int> f() async* {
}
Stream<int> g() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_each_sync_dynamic_to_dynamic() {
+ test_yield_each_sync_dynamic_to_dynamic() async {
Source source = addSource('''
f() sync* {
yield* g();
}
g() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_each_sync_dynamic_to_iterable() {
+ test_yield_each_sync_dynamic_to_iterable() async {
Source source = addSource('''
Iterable f() sync* {
yield* g();
}
g() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_each_sync_dynamic_to_typed_iterable() {
+ test_yield_each_sync_dynamic_to_typed_iterable() async {
Source source = addSource('''
Iterable<int> f() sync* {
yield* g();
}
g() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_each_sync_iterable_to_dynamic() {
+ test_yield_each_sync_iterable_to_dynamic() async {
Source source = addSource('''
f() sync* {
yield* g();
}
Iterable g() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_each_sync_typed_iterable_to_dynamic() {
+ test_yield_each_sync_typed_iterable_to_dynamic() async {
Source source = addSource('''
f() sync* {
yield* g();
}
Iterable<int> g() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_each_sync_typed_iterable_to_typed_iterable() {
+ test_yield_each_sync_typed_iterable_to_typed_iterable() async {
Source source = addSource('''
Iterable<int> f() sync* {
yield* g();
}
Iterable<int> g() => null;
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_sync_to_dynamic_type() {
+ test_yield_sync_to_dynamic_type() async {
Source source = addSource('''
dynamic f() sync* {
yield 3;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_sync_to_generic_type() {
+ test_yield_sync_to_generic_type() async {
Source source = addSource('''
Iterable f() sync* {
yield 3;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_sync_to_parameterized_type() {
+ test_yield_sync_to_parameterized_type() async {
Source source = addSource('''
Iterable<int> f() sync* {
yield 3;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yield_sync_to_untyped() {
+ test_yield_sync_to_untyped() async {
Source source = addSource('''
f() sync* {
yield 3;
}
''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yieldInNonGenerator_asyncStar() {
+ test_yieldInNonGenerator_asyncStar() async {
Source source = addSource(r'''
f() async* {
yield 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void test_yieldInNonGenerator_syncStar() {
+ test_yieldInNonGenerator_syncStar() async {
Source source = addSource(r'''
f() sync* {
yield 0;
}''');
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
}
- void _check_wrongNumberOfParametersForOperator(
- String name, String parameters) {
+ Future<Null> _check_wrongNumberOfParametersForOperator(
+ String name, String parameters) async {
Source source = addSource("""
class A {
operator $name($parameters) {}
}""");
- assertNoErrors(source);
+ await assertNoErrors(source);
verify([source]);
reset();
}
- void _check_wrongNumberOfParametersForOperator1(String name) {
- _check_wrongNumberOfParametersForOperator(name, "a");
+ Future<Null> _check_wrongNumberOfParametersForOperator1(String name) async {
+ await _check_wrongNumberOfParametersForOperator(name, "a");
}
- CompilationUnit _getResolvedLibraryUnit(Source source) =>
- analysisContext.getResolvedCompilationUnit2(source, source);
+ Future<CompilationUnit> _getResolvedLibraryUnit(Source source) async {
+ return analysisContext.getResolvedCompilationUnit2(source, source);
+ }
}

Powered by Google App Engine
This is Rietveld 408576698