Skip to content

Commit ed3c5c6

Browse files
authored
Add regression tests for all issues fixed by the new formatter. (#1513)
I went through the entire issue tracker. For every bug whose output now looks like we want using the new formatter, I added a regression test and closed the issue. These are those regression tests. There are no code changes. It's just tracking issues where the new formatter already does the right thing.
1 parent 9776539 commit ed3c5c6

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+6776
-17
lines changed

test/tall/regression/0100/0133.stmt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
>>>
2+
testCase._error(
3+
'Callback ${id}called ($actualCalls) after test case '
4+
'${testCase.description} has already been marked as '
5+
'${testCase.result}.$reason');
6+
<<<
7+
testCase._error(
8+
'Callback ${id}called ($actualCalls) after test case '
9+
'${testCase.description} has already been marked as '
10+
'${testCase.result}.$reason',
11+
);

test/tall/regression/0100/0188.stmt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
>>> (indent 2)
2+
method() => Intl.message("This comes from a method",
3+
name: 'method', desc: 'This is a method with a '
4+
'long description which spans '
5+
'multiple lines.');
6+
<<<
7+
method() => Intl.message(
8+
"This comes from a method",
9+
name: 'method',
10+
desc:
11+
'This is a method with a '
12+
'long description which spans '
13+
'multiple lines.',
14+
);
15+
>>> (indent 6)
16+
testHtml('DOM clobbering of attributes with multiple nodes', validator,
17+
"<form onmouseover='alert(1)'><input name='attributes'>"
18+
"<input name='attributes'>", "");
19+
<<<
20+
testHtml(
21+
'DOM clobbering of attributes with multiple nodes',
22+
validator,
23+
"<form onmouseover='alert(1)'><input name='attributes'>"
24+
"<input name='attributes'>",
25+
"",
26+
);

test/tall/regression/0200/0220.stmt

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
>>>
2+
expect(b, 0,
3+
reason: 'we pick the "package:" url as the canonical url for script tags.');
4+
<<<
5+
expect(
6+
b,
7+
0,
8+
reason: 'we pick the "package:" url as the canonical url for script tags.',
9+
);
10+
>>> (indent 2)
11+
expect(b, 0,
12+
reason: 'we pick the "package:" url as the canonical url for script tags.');
13+
<<<
14+
expect(
15+
b,
16+
0,
17+
reason: 'we pick the "package:" url as the canonical url for script tags.',
18+
);
19+
>>> (indent 4)
20+
expect(b, 0,
21+
reason: 'we pick the "package:" url as the canonical url for script tags.');
22+
<<<
23+
expect(
24+
b,
25+
0,
26+
reason:
27+
'we pick the "package:" url as the canonical url for script tags.',
28+
);
29+
>>> (indent 6)
30+
expect(b, 0,
31+
reason: 'we pick the "package:" url as the canonical url for script '
32+
'tags.');
33+
<<<
34+
expect(
35+
b,
36+
0,
37+
reason:
38+
'we pick the "package:" url as the canonical url for script '
39+
'tags.',
40+
);

test/tall/regression/0300/0382.unit

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
>>>
2+
Future doThing() => pool.withResource(() {
3+
// ...
4+
});
5+
<<<
6+
Future doThing() => pool.withResource(() {
7+
// ...
8+
});

test/tall/regression/0400/0409.stmt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
>>>
2+
it('should complete with an error if the name or website is null or both '
3+
'are unchanged', async(() {
4+
ICouldDoAnything();
5+
}));
6+
<<<
7+
it(
8+
'should complete with an error if the name or website is null or both '
9+
'are unchanged',
10+
async(() {
11+
ICouldDoAnything();
12+
}),
13+
);

test/tall/regression/0400/0456.unit

Lines changed: 4656 additions & 0 deletions
Large diffs are not rendered by default.

test/tall/regression/0400/0496.stmt

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
>>> (indent 4)
2+
selection.callMethod('enter').callMethod('append', ["svg"]).callMethod(
3+
'attr', ["class", "box"]).callMethod('attr', ["width", width])
4+
.callMethod('attr', ["height", height]).callMethod('append', ["g"])
5+
.callMethod(
6+
'attr', ["transform", 'translate(${margin[3]},${margin[0]})'])
7+
.callMethod('append', ["text"]).callMethod('attr', ["class", "label"])
8+
.callMethod('text', [(_, i, __) => groups[i]]);
9+
<<<
10+
selection
11+
.callMethod('enter')
12+
.callMethod('append', ["svg"])
13+
.callMethod('attr', ["class", "box"])
14+
.callMethod('attr', ["width", width])
15+
.callMethod('attr', ["height", height])
16+
.callMethod('append', ["g"])
17+
.callMethod('attr', [
18+
"transform",
19+
'translate(${margin[3]},${margin[0]})',
20+
])
21+
.callMethod('append', ["text"])
22+
.callMethod('attr', ["class", "label"])
23+
.callMethod('text', [(_, i, __) => groups[i]]);

test/tall/regression/0500/0557.unit

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
>>>
2+
class PublicType {
3+
const factory PublicType.constructor(
4+
String a,
5+
Type b,
6+
) = PublicTypeImpl._;
7+
8+
factory PublicType.constructor(
9+
String a,
10+
Type b,
11+
) =>
12+
new PublicTypeImpl._(a, b);
13+
}
14+
<<<
15+
class PublicType {
16+
const factory PublicType.constructor(String a, Type b) = PublicTypeImpl._;
17+
18+
factory PublicType.constructor(String a, Type b) => new PublicTypeImpl._(
19+
a,
20+
b,
21+
);
22+
}
23+
>>>
24+
class PublicType {
25+
const factory PublicType.constructor1234567890121416182022242628303234363840(
26+
a,
27+
b,
28+
) = PublicTypeImpl._;
29+
30+
factory PublicType.constructor1234567890121416182022242628303234363840(
31+
a,
32+
b,
33+
) => new PublicTypeImpl._(a, b);
34+
35+
const factory PublicType.constructor(a, b) =
36+
PublicTypeImpl._1234567890121416182022242628303234363840;
37+
38+
factory PublicType.constructor(a, b) =>
39+
new PublicTypeImpl._1234567890121416182022242628303234363840(a, b);
40+
}
41+
<<<
42+
class PublicType {
43+
const factory PublicType.constructor1234567890121416182022242628303234363840(
44+
a,
45+
b,
46+
) = PublicTypeImpl._;
47+
48+
factory PublicType.constructor1234567890121416182022242628303234363840(
49+
a,
50+
b,
51+
) => new PublicTypeImpl._(a, b);
52+
53+
const factory PublicType.constructor(a, b) =
54+
PublicTypeImpl._1234567890121416182022242628303234363840;
55+
56+
factory PublicType.constructor(a, b) =>
57+
new PublicTypeImpl._1234567890121416182022242628303234363840(a, b);
58+
}

test/tall/regression/0500/0558.unit

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
>>>
2+
class RouteDefinition {
3+
const factory RouteDefinition.fork(
4+
String path,
5+
List<RouteDefinition> children, {
6+
@required String defaultTo,
7+
}) = ForkedRouteDefinition._;
8+
}
9+
<<<
10+
class RouteDefinition {
11+
const factory RouteDefinition.fork(
12+
String path,
13+
List<RouteDefinition> children, {
14+
@required String defaultTo,
15+
}) = ForkedRouteDefinition._;
16+
}
17+
>>>
18+
class RouteDefinition {
19+
const factory RouteDefinition.fork(
20+
String path,
21+
List<RouteDefinition> children, {
22+
@Required('When `path` is navigated to, what path within `children` to use')
23+
String defaultTo,
24+
}) = ForkedRouteDefinition._;
25+
}
26+
<<<
27+
class RouteDefinition {
28+
const factory RouteDefinition.fork(
29+
String path,
30+
List<RouteDefinition> children, {
31+
@Required('When `path` is navigated to, what path within `children` to use')
32+
String defaultTo,
33+
}) = ForkedRouteDefinition._;
34+
}
35+
>>>
36+
void reallyLongFunctionName0(
37+
@Deprecated('This has been deprecated for many interesting reasons...')
38+
arg1) {
39+
return;
40+
}
41+
42+
void fn1(
43+
{@Deprecated('This has been deprecated for many interesting reasons...')
44+
String argument1}) {
45+
return;
46+
}
47+
<<<
48+
void reallyLongFunctionName0(
49+
@Deprecated('This has been deprecated for many interesting reasons...') arg1,
50+
) {
51+
return;
52+
}
53+
54+
void fn1({
55+
@Deprecated('This has been deprecated for many interesting reasons...')
56+
String argument1,
57+
}) {
58+
return;
59+
}
60+
>>>
61+
void reallyLongFunctionName0(
62+
@Deprecated('This has been deprecated for many many interesting reasons...')
63+
arg1) {
64+
return;
65+
}
66+
67+
void fn1(
68+
{@Deprecated('This has been deprecated for many many interesting reasons...')
69+
String argument1}) {
70+
return;
71+
}
72+
<<<
73+
void reallyLongFunctionName0(
74+
@Deprecated('This has been deprecated for many many interesting reasons...')
75+
arg1,
76+
) {
77+
return;
78+
}
79+
80+
void fn1({
81+
@Deprecated('This has been deprecated for many many interesting reasons...')
82+
String argument1,
83+
}) {
84+
return;
85+
}

test/tall/regression/0500/0568.unit

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
>>>
2+
void main() {
3+
var controller = new StreamController<T>(sync: true, onCancel: () {
4+
return Future.wait(operationSet.map((operation) => operation.cancel()));
5+
});
6+
}
7+
<<<
8+
void main() {
9+
var controller = new StreamController<T>(sync: true, onCancel: () {
10+
return Future.wait(operationSet.map((operation) => operation.cancel()));
11+
});
12+
}

0 commit comments

Comments
 (0)