提交 945f4bad 编写于 作者: D Daniel Imms

Add fallback to editor.fontFamily tests

上级 f0f87ca4
......@@ -56,8 +56,6 @@ export class TerminalConfigHelper implements ITerminalConfigHelper {
let fontFamily = this.config.fontFamily || editorConfig.fontFamily;
let i_rect = this._getBoundingRectFor('i', fontFamily, fontSize);
let w_rect = this._getBoundingRectFor('w', fontFamily, fontSize);
console.log('i_rect.width: ' + i_rect.width);
console.log('w_rect.width: ' + w_rect.width);
let invalidBounds = !i_rect.width || !w_rect.width;
if (invalidBounds) {
......
......@@ -136,7 +136,7 @@ suite('Workbench - TerminalConfigHelper', () => {
let configHelper = new TerminalConfigHelper(configurationService, null, null, null);
configHelper.panelContainer = fixture;
assert.equal(configHelper.configFontIsMonospace(), true, 'Monospace is mono-spaced');
assert.equal(configHelper.configFontIsMonospace(), true, 'monospace is monospaced');
});
test('TerminalConfigHelper - isMonospace sans-serif', function () {
......@@ -148,7 +148,7 @@ suite('Workbench - TerminalConfigHelper', () => {
});
let configHelper = new TerminalConfigHelper(configurationService, null, null, null);
configHelper.panelContainer = fixture;
assert.equal(configHelper.configFontIsMonospace(), false, 'sans-serif is not mono-spaced');
assert.equal(configHelper.configFontIsMonospace(), false, 'sans-serif is not monospaced');
});
test('TerminalConfigHelper - isMonospace serif', function () {
......@@ -160,6 +160,54 @@ suite('Workbench - TerminalConfigHelper', () => {
});
let configHelper = new TerminalConfigHelper(configurationService, null, null, null);
configHelper.panelContainer = fixture;
assert.equal(configHelper.configFontIsMonospace(), false, 'serif is not mono-spaced');
assert.equal(configHelper.configFontIsMonospace(), false, 'serif is not monospaced');
});
test('TerminalConfigHelper - isMonospace monospace falls back to editor.fontFamily', function () {
const configurationService = new TestConfigurationService();
configurationService.setUserConfiguration('editor', {
fontFamily: 'monospace'
});
configurationService.setUserConfiguration('terminal', {
integrated: {
fontFamily: null
}
});
let configHelper = new TerminalConfigHelper(configurationService, null, null, null);
configHelper.panelContainer = fixture;
assert.equal(configHelper.configFontIsMonospace(), true, 'monospace is monospaced');
});
test('TerminalConfigHelper - isMonospace sans-serif falls back to editor.fontFamily', function () {
const configurationService = new TestConfigurationService();
configurationService.setUserConfiguration('editor', {
fontFamily: 'sans-serif'
});
configurationService.setUserConfiguration('terminal', {
integrated: {
fontFamily: null
}
});
let configHelper = new TerminalConfigHelper(configurationService, null, null, null);
configHelper.panelContainer = fixture;
assert.equal(configHelper.configFontIsMonospace(), false, 'sans-serif is not monospaced');
});
test('TerminalConfigHelper - isMonospace serif falls back to editor.fontFamily', function () {
const configurationService = new TestConfigurationService();
configurationService.setUserConfiguration('editor', {
fontFamily: 'serif'
});
configurationService.setUserConfiguration('terminal', {
integrated: {
fontFamily: null
}
});
let configHelper = new TerminalConfigHelper(configurationService, null, null, null);
configHelper.panelContainer = fixture;
assert.equal(configHelper.configFontIsMonospace(), false, 'serif is not monospaced');
});
});
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册