File tree Expand file tree Collapse file tree 2 files changed +49
-1
lines changed
Expand file tree Collapse file tree 2 files changed +49
-1
lines changed Original file line number Diff line number Diff line change @@ -129,7 +129,9 @@ class _DeclarationGatherer {
129129 rawName.startsWith ('test_' ) ||
130130 rawName.startsWith ('solo_test_' ) ||
131131 rawName == 'setUp' ||
132- rawName == 'tearDown' ;
132+ rawName == 'tearDown' ||
133+ rawName == 'setUpClass' ||
134+ rawName == 'tearDownClass' ;
133135 if (! isOverride (element) && ! isTestMethod) {
134136 declarations.add (member);
135137 }
Original file line number Diff line number Diff line change @@ -1151,6 +1151,29 @@ mixin M {}
11511151 );
11521152 }
11531153
1154+ test_setUpClass_class_static_member_reachable () async {
1155+ await assertNoDiagnostics ('''
1156+ void main() {
1157+ A();
1158+ }
1159+
1160+ final class A {
1161+ static setUpClass() {}
1162+ }
1163+ ''' );
1164+ }
1165+
1166+ test_setUpClass_top_level_unreachable () async {
1167+ await assertDiagnostics (
1168+ '''
1169+ void main() {}
1170+
1171+ setUpClass() {}
1172+ ''' ,
1173+ [lint (16 , 10 )],
1174+ );
1175+ }
1176+
11541177 test_staticField_unreachable () async {
11551178 await assertDiagnostics (
11561179 r'''
@@ -1349,6 +1372,29 @@ class C {
13491372 );
13501373 }
13511374
1375+ test_tearDownClass_class_static_member_reachable () async {
1376+ await assertNoDiagnostics ('''
1377+ void main() {
1378+ A();
1379+ }
1380+
1381+ final class A {
1382+ static tearDownClass() {}
1383+ }
1384+ ''' );
1385+ }
1386+
1387+ test_tearDownClass_top_level_unreachable () async {
1388+ await assertDiagnostics (
1389+ '''
1390+ void main() {}
1391+
1392+ tearDownClass() {}
1393+ ''' ,
1394+ [lint (16 , 13 )],
1395+ );
1396+ }
1397+
13521398 test_topLevelFunction_reachable () async {
13531399 await assertNoDiagnostics (r'''
13541400void main() {
You can’t perform that action at this time.
0 commit comments