From 9b4da88a96ce4c793e7b15d9b340fa6326a29a82 Mon Sep 17 00:00:00 2001 From: uki00a Date: Wed, 20 May 2020 23:34:20 +0900 Subject: fix(std/io): BufReader should not share the internal buffer across reads (#4543) --- std/textproto/test.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'std/textproto') diff --git a/std/textproto/test.ts b/std/textproto/test.ts index 3b71bc08c..ec66bfd8c 100644 --- a/std/textproto/test.ts +++ b/std/textproto/test.ts @@ -180,3 +180,16 @@ test({ assertEquals(m.get("Content-Disposition"), 'form-data; name="test"'); }, }); + +test({ + name: "[textproto] #4521 issue", + async fn() { + const input = "abcdefghijklmnopqrstuvwxyz"; + const bufSize = 25; + const tp = new TextProtoReader( + new BufReader(stringsReader(input), bufSize) + ); + const line = await tp.readLine(); + assertEquals(line, input); + }, +}); -- cgit v1.2.3