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

Unified Diff: pkg/analyzer/test/src/task/strong/checker_test.dart

Issue 2298913003: Pull in test_reflective_loader 0.0.4 and switch analyzer to it. (Closed)
Patch Set: Fixes for review comments. Created 4 years, 4 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/src/task/strong/checker_test.dart
diff --git a/pkg/analyzer/test/src/task/strong/checker_test.dart b/pkg/analyzer/test/src/task/strong/checker_test.dart
index 4c2d8af7c6a7f850af83a4989fc4648593bb2ef0..3d11558a05f347ee55b3e2dc2059cb001ca97f88 100644
--- a/pkg/analyzer/test/src/task/strong/checker_test.dart
+++ b/pkg/analyzer/test/src/task/strong/checker_test.dart
@@ -4,12 +4,13 @@
library analyzer.test.src.task.strong.checker_test;
-import '../../../reflective_tests.dart';
+import 'package:test_reflective_loader/test_reflective_loader.dart';
+
import 'strong_test_helper.dart';
void main() {
initStrongModeTests();
- runReflectiveTests(CheckerTest);
+ defineReflectiveTests(CheckerTest);
}
@reflectiveTest
@@ -320,6 +321,58 @@ test() {
''');
}
+ void test_constantGenericTypeArg_explict() {
+ // Regression test for https://github.com/dart-lang/sdk/issues/26141
+ checkFile('''
+abstract class Equality<R> {}
+abstract class EqualityBase<R> implements Equality<R> {
+ final C<R> c = const C<R>();
+ const EqualityBase();
+}
+class DefaultEquality<S> extends EqualityBase<S> {
+ const DefaultEquality();
+}
+class SetEquality<T> implements Equality<T> {
+ final Equality<T> field = const DefaultEquality<T>();
+ const SetEquality([Equality<T> inner = const DefaultEquality<T>()]);
+}
+class C<Q> {
+ final List<Q> list = const <Q>[];
+ final Map<Q, Iterable<Q>> m = const <Q, Iterable<Q>>{};
+ const C();
+}
+main() {
+ const SetEquality<String>();
+}
+ ''');
+ }
+
+ void test_constantGenericTypeArg_infer() {
+ // Regression test for https://github.com/dart-lang/sdk/issues/26141
+ checkFile('''
+abstract class Equality<Q> {}
+abstract class EqualityBase<R> implements Equality<R> {
+ final C<R> c = /*info:INFERRED_TYPE_ALLOCATION*/const C();
+ const EqualityBase();
+}
+class DefaultEquality<S> extends EqualityBase<S> {
+ const DefaultEquality();
+}
+class SetEquality<T> implements Equality<T> {
+ final Equality<T> field = const DefaultEquality();
+ const SetEquality([Equality<T> inner = const DefaultEquality()]);
+}
+class C<Q> {
+ final List<Q> list = /*info:INFERRED_TYPE_LITERAL*/const [];
+ final Map<Q, Iterable<Q>> m = /*info:INFERRED_TYPE_LITERAL*/const {};
+ const C();
+}
+main() {
+ const SetEquality<String>();
+}
+ ''');
+ }
+
void test_constructorInvalid() {
// Regression test for https://github.com/dart-lang/sdk/issues/26695
checkFile('''
@@ -1988,6 +2041,7 @@ void main/*<S>*/() {
''');
check(implicitDynamic: false);
}
+
void test_implicitDynamic_listLiteral() {
addFile(r'''
@@ -2168,58 +2222,6 @@ dynamic y1 = (<dynamic>[])[0];
check(implicitDynamic: false);
}
- void test_constantGenericTypeArg_infer() {
- // Regression test for https://github.com/dart-lang/sdk/issues/26141
- checkFile('''
-abstract class Equality<Q> {}
-abstract class EqualityBase<R> implements Equality<R> {
- final C<R> c = /*info:INFERRED_TYPE_ALLOCATION*/const C();
- const EqualityBase();
-}
-class DefaultEquality<S> extends EqualityBase<S> {
- const DefaultEquality();
-}
-class SetEquality<T> implements Equality<T> {
- final Equality<T> field = const DefaultEquality();
- const SetEquality([Equality<T> inner = const DefaultEquality()]);
-}
-class C<Q> {
- final List<Q> list = /*info:INFERRED_TYPE_LITERAL*/const [];
- final Map<Q, Iterable<Q>> m = /*info:INFERRED_TYPE_LITERAL*/const {};
- const C();
-}
-main() {
- const SetEquality<String>();
-}
- ''');
- }
-
- void test_constantGenericTypeArg_explict() {
- // Regression test for https://github.com/dart-lang/sdk/issues/26141
- checkFile('''
-abstract class Equality<R> {}
-abstract class EqualityBase<R> implements Equality<R> {
- final C<R> c = const C<R>();
- const EqualityBase();
-}
-class DefaultEquality<S> extends EqualityBase<S> {
- const DefaultEquality();
-}
-class SetEquality<T> implements Equality<T> {
- final Equality<T> field = const DefaultEquality<T>();
- const SetEquality([Equality<T> inner = const DefaultEquality<T>()]);
-}
-class C<Q> {
- final List<Q> list = const <Q>[];
- final Map<Q, Iterable<Q>> m = const <Q, Iterable<Q>>{};
- const C();
-}
-main() {
- const SetEquality<String>();
-}
- ''');
- }
-
void test_invalidOverrides_baseClassOverrideToChildInterface() {
checkFile('''
class A {}

Powered by Google App Engine
This is Rietveld 408576698