diff options
author | Yoshiya Hinosawa <stibium121@gmail.com> | 2019-10-31 23:57:09 +0900 |
---|---|---|
committer | Ry Dahl <ry@tinyclouds.org> | 2019-10-31 10:57:09 -0400 |
commit | 4f8c9369744bfa4b1223cec916cb0e5b261831dc (patch) | |
tree | 318601f91dd945584f540d40703e3d688ae85e0d /cli/js/tls_test.ts | |
parent | 64957d92efdfbb8008e51c9d501b0d6754a777b7 (diff) |
Make EOF unique symbol (#3244)
Diffstat (limited to 'cli/js/tls_test.ts')
-rw-r--r-- | cli/js/tls_test.ts | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cli/js/tls_test.ts b/cli/js/tls_test.ts index 58cafd23e..6966a6911 100644 --- a/cli/js/tls_test.ts +++ b/cli/js/tls_test.ts @@ -184,7 +184,10 @@ testPerm({ read: true, net: true }, async function dialAndListenTLS(): Promise< await w.flush(); const tpr = new TextProtoReader(r); const statusLine = await tpr.readLine(); - assert(!!statusLine, "line must be read: " + statusLine); + assert(statusLine !== Deno.EOF, `line must be read: ${String(statusLine)}`); + if (statusLine === Deno.EOF) { + return; + } const m = statusLine.match(/^(.+?) (.+?) (.+?)$/); assert(m !== null, "must be matched"); const [_, proto, status, ok] = m; @@ -192,6 +195,10 @@ testPerm({ read: true, net: true }, async function dialAndListenTLS(): Promise< assertEquals(status, "200"); assertEquals(ok, "OK"); const headers = await tpr.readMIMEHeader(); + assert(headers !== Deno.EOF); + if (headers === Deno.EOF) { + return; + } const contentLength = parseInt(headers.get("content-length")); const bodyBuf = new Uint8Array(contentLength); await r.readFull(bodyBuf); |