From b6785856fed8b267d325b0217e330a0830e55788 Mon Sep 17 00:00:00 2001 From: Konstantin Shcheglov Date: Tue, 9 Jun 2026 09:31:01 -0700 Subject: [PATCH] CQ. Remove stale tests. These are either ancient syntax, or are about Object and actually not checked, and there is no reason to check. Change-Id: I5869aeea4012c6dee0bc158337eecf02e479c365 Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/510200 Reviewed-by: Johnni Winther Commit-Queue: Konstantin Shcheglov --- .../argument_type_not_assignable_test.dart | 17 ----------- ...ject_cannot_extend_another_class_test.dart | 28 ------------------ .../super_initializer_in_object_test.dart | 29 ------------------- .../test/src/diagnostics/test_all.dart | 5 ---- 4 files changed, 79 deletions(-) delete mode 100644 pkg/analyzer/test/src/diagnostics/object_cannot_extend_another_class_test.dart delete mode 100644 pkg/analyzer/test/src/diagnostics/super_initializer_in_object_test.dart diff --git a/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart b/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart index 4acfe248eea..61d53fdc183 100644 --- a/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart +++ b/pkg/analyzer/test/src/diagnostics/argument_type_not_assignable_test.dart @@ -2,7 +2,6 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. -import 'package:analyzer/src/diagnostic/diagnostic.dart' as diag; import 'package:test/test.dart'; import 'package:test_reflective_loader/test_reflective_loader.dart'; @@ -747,22 +746,6 @@ main() { } '''); } - - @failingTest - test_tearOff_required() async { - await assertErrorsInCode( - ''' -class C { - Object/*=T*/ f/**/(Object/*=T*/ x) => x; -} -g(C c) { - var h = c.f/**/; - print(h('s')); -} -''', - [error(diag.argumentTypeNotAssignable, 99, 1)], - ); - } } @reflectiveTest diff --git a/pkg/analyzer/test/src/diagnostics/object_cannot_extend_another_class_test.dart b/pkg/analyzer/test/src/diagnostics/object_cannot_extend_another_class_test.dart deleted file mode 100644 index 7aeb3c8d39d..00000000000 --- a/pkg/analyzer/test/src/diagnostics/object_cannot_extend_another_class_test.dart +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:analyzer/src/diagnostic/diagnostic.dart' as diag; -import 'package:test_reflective_loader/test_reflective_loader.dart'; - -import '../dart/resolution/context_collection_resolution.dart'; - -main() { - defineReflectiveSuite(() { - defineReflectiveTests(ObjectCannotExtendAnotherClassTest); - }); -} - -@reflectiveTest -class ObjectCannotExtendAnotherClassTest extends PubPackageResolutionTest { - @failingTest - test_object_extends_class() async { - // TODO(brianwilkerson): Implement this check. - await assertErrorsInCode( - r''' -class Object extends List {} -''', - [error(diag.objectCannotExtendAnotherClass, 0, 0)], - ); - } -} diff --git a/pkg/analyzer/test/src/diagnostics/super_initializer_in_object_test.dart b/pkg/analyzer/test/src/diagnostics/super_initializer_in_object_test.dart deleted file mode 100644 index d1638469086..00000000000 --- a/pkg/analyzer/test/src/diagnostics/super_initializer_in_object_test.dart +++ /dev/null @@ -1,29 +0,0 @@ -// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file -// for details. All rights reserved. Use of this source code is governed by a -// BSD-style license that can be found in the LICENSE file. - -import 'package:analyzer/src/diagnostic/diagnostic.dart' as diag; -import 'package:test_reflective_loader/test_reflective_loader.dart'; - -import '../dart/resolution/context_collection_resolution.dart'; - -main() { - defineReflectiveSuite(() { - defineReflectiveTests(SuperInitializerInObjectTest); - }); -} - -@reflectiveTest -class SuperInitializerInObjectTest extends PubPackageResolutionTest { - @failingTest - test_superInitializerInObject() async { - await assertErrorsInCode( - r''' -class Object { - Object() : super(); -} -''', - [error(diag.superInitializerInObject, 0, 0)], - ); - } -} diff --git a/pkg/analyzer/test/src/diagnostics/test_all.dart b/pkg/analyzer/test/src/diagnostics/test_all.dart index 56258c05b3c..34a4c81a548 100644 --- a/pkg/analyzer/test/src/diagnostics/test_all.dart +++ b/pkg/analyzer/test/src/diagnostics/test_all.dart @@ -704,8 +704,6 @@ import 'nullable_type_in_on_clause_test.dart' as nullable_type_in_on_clause; import 'nullable_type_in_with_clause_test.dart' as nullable_type_in_with_clause; import 'number_literals_with_separators_test.dart' as number_literals_with_separators; -import 'object_cannot_extend_another_class_test.dart' - as object_cannot_extend_another_class; import 'obsolete_colon_for_default_value_test.dart' as obsolete_colon_for_default_value; import 'on_repeated_test.dart' as on_repeated; @@ -840,7 +838,6 @@ import 'super_in_extension_type_test.dart' as super_in_extension_type; import 'super_in_invalid_context_test.dart' as super_in_invalid_context; import 'super_in_redirecting_constructor_test.dart' as super_in_redirecting_constructor; -import 'super_initializer_in_object_test.dart' as super_initializer_in_object; import 'super_invocation_not_last_test.dart' as super_invocation_not_last; import 'switch_case_completes_normally_test.dart' as switch_case_completes_normally; @@ -1418,7 +1415,6 @@ main() { nullable_type_in_on_clause.main(); nullable_type_in_with_clause.main(); number_literals_with_separators.main(); - object_cannot_extend_another_class.main(); obsolete_colon_for_default_value.main(); on_repeated.main(); optional_parameter_in_operator.main(); @@ -1500,7 +1496,6 @@ main() { super_in_extension_type.main(); super_in_invalid_context.main(); super_in_redirecting_constructor.main(); - super_initializer_in_object.main(); super_invocation_not_last.main(); switch_case_completes_normally.main(); tearoff_of_generative_constructor_of_abstract_class.main();