Skip to content

Commit b71f44b

Browse files
committed
🔨 Fix inactive assertions on choice options
Signed-off-by: Babak K. Shandiz <[email protected]>
1 parent c64dd2e commit b71f44b

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/vs/editor/contrib/snippet/test/browser/snippetParser.test.ts

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,12 +273,13 @@ suite('SnippetParser', () => {
273273
assertTextAndMarker('${1|one,two,three,|}', '${1|one,two,three,|}', Text);
274274
assertTextAndMarker('${1|one,', '${1|one,', Text);
275275

276-
const p = new SnippetParser();
277-
const snippet = p.parse('${1|one,two,three|}');
278-
assertMarker(snippet, Placeholder);
279-
const expected = [Placeholder, Text, Text, Text];
276+
const snippet = new SnippetParser().parse('${1|one,two,three|}');
277+
const expected: ((m: Marker) => boolean)[] = [
278+
m => m instanceof Placeholder,
279+
m => m instanceof Choice && m.options.length === 3 && m.options.every(x => x instanceof Text),
280+
];
280281
snippet.walk(marker => {
281-
assert.strictEqual(marker, expected.shift());
282+
assert.ok(expected.shift()!(marker));
282283
return true;
283284
});
284285
});

0 commit comments

Comments
 (0)