This repository was archived by the owner on Nov 20, 2024. It is now read-only.
File tree 2 files changed +61
-0
lines changed 2 files changed +61
-0
lines changed Original file line number Diff line number Diff line change 2
2
// for details. All rights reserved. Use of this source code is governed by a
3
3
// BSD-style license that can be found in the LICENSE file.
4
4
5
+ import 'annotate_overrides.dart' as annotate_overrides;
5
6
import 'avoid_annotating_with_dynamic.dart' as avoid_annotating_with_dynamic;
6
7
import 'avoid_function_literals_in_foreach_calls.dart'
7
8
as avoid_function_literals_in_foreach_calls;
@@ -48,6 +49,7 @@ import 'use_is_even_rather_than_modulo.dart' as use_is_even_rather_than_modulo;
48
49
import 'void_checks.dart' as void_checks;
49
50
50
51
void main () {
52
+ annotate_overrides.main ();
51
53
avoid_annotating_with_dynamic.main ();
52
54
avoid_function_literals_in_foreach_calls.main ();
53
55
avoid_init_to_null.main ();
Original file line number Diff line number Diff line change
1
+ // Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
2
+ // for details. All rights reserved. Use of this source code is governed by a
3
+ // BSD-style license that can be found in the LICENSE file.
4
+
5
+ import 'package:test_reflective_loader/test_reflective_loader.dart' ;
6
+
7
+ import '../rule_test_support.dart' ;
8
+
9
+ main () {
10
+ defineReflectiveSuite (() {
11
+ defineReflectiveTests (AnnotateOverridesTest );
12
+ });
13
+ }
14
+
15
+ @reflectiveTest
16
+ class AnnotateOverridesTest extends LintRuleTest {
17
+ @override
18
+ List <String > get experiments => [
19
+ EnableString .enhanced_enums,
20
+ ];
21
+
22
+ @override
23
+ String get lintRule => 'annotate_overrides' ;
24
+
25
+ test_field () async {
26
+ await assertDiagnostics (r'''
27
+ enum A {
28
+ a,b,c;
29
+ int get hashCode => 0;
30
+ }
31
+ ''' , [
32
+ lint ('annotate_overrides' , 28 , 8 ),
33
+ ]);
34
+ }
35
+
36
+ test_method () async {
37
+ await assertDiagnostics (r'''
38
+ enum A {
39
+ a,b,c;
40
+ String toString() => '';
41
+ }
42
+ ''' , [
43
+ lint ('annotate_overrides' , 27 , 8 ),
44
+ ]);
45
+ }
46
+
47
+ @FailingTest (issue: 'https://github.com/dart-lang/linter/issues/3093' )
48
+ test_ok () async {
49
+ await assertNoDiagnostics (r'''
50
+ enum A {
51
+ a,b,c;
52
+ @override
53
+ int get hashCode => 0;
54
+ @override
55
+ String toString() => '';
56
+ }
57
+ ''' );
58
+ }
59
+ }
You can’t perform that action at this time.
0 commit comments