-
-
Notifications
You must be signed in to change notification settings - Fork 101
Expand file tree
/
Copy pathutf8_boundary.test.js
More file actions
19 lines (16 loc) · 771 Bytes
/
utf8_boundary.test.js
File metadata and controls
19 lines (16 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
describe("UTF-8 handling at 8KB boundary", () => {
test("should handle emoji at 8KB boundary without corruption", () => {
// Create a string where emoji appears right at 8192 byte boundary
// Each 'a' is 1 byte, emoji is 4 bytes
const padding = "a".repeat(8190);
const testCode = `# ${padding}\nputs "🚀 test"`;
// The formatted result should contain the emoji, not replacement characters
return expect(testCode).toMatchFormat();
});
test("should handle multiple emojis around 8KB boundary", () => {
// Test with emojis before, at, and after 8KB boundary
const beforeBoundary = "a".repeat(8180);
const testCode = `# ${beforeBoundary}\n# 🎨🎭🎪🎯\nputs "test"`;
return expect(testCode).toMatchFormat();
});
});