diff options
author | 2022-02-24 00:59:19 -0800 | |
---|---|---|
committer | 2022-02-24 00:59:19 -0800 | |
commit | 8effa394100b26805cc9ca298659f1a5a7c3dda9 (patch) | |
tree | 54fda1f4ab7b8d901c984d25b8d1c3c407a0349b /integration/bunjs-only-snippets/text-encoder.test.js | |
parent | 5f50de2b390ef1ddfe2e108d285024ef45d4c421 (diff) | |
download | bun-8effa394100b26805cc9ca298659f1a5a7c3dda9.tar.gz bun-8effa394100b26805cc9ca298659f1a5a7c3dda9.tar.zst bun-8effa394100b26805cc9ca298659f1a5a7c3dda9.zip |
[bun.js] Add `ShadowRealm`
Diffstat (limited to 'integration/bunjs-only-snippets/text-encoder.test.js')
-rw-r--r-- | integration/bunjs-only-snippets/text-encoder.test.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/integration/bunjs-only-snippets/text-encoder.test.js b/integration/bunjs-only-snippets/text-encoder.test.js index 3b0c1f971..e4bf35059 100644 --- a/integration/bunjs-only-snippets/text-encoder.test.js +++ b/integration/bunjs-only-snippets/text-encoder.test.js @@ -69,6 +69,15 @@ describe("TextEncoder", () => { } }); + it("should encode long latin1 text", () => { + const text = "Hello World!".repeat(1000); + const encoder = new TextEncoder(); + const encoded = encoder.encode(text); + expect(encoded instanceof Uint8Array).toBe(true); + expect(encoded.length).toBe(text.length); + expect(new TextDecoder().decode(encoded)).toBe(text); + }); + it("should encode latin1 rope text", () => { var text = "Hello"; text += " "; |