do not allow duplicate flags (#240292)

This commit is contained in:
Megan Rogge
2025-02-10 15:22:53 -06:00
committed by GitHub
parent 00fc4497e6
commit 14b1516869
4 changed files with 15 additions and 10 deletions

View File

@@ -41,8 +41,8 @@ export function createCodeTestSpecs(executable: string): ITestSpec[] {
{ input: `${executable} --log |`, expectedCompletions: logOptions },
{ input: `${executable} --sync |`, expectedCompletions: syncOptions },
{ input: `${executable} --extensions-dir |`, expectedResourceRequests: { type: 'folders', cwd: testPaths.cwd } },
{ input: `${executable} --list-extensions |`, expectedCompletions: codeSpecOptions, expectedResourceRequests: { type: 'both', cwd: testPaths.cwd } },
{ input: `${executable} --show-versions |`, expectedCompletions: codeSpecOptions, expectedResourceRequests: { type: 'both', cwd: testPaths.cwd } },
{ input: `${executable} --list-extensions |`, expectedCompletions: codeSpecOptions.filter(c => c !== '--list-extensions'), expectedResourceRequests: { type: 'both', cwd: testPaths.cwd } },
{ input: `${executable} --show-versions |`, expectedCompletions: codeSpecOptions.filter(c => c !== '--show-versions'), expectedResourceRequests: { type: 'both', cwd: testPaths.cwd } },
{ input: `${executable} --category |`, expectedCompletions: categoryOptions },
{ input: `${executable} --category a|`, expectedCompletions: categoryOptions },

View File

@@ -72,8 +72,7 @@ export const lsTestSuiteSpec: ISuiteSpec = {
{ input: 'ls -a|', expectedCompletions: allOptions },
// Duplicate option
// TODO: Duplicate options should not be presented https://github.com/microsoft/vscode/issues/239607
// { input: 'ls -a -|', expectedCompletions: removeArrayEntry(allOptions, '-a'), expectedResourceRequests: { type: 'both', cwd: testPaths.cwd } },
{ input: 'ls -a -|', expectedCompletions: allOptions.filter(o => o !== '-a'), expectedResourceRequests: { type: 'both', cwd: testPaths.cwd } },
// Relative paths
{ input: 'ls c|', expectedCompletions: allOptions, expectedResourceRequests: { type: 'both', cwd: testPaths.cwd } },
@@ -89,3 +88,4 @@ export const lsTestSuiteSpec: ISuiteSpec = {
{ input: 'ls ../sibling|', expectedCompletions: allOptions, expectedResourceRequests: { type: 'both', cwd: testPaths.cwdParent } },
]
};

View File

@@ -93,9 +93,8 @@ export const figGenericTestSuites: ISuiteSpec[] = [
testSpecs: [
{ input: 'foo |', expectedCompletions: ['--bar', '--baz'] },
{ input: 'foo bar|', expectedCompletions: ['--bar', '--baz'] },
// TODO: Duplicate options should not be presented https://github.com/microsoft/vscode/issues/239607
// { input: 'foo --bar |', expectedCompletions: ['--baz'] },
// { input: 'foo --baz |', expectedCompletions: ['--bar'] },
{ input: 'foo --bar |', expectedCompletions: ['--baz'] },
{ input: 'foo --baz |', expectedCompletions: ['--bar'] },
]
},
{