@@ -29,23 +29,111 @@ ruleTester.run("no-empty-static-block", rule, {
2929 invalid : [
3030 {
3131 code : "class Foo { static {} }" ,
32- errors : [ { messageId : "unexpected" } ] ,
32+ errors : [
33+ {
34+ messageId : "unexpected" ,
35+ line : 1 ,
36+ column : 20 ,
37+ endLine : 1 ,
38+ endColumn : 22 ,
39+ suggestions : [
40+ {
41+ messageId : "suggestComment" ,
42+ output : "class Foo { static { /* empty */ } }" ,
43+ } ,
44+ ] ,
45+ } ,
46+ ] ,
3347 } ,
3448 {
3549 code : "class Foo { static { } }" ,
36- errors : [ { messageId : "unexpected" } ] ,
50+ errors : [
51+ {
52+ messageId : "unexpected" ,
53+ line : 1 ,
54+ column : 20 ,
55+ endLine : 1 ,
56+ endColumn : 23 ,
57+ suggestions : [
58+ {
59+ messageId : "suggestComment" ,
60+ output : "class Foo { static { /* empty */ } }" ,
61+ } ,
62+ ] ,
63+ } ,
64+ ] ,
3765 } ,
3866 {
3967 code : "class Foo { static { \n\n } }" ,
40- errors : [ { messageId : "unexpected" } ] ,
68+ errors : [
69+ {
70+ messageId : "unexpected" ,
71+ line : 1 ,
72+ column : 20 ,
73+ endLine : 3 ,
74+ endColumn : 3 ,
75+ suggestions : [
76+ {
77+ messageId : "suggestComment" ,
78+ output : "class Foo { static { /* empty */ } }" ,
79+ } ,
80+ ] ,
81+ } ,
82+ ] ,
4183 } ,
4284 {
4385 code : "class Foo { static { bar(); } static {} }" ,
44- errors : [ { messageId : "unexpected" } ] ,
86+ errors : [
87+ {
88+ messageId : "unexpected" ,
89+ line : 1 ,
90+ column : 38 ,
91+ endLine : 1 ,
92+ endColumn : 40 ,
93+ suggestions : [
94+ {
95+ messageId : "suggestComment" ,
96+ output : "class Foo { static { bar(); } static { /* empty */ } }" ,
97+ } ,
98+ ] ,
99+ } ,
100+ ] ,
45101 } ,
46102 {
47103 code : "class Foo { static // comment\n {} }" ,
48- errors : [ { messageId : "unexpected" } ] ,
104+ errors : [
105+ {
106+ messageId : "unexpected" ,
107+ line : 2 ,
108+ column : 2 ,
109+ endLine : 2 ,
110+ endColumn : 4 ,
111+ suggestions : [
112+ {
113+ messageId : "suggestComment" ,
114+ output : "class Foo { static // comment\n { /* empty */ } }" ,
115+ } ,
116+ ] ,
117+ } ,
118+ ] ,
119+ } ,
120+ {
121+ code : "class Foo { static /* empty */ {} /* empty */ }" ,
122+ errors : [
123+ {
124+ messageId : "unexpected" ,
125+ line : 1 ,
126+ column : 32 ,
127+ endLine : 1 ,
128+ endColumn : 34 ,
129+ suggestions : [
130+ {
131+ messageId : "suggestComment" ,
132+ output : "class Foo { static /* empty */ { /* empty */ } /* empty */ }" ,
133+ } ,
134+ ] ,
135+ } ,
136+ ] ,
49137 } ,
50138 ] ,
51139} ) ;
0 commit comments