1
1
40 columns |
2
2
### Tests for the comment to set formatting width.
3
3
>>> Comment sets page width.
4
+ // dart format width=30
4
5
main() {
5
- // dart format width=30
6
6
fitsUnsplitAt40 + butNotAt30;
7
7
}
8
8
<<<
9
+ // dart format width=30
9
10
main() {
10
- // dart format width=30
11
11
fitsUnsplitAt40 +
12
12
butNotAt30;
13
13
}
14
- >>> Comment anywhere affects all code.
14
+ >>> Comment only takes effect if it appears before code.
15
15
main() {
16
+ // dart format width=30
16
17
fitsUnsplitAt40 + butNotAt30;
17
18
}
18
- // dart format width=30
19
19
<<<
20
20
main() {
21
- fitsUnsplitAt40 +
22
- butNotAt30;
21
+ // dart format width=30
22
+ fitsUnsplitAt40 + butNotAt30;
23
23
}
24
-
24
+ >>> If there are multiple comments, first one wins.
25
25
// dart format width=30
26
- >>> If multiple comments, first one wins.
26
+ // dart format width=60
27
27
main() {
28
- // dart format width=30
29
- // dart format width=60
30
28
fitsUnsplitAt40 + butNotAt30;
31
29
}
32
30
<<<
31
+ // dart format width=30
32
+ // dart format width=60
33
33
main() {
34
- // dart format width=30
35
- // dart format width=60
36
34
fitsUnsplitAt40 +
37
35
butNotAt30;
38
36
}
39
37
>>> Does nothing if width is not an integer.
38
+ // dart format width=wat
40
39
main() {
41
- // dart format width=wat
42
40
fitsUnsplitAt40 + butNotAt30;
43
41
}
44
42
<<<
43
+ // dart format width=wat
45
44
main() {
46
- // dart format width=wat
47
45
fitsUnsplitAt40 + butNotAt30;
48
46
}
49
47
>>> Can't have trailing text.
48
+ // dart format width=30 some more text
50
49
main() {
51
- // dart format width=30 some more text
52
50
fitsUnsplitAt40 + butNotAt30;
53
51
}
54
52
<<<
53
+ // dart format width=30 some more text
55
54
main() {
56
- // dart format width=30 some more text
57
55
fitsUnsplitAt40 + butNotAt30;
58
56
}
59
57
>>> Whitespace must match exactly.
58
+ //dart format width=30
60
59
main() {
61
- //dart format width=30
62
60
fitsUnsplitAt40 + butNotAt30;
63
61
}
64
62
<<<
63
+ //dart format width=30
65
64
main() {
66
- //dart format width=30
67
65
fitsUnsplitAt40 + butNotAt30;
68
66
}
69
67
>>> Whitespace must match exactly.
68
+ // dart format width=30
70
69
main() {
71
- // dart format width=30
72
70
fitsUnsplitAt40 + butNotAt30;
73
71
}
74
72
<<<
73
+ // dart format width=30
75
74
main() {
76
- // dart format width=30
77
75
fitsUnsplitAt40 + butNotAt30;
78
76
}
79
77
>>> Whitespace must match exactly.
78
+ // dart format width = 30
80
79
main() {
81
- // dart format width = 30
82
80
fitsUnsplitAt40 + butNotAt30;
83
81
}
84
82
<<<
83
+ // dart format width = 30
85
84
main() {
86
- // dart format width = 30
87
85
fitsUnsplitAt40 + butNotAt30;
88
86
}
89
- >>> Can't be doc comment.
87
+ >>> Can't be a doc comment.
88
+ /// dart format width=30
90
89
main() {
91
- /// dart format width=30
92
90
fitsUnsplitAt40 + butNotAt30;
93
91
}
94
92
<<<
93
+ /// dart format width=30
95
94
main() {
96
- /// dart format width=30
97
95
fitsUnsplitAt40 + butNotAt30;
98
96
}
99
- >>> Can't be nested inside other comment.
97
+ >>> Can't be nested inside another comment.
98
+ /* // dart format width=30 */
100
99
main() {
101
- /* // dart format width=30 */
102
100
fitsUnsplitAt40 + butNotAt30;
103
101
}
104
102
<<<
103
+ /* // dart format width=30 */
105
104
main() {
106
- /* // dart format width=30 */
107
105
fitsUnsplitAt40 + butNotAt30;
108
106
}
109
- >>> Can't be inside string literal.
107
+ >>> Can't be inside a string literal.
108
+ var c = '// dart format width=30';
110
109
main() {
111
- var c = '// dart format width=30';
112
110
fitsUnsplitAt40 + butNotAt30;
113
111
}
114
112
<<<
113
+ var c = '// dart format width=30';
115
114
main() {
116
- var c = '// dart format width=30';
117
115
fitsUnsplitAt40 + butNotAt30;
118
116
}
0 commit comments