mirror of
https://github.com/usebruno/bruno.git
synced 2026-06-23 12:45:38 +00:00
fix sanitize name function tests in bruno-electron
This commit is contained in:
@@ -2,9 +2,13 @@ const { sanitizeName, isWSLPath, normalizeWSLPath, normalizeAndResolvePath } = r
|
||||
|
||||
describe('sanitizeName', () => {
|
||||
it('should replace invalid characters with hyphens', () => {
|
||||
const input = '<>:"/\|?*\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F';
|
||||
const expectedOutput = '----------------------------------------';
|
||||
expect(sanitizeName(input)).toEqual(expectedOutput);
|
||||
expect(sanitizeName(
|
||||
'valid<>:"/\|?*\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F'
|
||||
)).toEqual('valid----------------------------------------');
|
||||
|
||||
expect(sanitizeName(
|
||||
'<>:"/\|?*\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1Fvalid<>:"/\|?*\x00\x01\x02\x03\x04\x05\x06\x07\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F\x10\x11\x12\x13\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F'
|
||||
)).toEqual('valid----------------------------------------');
|
||||
});
|
||||
|
||||
it('should not modify valid directory names', () => {
|
||||
|
||||
Reference in New Issue
Block a user