From d308e8d0c0469419517e05a36ba070633168dc67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Wed, 29 Apr 2020 22:38:10 +0200 Subject: BREAKING: remove custom implementation of Deno.Buffer.toString() (#4992) Keep in mind Buffer.toString() still exists, but returns [object Object]. Reason for removal of Buffer.toString() was that it implicitly used TextDecoder with fixed "utf-8" encoding and no way to customize the encoding. --- std/io/ioutil_test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'std/io') diff --git a/std/io/ioutil_test.ts b/std/io/ioutil_test.ts index 1f552d0e6..cf8eaf437 100644 --- a/std/io/ioutil_test.ts +++ b/std/io/ioutil_test.ts @@ -76,7 +76,7 @@ Deno.test("testCopyN1", async function (): Promise { const r = stringsReader("abcdefghij"); const n = await copyN(r, w, 3); assertEquals(n, 3); - assertEquals(w.toString(), "abc"); + assertEquals(new TextDecoder().decode(w.bytes()), "abc"); }); Deno.test("testCopyN2", async function (): Promise { @@ -84,7 +84,7 @@ Deno.test("testCopyN2", async function (): Promise { const r = stringsReader("abcdefghij"); const n = await copyN(r, w, 11); assertEquals(n, 10); - assertEquals(w.toString(), "abcdefghij"); + assertEquals(new TextDecoder().decode(w.bytes()), "abcdefghij"); }); Deno.test("copyNWriteAllData", async function (): Promise { -- cgit v1.2.3