summaryrefslogtreecommitdiff
path: root/net/textproto_test.ts
diff options
context:
space:
mode:
authorKevin (Kun) "Kassimo" Qian <kevinkassimo@gmail.com>2018-12-31 04:00:28 -0500
committerRyan Dahl <ry@tinyclouds.org>2018-12-31 09:00:28 +0000
commit95e378a28b0e0ba1d05f2a41bc27a7368aac66f4 (patch)
tree4df653a73ffbbe4d62a79d69d743fe6f6224ae50 /net/textproto_test.ts
parentb5f6f972342dbc5e1a4a3116743d812ec6baddea (diff)
Avoid textproto crashing on empty reader (denoland/deno_std#50)
Original: https://github.com/denoland/deno_std/commit/9eb6aa5fd9da9da9cd2b96a5199cf9b9128fd456
Diffstat (limited to 'net/textproto_test.ts')
-rw-r--r--net/textproto_test.ts7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/textproto_test.ts b/net/textproto_test.ts
index ad7e6a2c4..3af21247a 100644
--- a/net/textproto_test.ts
+++ b/net/textproto_test.ts
@@ -93,3 +93,10 @@ test(async function textprotoAppend() {
const joined = append(u1, u2);
assertEqual(dec.decode(joined), "Hello World");
});
+
+test(async function textprotoReadEmpty() {
+ let r = reader("");
+ let [m, err] = await r.readMIMEHeader();
+ // Should not crash!
+ assertEqual(err, "EOF");
+});