mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-15 07:28:05 +00:00
* Initial plan * Add test for issue #251527 - BOM character preservation in VSBuffer Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: bpasero <900690+bpasero@users.noreply.github.com>
This commit is contained in:
@@ -19,6 +19,20 @@ suite('Buffer', () => {
|
||||
assert.deepStrictEqual(buffer.toString(), 'hi');
|
||||
});
|
||||
|
||||
test('issue #251527 - VSBuffer#toString preserves BOM character in filenames', () => {
|
||||
// BOM character (U+FEFF) is a zero-width character that was being stripped
|
||||
// when deserializing messages in the IPC layer. This test verifies that
|
||||
// the BOM character is preserved when using VSBuffer.toString().
|
||||
const bomChar = '\uFEFF';
|
||||
const filename = `${bomChar}c.txt`;
|
||||
const buffer = VSBuffer.fromString(filename);
|
||||
const result = buffer.toString();
|
||||
|
||||
// Verify the BOM character is preserved
|
||||
assert.strictEqual(result, filename);
|
||||
assert.strictEqual(result.charCodeAt(0), 0xFEFF);
|
||||
});
|
||||
|
||||
test('bufferToReadable / readableToBuffer', () => {
|
||||
const content = 'Hello World';
|
||||
const readable = bufferToReadable(VSBuffer.fromString(content));
|
||||
|
||||
Reference in New Issue
Block a user