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

Unified Diff: pkg/analysis_server/test/integration/analysis/error_test.dart

Issue 1301533003: Plumb "enableSuperMixins" option through analysis server (implements DEP 34). (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 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/analysis_server/test/integration/analysis/error_test.dart
diff --git a/pkg/analysis_server/test/integration/analysis/error_test.dart b/pkg/analysis_server/test/integration/analysis/error_test.dart
index 25df6566b8c0e75de9b2defbaf3fdcd540dcca40..806958f5e45632b754863412a0de8f644a3e7937 100644
--- a/pkg/analysis_server/test/integration/analysis/error_test.dart
+++ b/pkg/analysis_server/test/integration/analysis/error_test.dart
@@ -35,4 +35,64 @@ main() {
expect(errors[0].location.file, equals(pathname));
});
}
+
+ test_super_mixins_disabled() async {
+ String pathname = sourcePath('test.dart');
+ writeFile(
+ pathname,
+ '''
+class Test extends Object with C {
+ void foo() {}
+}
+abstract class B {
+ void foo();
+}
+abstract class C extends B {
+ void bar() {
+ super.foo();
+ }
+}
+''');
+ standardAnalysisSetup();
+ await analysisFinished;
+ expect(currentAnalysisErrors[pathname], isList);
+ List<AnalysisError> errors = currentAnalysisErrors[pathname];
+ expect(errors, hasLength(2));
+ Set<String> allErrorMessages =
+ errors.map((AnalysisError e) => e.message).toSet();
+ expect(
+ allErrorMessages,
+ contains(
+ "The class 'C' cannot be used as a mixin because it extends a class other than Object"));
+ expect(
+ allErrorMessages,
+ contains(
+ "The class 'C' cannot be used as a mixin because it references 'super'"));
+ }
+
+ test_super_mixins_enabled() async {
+ String pathname = sourcePath('test.dart');
+ writeFile(
+ pathname,
+ '''
+class Test extends Object with C {
+ void foo() {}
+}
+abstract class B {
+ void foo();
+}
+abstract class C extends B {
+ void bar() {
+ super.foo();
+ }
+}
+''');
+ await sendAnalysisUpdateOptions(
+ new AnalysisOptions()..enableSuperMixins = true);
+ standardAnalysisSetup();
+ await analysisFinished;
+ expect(currentAnalysisErrors[pathname], isList);
+ List<AnalysisError> errors = currentAnalysisErrors[pathname];
+ expect(errors, isEmpty);
+ }
}
« no previous file with comments | « pkg/analysis_server/lib/src/status/get_handler.dart ('k') | pkg/analysis_server/test/integration/protocol_matchers.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698