diff options
Diffstat (limited to 'cli/tests/unit/buffer_test.ts')
-rw-r--r-- | cli/tests/unit/buffer_test.ts | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/cli/tests/unit/buffer_test.ts b/cli/tests/unit/buffer_test.ts index fdbadbfe4..7a628cae5 100644 --- a/cli/tests/unit/buffer_test.ts +++ b/cli/tests/unit/buffer_test.ts @@ -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, ); } } |