Skip to content

Commit 2522dfa

Browse files
authored
Migrate regression/0000/ (#1458)
Migrate regression/0000/ to tall style.
1 parent 66c3fa0 commit 2522dfa

Some content is hidden

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

62 files changed

+8256
-0
lines changed

test/tall/regression/0000/0000.stmt

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
>>>
2+
_log(new LogEntry(error.transform, error.transform.primaryId, LogLevel.ERROR,
3+
message, null), arg);
4+
<<<
5+
_log(
6+
new LogEntry(
7+
error.transform,
8+
error.transform.primaryId,
9+
LogLevel.ERROR,
10+
message,
11+
null,
12+
),
13+
arg,
14+
);
15+
>>> (indent 4)
16+
expect(date_format
17+
.parsePattern("hh:mm:ss")
18+
.map((x) => x.pattern)
19+
.toList(), orderedEquals(["hh", ":", "mm", ":", "ss"]));
20+
<<<
21+
expect(
22+
date_format.parsePattern("hh:mm:ss").map((x) => x.pattern).toList(),
23+
orderedEquals(["hh", ":", "mm", ":", "ss"]),
24+
);
25+
>>> (indent 4)
26+
classElement.forEachInstanceField(
27+
(ClassElement enclosingClass, VariableElement member) {
28+
HInstruction value = fieldValues[member];
29+
if (value == null) {
30+
// Uninitialized native fields are pre-initialized by the native
31+
// implementation.
32+
assert(isNativeUpgradeFactory);
33+
} else {
34+
fields.add(member);
35+
DartType type = localsHandler.substInContext(member.type);
36+
constructorArguments.add(potentiallyCheckOrTrustType(value, type));
37+
}
38+
}, includeSuperAndInjectedMembers: true);
39+
<<<
40+
classElement.forEachInstanceField((
41+
ClassElement enclosingClass,
42+
VariableElement member,
43+
) {
44+
HInstruction value = fieldValues[member];
45+
if (value == null) {
46+
// Uninitialized native fields are pre-initialized by the native
47+
// implementation.
48+
assert(isNativeUpgradeFactory);
49+
} else {
50+
fields.add(member);
51+
DartType type = localsHandler.substInContext(member.type);
52+
constructorArguments.add(potentiallyCheckOrTrustType(value, type));
53+
}
54+
}, includeSuperAndInjectedMembers: true);
55+
>>> (indent 6)
56+
HLoopBlockInformation info = new HLoopBlockInformation(
57+
HLoopBlockInformation.loopType(loop),
58+
wrapExpressionGraph(initializerGraph),
59+
wrapExpressionGraph(conditionExpression),
60+
wrapStatementGraph(bodyGraph), wrapExpressionGraph(updateGraph),
61+
conditionBlock.loopInformation.target,
62+
conditionBlock.loopInformation.labels,
63+
sourceFileLocationForBeginToken(loop),
64+
sourceFileLocationForEndToken(loop));
65+
<<<
66+
HLoopBlockInformation info = new HLoopBlockInformation(
67+
HLoopBlockInformation.loopType(loop),
68+
wrapExpressionGraph(initializerGraph),
69+
wrapExpressionGraph(conditionExpression),
70+
wrapStatementGraph(bodyGraph),
71+
wrapExpressionGraph(updateGraph),
72+
conditionBlock.loopInformation.target,
73+
conditionBlock.loopInformation.labels,
74+
sourceFileLocationForBeginToken(loop),
75+
sourceFileLocationForEndToken(loop),
76+
);
77+
>>> (indent 6)
78+
handleSwitch(node, new NullJumpHandler(compiler), buildExpression,
79+
node.cases, getConstants, (_) => false, // No case is default.
80+
buildSwitchCase);
81+
<<<
82+
handleSwitch(
83+
node,
84+
new NullJumpHandler(compiler),
85+
buildExpression,
86+
node.cases,
87+
getConstants,
88+
(_) => false, // No case is default.
89+
buildSwitchCase,
90+
);

test/tall/regression/0000/0005.stmt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
>>>
2+
var overlapping = _directories.keys.where((directory) =>
3+
path.isWithin(directory, rootDirectory) ||
4+
path.isWithin(rootDirectory, directory)).toList();
5+
<<<
6+
### TODO(rnystrom): Should allow an unsplit call chain target on the same line
7+
### as the `=`.
8+
var overlapping =
9+
_directories.keys
10+
.where(
11+
(directory) =>
12+
path.isWithin(directory, rootDirectory) ||
13+
path.isWithin(rootDirectory, directory),
14+
)
15+
.toList();
16+
>>>
17+
return isLoopback(server.address.host) == isLoopback(url.host) ||
18+
server.address.host == url.host;
19+
<<<
20+
return isLoopback(server.address.host) == isLoopback(url.host) ||
21+
server.address.host == url.host;

test/tall/regression/0000/0006.stmt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
>>>
2+
return _provideDirectorySources(graph.packages[package], "bin").then((_) => BarbackServer.bind(
3+
this, _hostname, 0, package: package, rootDirectory: "bin"));
4+
<<<
5+
return _provideDirectorySources(graph.packages[package], "bin").then(
6+
(_) => BarbackServer.bind(
7+
this,
8+
_hostname,
9+
0,
10+
package: package,
11+
rootDirectory: "bin",
12+
),
13+
);
14+
>>>
15+
messageMentionsAsset(id) =>
16+
messageMentions(id.toString()) ||
17+
messageMentions(path.fromUri(entry.assetId.path));
18+
<<<
19+
messageMentionsAsset(id) =>
20+
messageMentions(id.toString()) ||
21+
messageMentions(path.fromUri(entry.assetId.path));

test/tall/regression/0000/0009.unit

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
>>>
2+
List<Set<TransformerId>> _stageTransformers(
3+
Map<TransformerId, Set<TransformerId>> transformerDependencies) {}
4+
<<<
5+
List<Set<TransformerId>> _stageTransformers(
6+
Map<TransformerId, Set<TransformerId>> transformerDependencies,
7+
) {}

test/tall/regression/0000/0013.unit

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
40 columns |
2+
>>> no trailing whitespace before initializer comment
3+
class A {
4+
A()
5+
// comment
6+
: field = value;
7+
}
8+
<<<
9+
class A {
10+
A()
11+
// comment
12+
: field = value;
13+
}
14+
>>> no trailing whitespace before initializer comment when params wrap
15+
class A {
16+
A(some, very, long, parameter, list, that, wraps)
17+
// comment
18+
: field = value;
19+
}
20+
<<<
21+
class A {
22+
A(
23+
some,
24+
very,
25+
long,
26+
parameter,
27+
list,
28+
that,
29+
wraps,
30+
)
31+
// comment
32+
: field = value;
33+
}

test/tall/regression/0000/0014.unit

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
>>> https://github.com/dart-lang/dart_style/issues/14
2+
class A {
3+
final Map x;
4+
A() : x = {
5+
// comment
6+
'foo': 1,
7+
'bar': 2,
8+
};
9+
}
10+
<<<
11+
class A {
12+
final Map x;
13+
A()
14+
: x = {
15+
// comment
16+
'foo': 1,
17+
'bar': 2,
18+
};
19+
}

test/tall/regression/0000/0019.stmt

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
>>>
2+
return new _Concat(
3+
(left != null) ? left : this.left,
4+
(right != null) ? right : this.right);
5+
<<<
6+
return new _Concat(
7+
(left != null) ? left : this.left,
8+
(right != null) ? right : this.right,
9+
);
10+
>>> (indent 4)
11+
return new _Concat(
12+
(left != null) ? left : this.left,
13+
(right != null) ? right : this.right);
14+
<<<
15+
return new _Concat(
16+
(left != null) ? left : this.left,
17+
(right != null) ? right : this.right,
18+
);
19+
>>> (indent 4)
20+
format.maximumFractionDigits = decimalPos >= 0 ? totalDigits - decimalPos :
21+
0;
22+
<<<
23+
format.maximumFractionDigits =
24+
decimalPos >= 0 ? totalDigits - decimalPos : 0;
25+
>>> (indent 6)
26+
var libname = _builtins.containsKey(package) ? _builtins[package] : package;
27+
<<<
28+
var libname =
29+
_builtins.containsKey(package) ? _builtins[package] : package;

test/tall/regression/0000/0021.stmt

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
>>> (indent 2)
2+
verify(
3+
"Caractères qui doivent être échapper, par exemple barres \\ "
4+
"dollars \${ (les accolades sont ok), et xml/html réservés <& et "
5+
"des citations \" "
6+
"avec quelques paramètres ainsi 1, 2, et 3");
7+
<<<
8+
verify(
9+
"Caractères qui doivent être échapper, par exemple barres \\ "
10+
"dollars \${ (les accolades sont ok), et xml/html réservés <& et "
11+
"des citations \" "
12+
"avec quelques paramètres ainsi 1, 2, et 3",
13+
);
14+
>>> preserve newlines but not indent
15+
var map = {
16+
"nestedMessage" : "{combinedGender,select, "
17+
"other{"
18+
"{number,plural, "
19+
"=0{Personne n'avait allé à la {place}}"
20+
"=1{{names} était allé à la {place}}"
21+
"other{{names} étaient allés à la {place}}"
22+
"}"
23+
"}"
24+
"female{"
25+
"{number,plural, "
26+
"=1{{names} était allée à la {place}}"
27+
"other{{names} étaient allées à la {place}}"
28+
"}"
29+
"}"
30+
"}",
31+
};
32+
<<<
33+
var map = {
34+
"nestedMessage":
35+
"{combinedGender,select, "
36+
"other{"
37+
"{number,plural, "
38+
"=0{Personne n'avait allé à la {place}}"
39+
"=1{{names} était allé à la {place}}"
40+
"other{{names} étaient allés à la {place}}"
41+
"}"
42+
"}"
43+
"female{"
44+
"{number,plural, "
45+
"=1{{names} était allée à la {place}}"
46+
"other{{names} étaient allées à la {place}}"
47+
"}"
48+
"}"
49+
"}",
50+
};

test/tall/regression/0000/0022.stmt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
>>>
2+
pluralThatFailsParsing(noOfThings) => Intl.plural(noOfThings,
3+
one: "1 thing:",
4+
other: "$noOfThings things:",
5+
name: "pluralThatFailsParsing",
6+
args: [noOfThings],
7+
desc: "How many things are there?");
8+
<<<
9+
pluralThatFailsParsing(noOfThings) => Intl.plural(
10+
noOfThings,
11+
one: "1 thing:",
12+
other: "$noOfThings things:",
13+
name: "pluralThatFailsParsing",
14+
args: [noOfThings],
15+
desc: "How many things are there?",
16+
);
17+
>>> (indent 2)
18+
parser.addOption("output-dir", defaultsTo: '.',
19+
callback: (value) => targetDir = value);
20+
<<<
21+
parser.addOption(
22+
"output-dir",
23+
defaultsTo: '.',
24+
callback: (value) => targetDir = value,
25+
);

test/tall/regression/0000/0023.stmt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
>>>
2+
return options.releaseMode &&
3+
4+
// TODO(sigmund): remove this exclusion once we have dev_transformers
5+
// (dartbug.com/14187)
6+
!id.path.startsWith('lib/') &&
7+
8+
// may filter non-entry HTML files and internal artifacts
9+
(id.extension == '.html' || id.extension == _DATA_EXTENSION) &&
10+
11+
// keep any entry points
12+
!options.isHtmlEntryPoint(id);
13+
<<<
14+
return options.releaseMode &&
15+
// TODO(sigmund): remove this exclusion once we have dev_transformers
16+
// (dartbug.com/14187)
17+
!id.path.startsWith('lib/') &&
18+
// may filter non-entry HTML files and internal artifacts
19+
(id.extension == '.html' || id.extension == _DATA_EXTENSION) &&
20+
// keep any entry points
21+
!options.isHtmlEntryPoint(id);

0 commit comments

Comments
 (0)