aboutsummaryrefslogtreecommitdiff
path: root/integration/bunjs-only-snippets/text-encoder.test.js
diff options
context:
space:
mode:
Diffstat (limited to 'integration/bunjs-only-snippets/text-encoder.test.js')
-rw-r--r--integration/bunjs-only-snippets/text-encoder.test.js9
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 += " ";