Skip to content

Commit 1e3b808

Browse files
authored
Migrate regression/0400/ (#1467)
Migrate regression/0400/ to tall style.
1 parent 2522dfa commit 1e3b808

37 files changed

+1944
-0
lines changed

test/tall/regression/0400/0404.stmt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
>>> (indent 2)
2+
group('((prevent timeout))', () {
3+
setUp(() => ensureImageExists());
4+
5+
test('((dummy))', () {
6+
}, timeout: const Timeout(const Duration(seconds: 300)));
7+
});
8+
<<<
9+
group('((prevent timeout))', () {
10+
setUp(() => ensureImageExists());
11+
12+
test(
13+
'((dummy))',
14+
() {},
15+
timeout: const Timeout(const Duration(seconds: 300)),
16+
);
17+
});

test/tall/regression/0400/0407.unit

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
>>>
2+
void main() {
3+
model..account = (new Account()
4+
..accountId = new Int64(111)
5+
..tags = (new Account_Tags()..accountHotlist.add(new Hotlist()..hotlistId = new Int64(10))));
6+
}
7+
<<<
8+
void main() {
9+
model
10+
..account =
11+
(new Account()
12+
..accountId = new Int64(111)
13+
..tags =
14+
(new Account_Tags()..accountHotlist.add(
15+
new Hotlist()..hotlistId = new Int64(10),
16+
)));
17+
}
18+
>>> (indent 4)
19+
main() {
20+
receiver
21+
..formattedTotal = _total == 0
22+
? ""
23+
: _chartType == "PieChart"
24+
? _formatter.formatAsPercent(item.value / _total, fractionDigits: 1)
25+
: _formatter.formatValue(item.value, item.valueType);
26+
}
27+
<<<
28+
### TODO(1465): Allow the conditional after the `=`.
29+
main() {
30+
receiver
31+
..formattedTotal =
32+
_total == 0
33+
? ""
34+
: _chartType == "PieChart"
35+
? _formatter.formatAsPercent(
36+
item.value / _total,
37+
fractionDigits: 1,
38+
)
39+
: _formatter.formatValue(item.value, item.valueType);
40+
}
41+
>>> (indent 6)
42+
main() {
43+
receiver
44+
..formattedTotal = _total == 0
45+
? ""
46+
: _chartType == "PieChart"
47+
? _formatter.formatAsPercent(item.value / _total, fractionDigits: 1)
48+
: _formatter.formatValue(item.value, item.valueType);
49+
}
50+
<<<
51+
### TODO(1465): Allow the conditional after the `=`.
52+
main() {
53+
receiver
54+
..formattedTotal =
55+
_total == 0
56+
? ""
57+
: _chartType == "PieChart"
58+
? _formatter.formatAsPercent(
59+
item.value / _total,
60+
fractionDigits: 1,
61+
)
62+
: _formatter.formatValue(item.value, item.valueType);
63+
}

test/tall/regression/0400/0410.stmt

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
>>>
2+
test(
3+
'some test that has a very long description so the params need two lines',
4+
async(() {
5+
expect(
6+
request.enabledApExperiments.contains(
7+
ApExperimentName.SOME_VERY_LONG_ENUMS_THAT_LEADS_TO_MANY_PROBLEMS),
8+
isFalse);
9+
}));
10+
<<<
11+
test(
12+
'some test that has a very long description so the params need two lines',
13+
async(() {
14+
expect(
15+
request.enabledApExperiments.contains(
16+
ApExperimentName.SOME_VERY_LONG_ENUMS_THAT_LEADS_TO_MANY_PROBLEMS,
17+
),
18+
isFalse,
19+
);
20+
}),
21+
);
22+
>>> (indent 2)
23+
test(
24+
'some test that has a very long description so the params need two lines',
25+
async(() {
26+
expect(
27+
request.enabledApExperiments.contains(
28+
ApExperimentName.SOME_VERY_LONG_ENUMS_THAT_LEADS_TO_MANY_PROBLEMS),
29+
isFalse);
30+
}));
31+
<<<
32+
test(
33+
'some test that has a very long description so the params need two lines',
34+
async(() {
35+
expect(
36+
request.enabledApExperiments.contains(
37+
ApExperimentName.SOME_VERY_LONG_ENUMS_THAT_LEADS_TO_MANY_PROBLEMS,
38+
),
39+
isFalse,
40+
);
41+
}),
42+
);
43+
>>> (indent 4)
44+
test(
45+
'some test that has a very long description so the params need two lines',
46+
async(() {
47+
expect(
48+
request.enabledApExperiments.contains(
49+
ApExperimentName.SOME_VERY_LONG_ENUMS_THAT_LEADS_TO_MANY_PROBLEMS),
50+
isFalse);
51+
}));
52+
<<<
53+
test(
54+
'some test that has a very long description so the params need two lines',
55+
async(() {
56+
expect(
57+
request.enabledApExperiments.contains(
58+
ApExperimentName.SOME_VERY_LONG_ENUMS_THAT_LEADS_TO_MANY_PROBLEMS,
59+
),
60+
isFalse,
61+
);
62+
}),
63+
);

test/tall/regression/0400/0413.unit

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
>>>
2+
List get bindings => [
3+
bind(const StaticFilePath())
4+
.toValue(_staticFilePath.isEmpty ? _libRoot : _staticFilePath)
5+
];
6+
<<<
7+
List get bindings => [
8+
bind(
9+
const StaticFilePath(),
10+
).toValue(_staticFilePath.isEmpty ? _libRoot : _staticFilePath),
11+
];

test/tall/regression/0400/0420.unit

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
>>>
2+
createSomeObject(String s, Int64 id,
3+
{Map<String, Int64> mapFromStringToInt64}) => null;
4+
5+
main() {
6+
void group() {
7+
void initialize() {
8+
final SOME_SUPER_LONG_CONST = 'Foo';
9+
var objects = [
10+
createSomeObject(SOME_SUPER_LONG_CONST, new Int64(1), mapFromStringToInt64:
11+
{'ONE': new Int64(1), 'TWO': new Int64(2), 'THREE': new Int64(3)}),
12+
];
13+
}
14+
}
15+
}
16+
<<<
17+
createSomeObject(
18+
String s,
19+
Int64 id, {
20+
Map<String, Int64> mapFromStringToInt64,
21+
}) => null;
22+
23+
main() {
24+
void group() {
25+
void initialize() {
26+
final SOME_SUPER_LONG_CONST = 'Foo';
27+
var objects = [
28+
createSomeObject(
29+
SOME_SUPER_LONG_CONST,
30+
new Int64(1),
31+
mapFromStringToInt64: {
32+
'ONE': new Int64(1),
33+
'TWO': new Int64(2),
34+
'THREE': new Int64(3),
35+
},
36+
),
37+
];
38+
}
39+
}
40+
}

test/tall/regression/0400/0421.unit

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
>>>
2+
@Component(
3+
selector: 'my-selector',
4+
properties: const ['property-1', 'property-2', 'property-3', 'property-4', 'property-5'])
5+
@View(
6+
directives: const [OtherComponent1, OtherComponent2, OtherComponent3, OtherDirective4, OtherDirective5, OtherDirective6, OtherDirective7,],
7+
styleUrls: const ['package:path.to.my.amazing.component.library/my_amazing_component.scss.css'],
8+
templateUrl: 'package:path.to.my.amazing.component.library/my_amazing_component.html')
9+
class MyAmazingComponent {
10+
var a = [[[1]]];
11+
}
12+
<<<
13+
@Component(selector: 'my-selector', properties: const [
14+
'property-1',
15+
'property-2',
16+
'property-3',
17+
'property-4',
18+
'property-5',
19+
])
20+
@View(
21+
directives: const [
22+
OtherComponent1,
23+
OtherComponent2,
24+
OtherComponent3,
25+
OtherDirective4,
26+
OtherDirective5,
27+
OtherDirective6,
28+
OtherDirective7,
29+
],
30+
styleUrls: const [
31+
'package:path.to.my.amazing.component.library/my_amazing_component.scss.css',
32+
],
33+
templateUrl:
34+
'package:path.to.my.amazing.component.library/my_amazing_component.html',
35+
)
36+
class MyAmazingComponent {
37+
var a = [
38+
[
39+
[1],
40+
],
41+
];
42+
}
43+
>>>
44+
@Component(
45+
selector: 'my-selector',
46+
properties: const ['property-1', 'property-2', 'property-3', 'property-4', 'property-5'])
47+
@View(
48+
directives: const [OtherComponent1, OtherComponent2, OtherComponent3, OtherDirective4, OtherDirective5, OtherDirective6, OtherDirective7,],
49+
templateUrl: 'package:path.to.my.amazing.component.library/my_amazing_component.html',
50+
styleUrls: const ['package:path.to.my.amazing.component.library/my_amazing_component.scss.css'])
51+
class MyAmazingComponent {
52+
var a = [[[1]]];
53+
}
54+
<<<
55+
@Component(selector: 'my-selector', properties: const [
56+
'property-1',
57+
'property-2',
58+
'property-3',
59+
'property-4',
60+
'property-5',
61+
])
62+
@View(
63+
directives: const [
64+
OtherComponent1,
65+
OtherComponent2,
66+
OtherComponent3,
67+
OtherDirective4,
68+
OtherDirective5,
69+
OtherDirective6,
70+
OtherDirective7,
71+
],
72+
templateUrl:
73+
'package:path.to.my.amazing.component.library/my_amazing_component.html',
74+
styleUrls: const [
75+
'package:path.to.my.amazing.component.library/my_amazing_component.scss.css',
76+
],
77+
)
78+
class MyAmazingComponent {
79+
var a = [
80+
[
81+
[1],
82+
],
83+
];
84+
}

test/tall/regression/0400/0422.unit

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
>>>
2+
void allTests() {
3+
describe('inliner', () {
4+
it('should inline `templateUrl` values', () async {
5+
expect(view.namedParameters
6+
.firstWhere((p) => p.name == 'templateUrl')
7+
.value).toContain('template.html');
8+
});
9+
});
10+
}
11+
<<<
12+
void allTests() {
13+
describe('inliner', () {
14+
it('should inline `templateUrl` values', () async {
15+
expect(
16+
view.namedParameters.firstWhere((p) => p.name == 'templateUrl').value,
17+
).toContain('template.html');
18+
});
19+
});
20+
}

test/tall/regression/0400/0424.stmt

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
>>>
2+
obj.functionWithTwoParameters(firstParameterGenerator()
3+
..id = myId
4+
..teamId = myTeamId
5+
..startTime = new Time(getEndOfDate(clock.currentTime()).millisecondsSinceEpoch), secondParameterGenerator());
6+
<<<
7+
obj.functionWithTwoParameters(
8+
firstParameterGenerator()
9+
..id = myId
10+
..teamId = myTeamId
11+
..startTime = new Time(
12+
getEndOfDate(clock.currentTime()).millisecondsSinceEpoch,
13+
),
14+
secondParameterGenerator(),
15+
);

test/tall/regression/0400/0429.stmt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
>>> (indent 2)
2+
final Map<String,
3+
SummaryTabDataRequest_CampaignSkinSubtype> _campaignSkinSubtypes =
4+
new Map.fromIterable(SummaryTabDataRequest_CampaignSkinSubtype.values,
5+
key: (campaignSkinSubtype) => campaignSkinSubtype.name,
6+
value: (campaignSkinSubtype) => campaignSkinSubtype);
7+
<<<
8+
final Map<String, SummaryTabDataRequest_CampaignSkinSubtype>
9+
_campaignSkinSubtypes = new Map.fromIterable(
10+
SummaryTabDataRequest_CampaignSkinSubtype.values,
11+
key: (campaignSkinSubtype) => campaignSkinSubtype.name,
12+
value: (campaignSkinSubtype) => campaignSkinSubtype,
13+
);

test/tall/regression/0400/0434.unit

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
>>> (indent 2)
2+
@eventHandler
3+
bool computeChangePasswordDisabled(
4+
String email, String password, String newPassword) =>
5+
email == null ||
6+
email.isEmpty ||
7+
password == null ||
8+
password.isEmpty ||
9+
newPassword == null ||
10+
newPassword.isEmpty;
11+
<<<
12+
@eventHandler
13+
bool computeChangePasswordDisabled(
14+
String email,
15+
String password,
16+
String newPassword,
17+
) =>
18+
email == null ||
19+
email.isEmpty ||
20+
password == null ||
21+
password.isEmpty ||
22+
newPassword == null ||
23+
newPassword.isEmpty;

0 commit comments

Comments
 (0)