summaryrefslogtreecommitdiff
path: root/std/io/bufio_test.ts
diff options
context:
space:
mode:
authorSamrith Shankar <samrith-s@users.noreply.github.com>2020-03-20 14:38:34 +0100
committerGitHub <noreply@github.com>2020-03-20 09:38:34 -0400
commit798904b0f2ed0c7284b67bba2f125f406b5850de (patch)
tree5aba8d35aa8984aa778c894258bcaed56f1ce17c /std/io/bufio_test.ts
parent35f6e2e45ddb96524a6bdf54b0a6155caa88d5e0 (diff)
Add require-await lint rule (#4401)
Diffstat (limited to 'std/io/bufio_test.ts')
-rw-r--r--std/io/bufio_test.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/std/io/bufio_test.ts b/std/io/bufio_test.ts
index d925175f1..ae38f6667 100644
--- a/std/io/bufio_test.ts
+++ b/std/io/bufio_test.ts
@@ -191,7 +191,7 @@ const testOutput = encoder.encode("0123456789abcdefghijklmnopqrstuvwxy");
class TestReader implements Reader {
constructor(private data: Uint8Array, private stride: number) {}
- async read(buf: Uint8Array): Promise<number | Deno.EOF> {
+ read(buf: Uint8Array): Promise<number | Deno.EOF> {
let nread = this.stride;
if (nread > this.data.byteLength) {
nread = this.data.byteLength;
@@ -200,11 +200,11 @@ class TestReader implements Reader {
nread = buf.byteLength;
}
if (nread === 0) {
- return Deno.EOF;
+ return Promise.resolve(Deno.EOF);
}
copyBytes(buf as Uint8Array, this.data);
this.data = this.data.subarray(nread);
- return nread;
+ return Promise.resolve(nread);
}
}