From 56e453f14aeb3dc93e1265391d87f88b6eb62562 Mon Sep 17 00:00:00 2001 From: Mestery Date: Fri, 7 May 2021 19:06:45 +0200 Subject: [PATCH] test: encoding issues (#42) * test: encoding issues * Update contentProcessing.test.ts * Update src/helpers/__tests__/contentProcessing.test.ts Co-authored-by: Aakodal <48600424+Aakodal@users.noreply.github.com> Co-authored-by: Aakodal <48600424+Aakodal@users.noreply.github.com> --- src/helpers/__tests__/contentProcessing.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/helpers/__tests__/contentProcessing.test.ts b/src/helpers/__tests__/contentProcessing.test.ts index daa3de0..e1d4c3a 100644 --- a/src/helpers/__tests__/contentProcessing.test.ts +++ b/src/helpers/__tests__/contentProcessing.test.ts @@ -48,6 +48,17 @@ describe(processContent, () => { expect(results?.[0]).toEqual(`${results?.[1].slice(0, -3)}python>`); }); + it("should work with utf8", async () => { + console.error = jest.fn(); + const results = await processContent( + // eslint-disable-next-line max-len + "```Ḽơᶉëᶆ ȋṕšᶙṁ ḍỡḽǭᵳ ʂǐť ӓṁệẗ, ĉṓɲṩḙċťᶒțûɾ ấɖḯƥĭṩčįɳġ ḝłįʈ, șếᶑ ᶁⱺ ẽḭŭŝḿꝋď ṫĕᶆᶈṓɍ ỉñḉīḑȋᵭṵńť ṷŧ ḹẩḇőꝛế éȶ đꝍꞎôꝛȇ ᵯáꞡᶇā ąⱡîɋṹẵ.``` ```py\ná'bç'dé'f'g'h'k```", + 1, + ); + expect(console.error).not.toBeCalled(); + expect(results).toEqual(expect.stringMatching(`${binUrl()} ${binUrl("py")}`)); + }); + it("should make the corrects changes", async () => { expect(await processContent("see : `this\nis\nmultiline !`", MAX_LINES)).toEqual( expect.stringMatching(new RegExp(`see : ${binUrl()}`)),