提交 2d16c71b 编写于 作者: J Johannes Rieken

add codeSnippet-lazyness test, #36796

上级 16be2376
......@@ -8,7 +8,7 @@
import * as assert from 'assert';
import { Snippet } from 'vs/workbench/parts/snippets/electron-browser/snippets.contribution';
suite('TMSnippets', function () {
suite('SnippetRewrite', function () {
function assertRewrite(input: string, expected: string | boolean): void {
const actual = Snippet._rewriteBogousVariables(input);
......@@ -43,4 +43,11 @@ suite('TMSnippets', function () {
test('Snippet choices: unable to escape comma and pipe, #31521', function () {
assertRewrite('console.log(${1|not\\, not, five, 5, 1 23|});', false);
});
test('lazy bogous variable rewrite', function () {
const snippet = new Snippet('foo', 'prefix', 'desc', 'This is ${bogous} because it is a ${var}', 'source');
assert.equal(snippet.body, 'This is ${bogous} because it is a ${var}');
assert.equal(snippet.codeSnippet, 'This is ${1:bogous} because it is a ${2:var}');
assert.equal(snippet.isBogous, true);
});
});
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册