Skip to content

Commit

Permalink
add test for notebook scoring, #141143
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Feb 10, 2022
1 parent b58c215 commit d457a89
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/vs/editor/test/common/modes/languageSelector.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,21 @@ suite('LanguageSelector', function () {
assert.strictEqual(score(['fooLang', '*', { language: '*', hasAccessToAllModels: true }], doc.uri, doc.langId, false, undefined), 5);
});

test('score, notebookType', function () {
let obj = {
uri: URI.parse('file:/my/file.js'),
langId: 'javascript',
notebookType: 'fooBook'
};

assert.strictEqual(score('javascript', obj.uri, obj.langId, true, undefined), 10);
assert.strictEqual(score('javascript', obj.uri, obj.langId, true, obj.notebookType), 10);
assert.strictEqual(score({ notebookType: 'fooBook' }, obj.uri, obj.langId, true, obj.notebookType), 10);
assert.strictEqual(score({ notebookType: 'fooBook', language: '*' }, obj.uri, obj.langId, true, obj.notebookType), 10);
assert.strictEqual(score({ notebookType: '*', language: '*' }, obj.uri, obj.langId, true, obj.notebookType), 5);
assert.strictEqual(score({ notebookType: '*', language: 'javascript' }, obj.uri, obj.langId, true, obj.notebookType), 10);
});

test('Document selector match - unexpected result value #60232', function () {
let selector = {
language: 'json',
Expand Down

0 comments on commit d457a89

Please sign in to comment.