60
61
export function assertMapping(writeFileIfDifferent: boolean, mapper: IKeyboardMapper, file: string): Promise<void> {
62
>
const filePath = path.normalize(FileAccess.asFileUri(`vs/workbench/services/keybinding/test/node/${file}`).fsPath);
keyboardMapperTestUtils.ts
63
>
64
>
return fs.promises.readFile(filePath).then((buff) => {
65
>
const expected = buff.toString().replace(/\r\n/g, '\n');
66
>
const actual = mapper.dumpDebugInfo().replace(/\r\n/g, '\n');
67
>
if (actual !== expected && writeFileIfDifferent) {
68
const destPath = filePath.replace(/[\/\\]out[\/\\]vs[\/\\]workbench/, '/src/vs/workbench');
69
Promises.writeFile(destPath, actual);
70
}
72
>
});
73
>
}