Use dprint for internal formatting (#6682)

This commit is contained in:
David Sherret 2020-07-14 15:24:17 -04:00 committed by GitHub
parent 9eca71caa1
commit cde4dbb351
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
378 changed files with 3116 additions and 3121 deletions

View file

@ -46,7 +46,7 @@ async function fillBytes(
buf: Deno.Buffer,
s: string,
n: number,
fub: Uint8Array
fub: Uint8Array,
): Promise<string> {
check(buf, s);
for (; n > 0; n--) {
@ -64,7 +64,7 @@ async function fillBytes(
async function empty(
buf: Deno.Buffer,
s: string,
fub: Uint8Array
fub: Uint8Array,
): Promise<void> {
check(buf, s);
while (true) {
@ -166,7 +166,7 @@ unitTest(async function bufferTooLargeByteWrites(): Promise<void> {
buf.grow(growLen);
},
Error,
"grown beyond the maximum size"
"grown beyond the maximum size",
);
});
@ -179,8 +179,9 @@ unitTest(
let written = 0;
const buf = new Deno.Buffer();
const writes = Math.floor(capacity / bufSize);
for (let i = 0; i < writes; i++)
for (let i = 0; i < writes; i++) {
written += buf.writeSync(repeat("x", bufSize));
}
if (written < capacity) {
written += buf.writeSync(repeat("x", capacity - written));
@ -188,7 +189,7 @@ unitTest(
assertEquals(written, capacity);
}
}
},
);
unitTest(
@ -202,9 +203,9 @@ unitTest(
await buf.readFrom(reader);
},
Error,
"grown beyond the maximum size"
"grown beyond the maximum size",
);
}
},
);
unitTest(
@ -218,9 +219,9 @@ unitTest(
buf.readFromSync(reader);
},
Error,
"grown beyond the maximum size"
"grown beyond the maximum size",
);
}
},
);
unitTest(
@ -234,7 +235,7 @@ unitTest(
assertEquals(buf.length, capacity);
}
}
},
);
unitTest(
@ -247,7 +248,7 @@ unitTest(
await buf.readFrom(reader);
assertEquals(buf.length, capacity);
}
}
},
);
unitTest(
@ -261,7 +262,7 @@ unitTest(
await buf.readFrom(reader);
assertEquals(buf.length, capacity);
}
}
},
);
unitTest(async function bufferLargeByteReads(): Promise<void> {
@ -292,7 +293,7 @@ unitTest(async function bufferReadFrom(): Promise<void> {
buf,
"",
5,
testBytes.subarray(0, Math.floor(testBytes.byteLength / i))
testBytes.subarray(0, Math.floor(testBytes.byteLength / i)),
);
const b = new Deno.Buffer();
await b.readFrom(buf);
@ -314,7 +315,7 @@ unitTest(async function bufferReadFromSync(): Promise<void> {
buf,
"",
5,
testBytes.subarray(0, Math.floor(testBytes.byteLength / i))
testBytes.subarray(0, Math.floor(testBytes.byteLength / i)),
);
const b = new Deno.Buffer();
b.readFromSync(buf);
@ -340,11 +341,11 @@ unitTest(async function bufferTestGrow(): Promise<void> {
// Check that buffer has correct data.
assertEquals(
buf.bytes().subarray(0, startLen - nread),
xBytes.subarray(nread)
xBytes.subarray(nread),
);
assertEquals(
buf.bytes().subarray(startLen - nread, startLen - nread + growLen),
yBytes
yBytes,
);
}
}