Skip to content

Commit b776d5a

Browse files
kinkeGeod24
authored andcommitted
Fix tests
1 parent 2beb819 commit b776d5a

File tree

8 files changed

+167
-41
lines changed

8 files changed

+167
-41
lines changed

tests/knr/array_access.d.ref

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
unittest {
22
foo([
3-
target.value.region[1], target.value.region[1],
4-
target.value.region[1], target.value.region[1], target.value.region[1]
5-
]);
3+
target.value.region[1], target.value.region[1], target.value.region[1],
4+
target.value.region[1], target.value.region[1]
5+
]);
66
}

tests/knr/associative_array.d.ref

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
unittest {
22
Bson base = Bson([
3-
"maps": Bson([
4-
Bson(["id": Bson(4), "comment": Bson("hello")]),
5-
Bson(["id": Bson(49), "comment": Bson(null)])
6-
]),
7-
"short": Bson(["a": "b", "c": "d"]),
8-
"numbers": Bson([
9-
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
10-
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0
11-
]),
12-
"shuffleOnReset": serializeToBson([
13-
"all": false,
14-
"selected": true,
15-
"maybe": false
16-
]),
17-
"resetOnEmpty": Bson(false),
18-
"applyMods": Bson(true),
19-
"sendComments": Bson(true)
20-
]);
3+
"maps": Bson([
4+
Bson(["id": Bson(4), "comment": Bson("hello")]),
5+
Bson(["id": Bson(49), "comment": Bson(null)])
6+
]),
7+
"short": Bson(["a": "b", "c": "d"]),
8+
"numbers": Bson([
9+
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2,
10+
3, 4, 5, 6, 7, 8, 9, 0
11+
]),
12+
"shuffleOnReset": serializeToBson([
13+
"all": false,
14+
"selected": true,
15+
"maybe": false
16+
]),
17+
"resetOnEmpty": Bson(false),
18+
"applyMods": Bson(true),
19+
"sendComments": Bson(true)
20+
]);
2121
int[] x = [
2222
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3,
2323
4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0
Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
auto find()
22
{
33
return Map.findRange([
4-
"$and": [
5-
["deleted": Bson(false)],
6-
[
7-
"$or": Bson([
8-
serializeToBson(["forceUpdate": Bson(true)]),
9-
serializeToBson([
10-
"info.approved": ["$eq": Bson(1)],
11-
"fetchDate": [
12-
"$lte": Bson(BsonDate(currentTime - 60.days))
13-
]
14-
]),
15-
serializeToBson([
16-
"info.approved": ["$ne": Bson(1)],
17-
"fetchDate": [
18-
"$lte": Bson(BsonDate(currentTime - 14.days))
19-
]
20-
])
21-
])
22-
]
4+
"$and": [
5+
["deleted": Bson(false)],
6+
[
7+
"$or": Bson([
8+
serializeToBson(["forceUpdate": Bson(true)]),
9+
serializeToBson([
10+
"info.approved": ["$eq": Bson(1)],
11+
"fetchDate": [
12+
"$lte": Bson(BsonDate(currentTime - 60.days))
13+
]
14+
]),
15+
serializeToBson([
16+
"info.approved": ["$ne": Bson(1)],
17+
"fetchDate": [
18+
"$lte": Bson(BsonDate(currentTime - 14.days))
19+
]
20+
])
21+
])
2322
]
24-
]);
23+
]
24+
]);
2525
}

tests/knr/issue0451.d.ref

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
class C {
2+
abstract void f1() //
3+
in (true);
4+
5+
abstract void f2() /* */
6+
in (true);
7+
8+
abstract bool f3() //
9+
out (r; r);
10+
11+
abstract bool f4() /* */
12+
out (r; r);
13+
14+
abstract void f5() //
15+
do {
16+
}
17+
18+
abstract void f6() /* */
19+
do {
20+
}
21+
22+
abstract bool f7() //
23+
in (true) //
24+
out (r; r) //
25+
do //
26+
{
27+
return true;
28+
}
29+
30+
abstract bool f8() /* */
31+
in (true) /* */
32+
out (r; r) /* */
33+
do /* */
34+
{
35+
return true;
36+
}
37+
}

tests/knr/issue0528.d.ref

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
void f() return
2+
do {
3+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
unittest {
2+
functionLengthDoesMatter([
3+
firstFunctionInChain("A").seconFunctionInChain("B").value,
4+
firstFunctionInChain("A").seconFunctionInChain("B").value
5+
]);
6+
}

tests/knr/keep_single_indent.d.ref

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
unittest {
2+
{
3+
bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo,
4+
Three charlie, double delta)
5+
{
6+
if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo
7+
&& foxtrot && golf && hotel && india && juliet) {
8+
}
9+
}
10+
}
11+
}
12+
13+
void f()
14+
{
15+
string a = "foo"
16+
~ "bar" /* bar */
17+
~ "baz";
18+
}
19+
20+
unittest {
21+
if (a) {
22+
while (sBraceDepth == 0 && indents.topIsTemp()
23+
&& ((indents.top != tok!"if" && indents.top != tok!"version")
24+
|| !peekIs(tok!"else")))
25+
a();
26+
}
27+
}
28+
29+
unittest {
30+
callFunc({ int i = 10; return i; });
31+
callFunc({
32+
int i = 10;
33+
foo(alpha, bravo, charlie, delta, echo, foxtrot, golf, echo);
34+
doStuff(withThings, andOtherStuff);
35+
return i;
36+
});
37+
callFunc({
38+
int i = 10;
39+
foo(alpha_longVarName, bravo_longVarName, charlie_longVarName, delta_longVarName,
40+
echo_longVarName, foxtrot_longVarName, golf_longVarName, echo_longVarName);
41+
doStuff(withThings, andOtherStuff);
42+
return i;
43+
}, more_stuff);
44+
}

tests/knr/single_indent.d.ref

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
unittest {
2+
{
3+
bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo,
4+
Three charlie, double delta)
5+
{
6+
if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo
7+
&& foxtrot && golf && hotel && india && juliet) {
8+
}
9+
}
10+
}
11+
}
12+
13+
unittest {
14+
if (a) {
15+
while (sBraceDepth == 0 && indents.topIsTemp()
16+
&& ((indents.top != tok!"if" && indents.top != tok!"version") || !peekIs(tok!"else")))
17+
a();
18+
}
19+
}
20+
21+
unittest {
22+
callFunc({ int i = 10; return i; });
23+
callFunc({
24+
int i = 10;
25+
foo(alpha, bravo, charlie, delta, echo, foxtrot, golf, echo);
26+
doStuff(withThings, andOtherStuff);
27+
return i;
28+
});
29+
callFunc({
30+
int i = 10;
31+
foo(alpha_longVarName, bravo_longVarName, charlie_longVarName, delta_longVarName,
32+
echo_longVarName, foxtrot_longVarName, golf_longVarName, echo_longVarName);
33+
doStuff(withThings, andOtherStuff);
34+
return i;
35+
}, more_stuff);
36+
}

0 commit comments

Comments
 (0)