Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix tests #544

Merged
merged 1 commit into from
Oct 31, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions tests/knr/array_access.d.ref
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
unittest {
foo([
target.value.region[1], target.value.region[1],
target.value.region[1], target.value.region[1], target.value.region[1]
]);
target.value.region[1], target.value.region[1], target.value.region[1],
target.value.region[1], target.value.region[1]
]);
}
36 changes: 18 additions & 18 deletions tests/knr/associative_array.d.ref
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
unittest {
Bson base = Bson([
"maps": Bson([
Bson(["id": Bson(4), "comment": Bson("hello")]),
Bson(["id": Bson(49), "comment": Bson(null)])
]),
"short": Bson(["a": "b", "c": "d"]),
"numbers": Bson([
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0
]),
"shuffleOnReset": serializeToBson([
"all": false,
"selected": true,
"maybe": false
]),
"resetOnEmpty": Bson(false),
"applyMods": Bson(true),
"sendComments": Bson(true)
]);
"maps": Bson([
Bson(["id": Bson(4), "comment": Bson("hello")]),
Bson(["id": Bson(49), "comment": Bson(null)])
]),
"short": Bson(["a": "b", "c": "d"]),
"numbers": Bson([
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2,
3, 4, 5, 6, 7, 8, 9, 0
]),
"shuffleOnReset": serializeToBson([
"all": false,
"selected": true,
"maybe": false
]),
"resetOnEmpty": Bson(false),
"applyMods": Bson(true),
"sendComments": Bson(true)
]);
int[] x = [
1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 1, 2, 3,
4, 5, 6, 7, 8, 9, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0
Expand Down
40 changes: 20 additions & 20 deletions tests/knr/associative_array_complex.d.ref
Original file line number Diff line number Diff line change
@@ -1,25 +1,25 @@
auto find()
{
return Map.findRange([
"$and": [
["deleted": Bson(false)],
[
"$or": Bson([
serializeToBson(["forceUpdate": Bson(true)]),
serializeToBson([
"info.approved": ["$eq": Bson(1)],
"fetchDate": [
"$lte": Bson(BsonDate(currentTime - 60.days))
]
]),
serializeToBson([
"info.approved": ["$ne": Bson(1)],
"fetchDate": [
"$lte": Bson(BsonDate(currentTime - 14.days))
]
])
])
]
"$and": [
["deleted": Bson(false)],
[
"$or": Bson([
serializeToBson(["forceUpdate": Bson(true)]),
serializeToBson([
"info.approved": ["$eq": Bson(1)],
"fetchDate": [
"$lte": Bson(BsonDate(currentTime - 60.days))
]
]),
serializeToBson([
"info.approved": ["$ne": Bson(1)],
"fetchDate": [
"$lte": Bson(BsonDate(currentTime - 14.days))
]
])
])
]
]);
]
]);
}
37 changes: 37 additions & 0 deletions tests/knr/issue0451.d.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
class C {
abstract void f1() //
in (true);

abstract void f2() /* */
in (true);

abstract bool f3() //
out (r; r);

abstract bool f4() /* */
out (r; r);

abstract void f5() //
do {
}

abstract void f6() /* */
do {
}

abstract bool f7() //
in (true) //
out (r; r) //
do //
{
return true;
}

abstract bool f8() /* */
in (true) /* */
out (r; r) /* */
do /* */
{
return true;
}
}
3 changes: 3 additions & 0 deletions tests/knr/issue0528.d.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
void f() return
do {
}
6 changes: 6 additions & 0 deletions tests/knr/keep_break_in_array_chain.d.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
unittest {
functionLengthDoesMatter([
firstFunctionInChain("A").seconFunctionInChain("B").value,
firstFunctionInChain("A").seconFunctionInChain("B").value
]);
}
44 changes: 44 additions & 0 deletions tests/knr/keep_single_indent.d.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
unittest {
{
bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo,
Three charlie, double delta)
{
if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo
&& foxtrot && golf && hotel && india && juliet) {
}
}
}
}

void f()
{
string a = "foo"
~ "bar" /* bar */
~ "baz";
}

unittest {
if (a) {
while (sBraceDepth == 0 && indents.topIsTemp()
&& ((indents.top != tok!"if" && indents.top != tok!"version")
|| !peekIs(tok!"else")))
a();
}
}

unittest {
callFunc({ int i = 10; return i; });
callFunc({
int i = 10;
foo(alpha, bravo, charlie, delta, echo, foxtrot, golf, echo);
doStuff(withThings, andOtherStuff);
return i;
});
callFunc({
int i = 10;
foo(alpha_longVarName, bravo_longVarName, charlie_longVarName, delta_longVarName,
echo_longVarName, foxtrot_longVarName, golf_longVarName, echo_longVarName);
doStuff(withThings, andOtherStuff);
return i;
}, more_stuff);
}
36 changes: 36 additions & 0 deletions tests/knr/single_indent.d.ref
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
unittest {
{
bool anotherTemplatedFunction(One, Two, Three)(One alpha, Two bravo,
Three charlie, double delta)
{
if (isNumeric!One && isNumeric!Two && isNumeric!Three && echo
&& foxtrot && golf && hotel && india && juliet) {
}
}
}
}

unittest {
if (a) {
while (sBraceDepth == 0 && indents.topIsTemp()
&& ((indents.top != tok!"if" && indents.top != tok!"version") || !peekIs(tok!"else")))
a();
}
}

unittest {
callFunc({ int i = 10; return i; });
callFunc({
int i = 10;
foo(alpha, bravo, charlie, delta, echo, foxtrot, golf, echo);
doStuff(withThings, andOtherStuff);
return i;
});
callFunc({
int i = 10;
foo(alpha_longVarName, bravo_longVarName, charlie_longVarName, delta_longVarName,
echo_longVarName, foxtrot_longVarName, golf_longVarName, echo_longVarName);
doStuff(withThings, andOtherStuff);
return i;
}, more_stuff);
}