Visitar URL original
Add more tests for comment-only object type (#19587) · prettier/prettier@91bcac8 · GitHub
Skip to content

Commit 91bcac8

Browse files
authored
Add more tests for comment-only object type (#19587)
1 parent cbee737 commit 91bcac8

4 files changed

Lines changed: 486 additions & 10 deletions

File tree

‎tests/format/flow/object-type/empty/__snapshots__/format.test.js.snap‎

Lines changed: 232 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,65 @@ parsers: ["flow"]
88
=====================================input======================================
99
a = [];
1010
a = [/*c*/];
11+
a = [//c
12+
];
13+
a= [
14+
//c
15+
];
16+
a = [/* 1 */ /* 2 */];
17+
a = [
18+
/*
19+
1
20+
2
21+
*/
22+
];
1123
type A11 = [];
1224
type A12 = [/*c*/];
25+
type A13 = [//c
26+
];
27+
type A14 = [
28+
//c
29+
];
30+
type A15 = [/* 1 */ /* 2 */];
31+
type A16 = [
32+
/*
33+
1
34+
2
35+
*/
36+
];
1337
1438
o = {};
1539
o = {/*c*/};
1640
type O21 = {};
1741
type O22 = {/*c*/};
18-
type O23 = {...};
19-
type O24 = {/*c*/ ...};
42+
type O23 = {//c
43+
};
44+
type O24 = {
45+
//c
46+
};
47+
type O25 = {/* 1 */ /* 2 */};
48+
type O26 = {
49+
/*
50+
1
51+
2
52+
*/
53+
};
54+
type O27 = {...};
55+
type O28 = {/*c*/ ...};
2056
type O31 = {||};
2157
type O32 = {|/*c*/|};
58+
type O33 = {|//c
59+
|};
60+
type O34 = {|
61+
//c
62+
|};
63+
type O35 = {|/* 1 */ /* 2 */|};
64+
type O36 = {|
65+
/*
66+
1
67+
2
68+
*/
69+
|};
2270
// type O33 = {|...|};
2371
// type O34 = {|/*c*/ ...|};
2472
interface I21 {}
@@ -27,17 +75,81 @@ interface I22 {/*c*/}
2775
=====================================output=====================================
2876
a = [];
2977
a = [/*c*/];
78+
a = [
79+
//c
80+
];
81+
a = [
82+
//c
83+
];
84+
a = [
85+
/* 1 */
86+
/* 2 */
87+
];
88+
a = [
89+
/*
90+
1
91+
2
92+
*/
93+
];
3094
type A11 = [];
3195
type A12 = [/*c*/];
96+
type A13 = [
97+
//c
98+
];
99+
type A14 = [
100+
//c
101+
];
102+
type A15 = [
103+
/* 1 */
104+
/* 2 */
105+
];
106+
type A16 = [
107+
/*
108+
1
109+
2
110+
*/
111+
];
32112
33113
o = {};
34114
o = {/*c*/};
35115
type O21 = {};
36116
type O22 = {/*c*/};
37-
type O23 = {...};
38-
type O24 = {/*c*/ ...};
117+
type O23 = {
118+
//c
119+
};
120+
type O24 = {
121+
//c
122+
};
123+
type O25 = {
124+
/* 1 */
125+
/* 2 */
126+
};
127+
type O26 = {
128+
/*
129+
1
130+
2
131+
*/
132+
};
133+
type O27 = {...};
134+
type O28 = {/*c*/ ...};
39135
type O31 = {||};
40136
type O32 = {|/*c*/|};
137+
type O33 = {|
138+
//c
139+
|};
140+
type O34 = {|
141+
//c
142+
|};
143+
type O35 = {|
144+
/* 1 */
145+
/* 2 */
146+
|};
147+
type O36 = {|
148+
/*
149+
1
150+
2
151+
*/
152+
|};
41153
// type O33 = {|...|};
42154
// type O34 = {|/*c*/ ...|};
43155
interface I21 {}
@@ -56,17 +168,65 @@ parsers: ["flow"]
56168
=====================================input======================================
57169
a = [];
58170
a = [/*c*/];
171+
a = [//c
172+
];
173+
a= [
174+
//c
175+
];
176+
a = [/* 1 */ /* 2 */];
177+
a = [
178+
/*
179+
1
180+
2
181+
*/
182+
];
59183
type A11 = [];
60184
type A12 = [/*c*/];
185+
type A13 = [//c
186+
];
187+
type A14 = [
188+
//c
189+
];
190+
type A15 = [/* 1 */ /* 2 */];
191+
type A16 = [
192+
/*
193+
1
194+
2
195+
*/
196+
];
61197
62198
o = {};
63199
o = {/*c*/};
64200
type O21 = {};
65201
type O22 = {/*c*/};
66-
type O23 = {...};
67-
type O24 = {/*c*/ ...};
202+
type O23 = {//c
203+
};
204+
type O24 = {
205+
//c
206+
};
207+
type O25 = {/* 1 */ /* 2 */};
208+
type O26 = {
209+
/*
210+
1
211+
2
212+
*/
213+
};
214+
type O27 = {...};
215+
type O28 = {/*c*/ ...};
68216
type O31 = {||};
69217
type O32 = {|/*c*/|};
218+
type O33 = {|//c
219+
|};
220+
type O34 = {|
221+
//c
222+
|};
223+
type O35 = {|/* 1 */ /* 2 */|};
224+
type O36 = {|
225+
/*
226+
1
227+
2
228+
*/
229+
|};
70230
// type O33 = {|...|};
71231
// type O34 = {|/*c*/ ...|};
72232
interface I21 {}
@@ -75,17 +235,81 @@ interface I22 {/*c*/}
75235
=====================================output=====================================
76236
a = [];
77237
a = [/*c*/];
238+
a = [
239+
//c
240+
];
241+
a = [
242+
//c
243+
];
244+
a = [
245+
/* 1 */
246+
/* 2 */
247+
];
248+
a = [
249+
/*
250+
1
251+
2
252+
*/
253+
];
78254
type A11 = [];
79255
type A12 = [/*c*/];
256+
type A13 = [
257+
//c
258+
];
259+
type A14 = [
260+
//c
261+
];
262+
type A15 = [
263+
/* 1 */
264+
/* 2 */
265+
];
266+
type A16 = [
267+
/*
268+
1
269+
2
270+
*/
271+
];
80272
81273
o = {};
82274
o = {/*c*/};
83275
type O21 = {};
84276
type O22 = {/*c*/};
85-
type O23 = { ... };
86-
type O24 = { /*c*/ ... };
277+
type O23 = {
278+
//c
279+
};
280+
type O24 = {
281+
//c
282+
};
283+
type O25 = {
284+
/* 1 */
285+
/* 2 */
286+
};
287+
type O26 = {
288+
/*
289+
1
290+
2
291+
*/
292+
};
293+
type O27 = { ... };
294+
type O28 = { /*c*/ ... };
87295
type O31 = {||};
88296
type O32 = {|/*c*/|};
297+
type O33 = {|
298+
//c
299+
|};
300+
type O34 = {|
301+
//c
302+
|};
303+
type O35 = {|
304+
/* 1 */
305+
/* 2 */
306+
|};
307+
type O36 = {|
308+
/*
309+
1
310+
2
311+
*/
312+
|};
89313
// type O33 = {|...|};
90314
// type O34 = {|/*c*/ ...|};
91315
interface I21 {}

‎tests/format/flow/object-type/empty/empty.js‎

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,64 @@
11
a = [];
22
a = [/*c*/];
3+
a = [//c
4+
];
5+
a= [
6+
//c
7+
];
8+
a = [/* 1 */ /* 2 */];
9+
a = [
10+
/*
11+
1
12+
2
13+
*/
14+
];
315
type A11 = [];
416
type A12 = [/*c*/];
17+
type A13 = [//c
18+
];
19+
type A14 = [
20+
//c
21+
];
22+
type A15 = [/* 1 */ /* 2 */];
23+
type A16 = [
24+
/*
25+
1
26+
2
27+
*/
28+
];
529

630
o = {};
731
o = {/*c*/};
832
type O21 = {};
933
type O22 = {/*c*/};
10-
type O23 = {...};
11-
type O24 = {/*c*/ ...};
34+
type O23 = {//c
35+
};
36+
type O24 = {
37+
//c
38+
};
39+
type O25 = {/* 1 */ /* 2 */};
40+
type O26 = {
41+
/*
42+
1
43+
2
44+
*/
45+
};
46+
type O27 = {...};
47+
type O28 = {/*c*/ ...};
1248
type O31 = {||};
1349
type O32 = {|/*c*/|};
50+
type O33 = {|//c
51+
|};
52+
type O34 = {|
53+
//c
54+
|};
55+
type O35 = {|/* 1 */ /* 2 */|};
56+
type O36 = {|
57+
/*
58+
1
59+
2
60+
*/
61+
|};
1462
// type O33 = {|...|};
1563
// type O34 = {|/*c*/ ...|};
1664
interface I21 {}

0 commit comments

Comments
 (0)