Skip to content
This repository was archived by the owner on Nov 20, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions test/rules/all.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import 'avoid_redundant_argument_values.dart'
import 'avoid_shadowing_type_parameters.dart'
as avoid_shadowing_type_parameters;
import 'conditional_uri_does_not_exist.dart' as conditional_uri_does_not_exist;
import 'deprecated_consistency.dart' as deprecated_consistency;
import 'file_names.dart' as file_names;
import 'literal_only_boolean_expressions.dart'
as literal_only_boolean_expressions;
Expand Down Expand Up @@ -44,6 +45,7 @@ void main() {
avoid_redundant_argument_values.main();
avoid_shadowing_type_parameters.main();
conditional_uri_does_not_exist.main();
deprecated_consistency.main();
file_names.main();
literal_only_boolean_expressions.main();
missing_whitespace_between_adjacent_strings.main();
Expand Down
39 changes: 39 additions & 0 deletions test/rules/deprecated_consistency.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// Copyright (c) 2021, 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:test_reflective_loader/test_reflective_loader.dart';

import '../rule_test_support.dart';

main() {
defineReflectiveSuite(() {
defineReflectiveTests(DeprecatedConsistencyTest);
});
}

@reflectiveTest
class DeprecatedConsistencyTest extends LintRuleTest {
@override
List<String> get experiments => [
EnableString.super_parameters,
];

@override
String get lintRule => 'deprecated_consistency';

test_superInit() async {
await assertDiagnostics(r'''
class A {
String? a;
A({@deprecated this.a});
}

class B extends A {
B({super.a});
}
''', [
lint('deprecated_consistency', 20, 1),
]);
}
}