Skip to content

Commit 2e1c805

Browse files
authored
ulugbekna/fix build ctx key parsing (microsoft#174859)
* context keys: parser: fix test suite name * context keys: parser: remove flaky tests (flaky because we output RegExp exceptions, which seemingly differ on node and browser)
1 parent f0ca34a commit 2e1c805

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

src/vs/platform/contextkey/test/common/parser.test.ts

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function parseToStr(input: string): string {
3333
return prints.join('');
3434
}
3535

36-
suite('Context Key Scanner', () => {
36+
suite('Context Key Parser', () => {
3737

3838
test(' foo', () => {
3939
const input = ' foo';
@@ -162,11 +162,6 @@ suite('Context Key Scanner', () => {
162162
assert.deepStrictEqual(parseToStr(input), "resource =~ /((\\/scratch\\/(?!update)(.*)\\/)|((\\/src\\/).*\\/)).*$/");
163163
});
164164

165-
test(`FIXME resourcePath =~ //foo/barr// || resourcePath =~ //view/(foo|frontend|base)/(foo|barr)// && resourceExtname in fooBar`, () => {
166-
const input = `resourcePath =~ //foo/barr// || resourcePath =~ //view/(foo|frontend|base)/(foo|barr)// && resourceExtname in fooBar`;
167-
assert.deepStrictEqual(parseToStr(input), "Lexing errors:\n\nUnexpected token '|' at offset 59. Did you mean '||'?\nUnexpected token '|' at offset 68. Did you mean '||'?\nUnexpected token '/ && resourceExtname in fooBar' at offset 86\n\n --- \nParsing errors:\n\nUnexpected error: SyntaxError: Invalid flags supplied to RegExp constructor ' && resourceExtname in fooBar' for token EOF at offset 116.\n");
168-
});
169-
170165
test(`resourcePath =~ /\.md(\.yml|\.txt)*$/gim`, () => {
171166
const input = `resourcePath =~ /\.md(\.yml|\.txt)*$/gim`;
172167
assert.deepStrictEqual(parseToStr(input), "resourcePath =~ /.md(.yml|.txt)*$/gim");
@@ -191,11 +186,6 @@ suite('Context Key Scanner', () => {
191186
assert.deepStrictEqual(parseToStr(input), "Parsing errors:\n\nExpected 'true', 'false', '(', KEY, KEY '=~' regex, KEY [ ('==' | '!=' | '<' | '<=' | '>' | '>=' | 'in' | 'not' 'in') value ] but got 'in' at offset 9.\n");
192187
});
193188

194-
test(`view =~ '/(servers)/' && viewItem =~ /^(Starting|Started|Debugging|Stopping|Stopped|Unknown)/'`, () => {
195-
const input = `view =~ '/(servers)/' && viewItem =~ /^(Starting|Started|Debugging|Stopping|Stopped|Unknown)/'`;
196-
assert.deepStrictEqual(parseToStr(input), "Lexing errors:\n\nUnexpected token ''' at offset 93\n\n --- \nParsing errors:\n\nUnexpected error: SyntaxError: Invalid flags supplied to RegExp constructor ''' for token EOF at offset 94.\n");
197-
});
198-
199189
test('vim<c-r> == 1 && vim<2<=3', () => {
200190
const input = 'vim<c-r> == 1 && vim<2<=3';
201191
assert.deepStrictEqual(parseToStr(input), "Lexing errors:\n\nUnexpected token '=' at offset 23. Did you mean '==' or '=~'?\n\n --- \nParsing errors:\n\nUnexpected '=' at offset 23.\n"); // FIXME

0 commit comments

Comments
 (0)