Skip to content

Commit 8f39eef

Browse files
committed
Fix up bad merge
1 parent 4a0e4ec commit 8f39eef

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

src/vs/workbench/contrib/terminalContrib/chatAgentTools/test/browser/runInTerminalTool.test.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -493,36 +493,36 @@ suite('RunInTerminalTool', () => {
493493

494494
test('should handle cd /d flag when directory matches cwd', async () => {
495495
const testDir = 'C:\\test\\workspace';
496-
const options = createRewriteOptions(`cd /d ${testDir} && echo hello`, 'session-1');
496+
const options = createRewriteParams(`cd /d ${testDir} && echo hello`, 'session-1');
497497
workspaceService.setWorkspace({
498498
folders: [{ uri: { fsPath: testDir } }]
499499
} as any);
500500

501-
const result = await runInTerminalTool.rewriteCommandIfNeeded(options, options.parameters as IRunInTerminalInputParams, undefined, 'pwsh');
501+
const result = await runInTerminalTool.rewriteCommandIfNeeded(options, undefined, 'pwsh');
502502

503503
strictEqual(result, 'echo hello');
504504
});
505505

506506
test('should handle cd /d flag with quoted paths when directory matches cwd', async () => {
507507
const testDir = 'C:\\test\\workspace';
508-
const options = createRewriteOptions(`cd /d "${testDir}" && echo hello`, 'session-1');
508+
const options = createRewriteParams(`cd /d "${testDir}" && echo hello`, 'session-1');
509509
workspaceService.setWorkspace({
510510
folders: [{ uri: { fsPath: testDir } }]
511511
} as any);
512512

513-
const result = await runInTerminalTool.rewriteCommandIfNeeded(options, options.parameters as IRunInTerminalInputParams, undefined, 'pwsh');
513+
const result = await runInTerminalTool.rewriteCommandIfNeeded(options, undefined, 'pwsh');
514514

515515
strictEqual(result, 'echo hello');
516516
});
517517

518518
test('should handle cd /d flag with quoted paths from issue example', async () => {
519519
const testDir = 'd:\\microsoft\\vscode';
520-
const options = createRewriteOptions(`cd /d "${testDir}" && .\\scripts\\test.bat`, 'session-1');
520+
const options = createRewriteParams(`cd /d "${testDir}" && .\\scripts\\test.bat`, 'session-1');
521521
workspaceService.setWorkspace({
522522
folders: [{ uri: { fsPath: testDir } }]
523523
} as any);
524524

525-
const result = await runInTerminalTool.rewriteCommandIfNeeded(options, options.parameters as IRunInTerminalInputParams, undefined, 'pwsh');
525+
const result = await runInTerminalTool.rewriteCommandIfNeeded(options, undefined, 'pwsh');
526526

527527
strictEqual(result, '.\\scripts\\test.bat');
528528
});
@@ -531,12 +531,12 @@ suite('RunInTerminalTool', () => {
531531
const testDir = 'C:\\test\\workspace';
532532
const differentDir = 'C:\\different\\path';
533533
const command = `cd /d ${differentDir} && echo hello`;
534-
const options = createRewriteOptions(command, 'session-1');
534+
const options = createRewriteParams(command, 'session-1');
535535
workspaceService.setWorkspace({
536536
folders: [{ uri: { fsPath: testDir } }]
537537
} as any);
538538

539-
const result = await runInTerminalTool.rewriteCommandIfNeeded(options, options.parameters as IRunInTerminalInputParams, undefined, 'pwsh');
539+
const result = await runInTerminalTool.rewriteCommandIfNeeded(options, undefined, 'pwsh');
540540

541541
strictEqual(result, command);
542542
});
@@ -545,26 +545,26 @@ suite('RunInTerminalTool', () => {
545545
const instanceDir = 'C:\\instance\\workspace';
546546
const workspaceDir = 'C:\\workspace\\service';
547547
const command = `cd /d ${instanceDir} && npm test`;
548-
const options = createRewriteOptions(command, 'session-1');
548+
const parameters = createRewriteParams(command, 'session-1');
549549

550550
workspaceService.setWorkspace({
551551
folders: [{ uri: { fsPath: workspaceDir } }]
552552
} as any);
553553
const instance = createInstanceWithCwd({ fsPath: instanceDir } as any);
554554

555-
const result = await runInTerminalTool.rewriteCommandIfNeeded(options, options.parameters as IRunInTerminalInputParams, instance, 'pwsh');
555+
const result = await runInTerminalTool.rewriteCommandIfNeeded(parameters, instance, 'pwsh');
556556

557557
strictEqual(result, 'npm test');
558558
});
559559

560560
test('should handle cd /d flag with semicolon separator', async () => {
561561
const testDir = 'C:\\test\\workspace';
562-
const options = createRewriteOptions(`cd /d ${testDir}; echo hello`, 'session-1');
562+
const options = createRewriteParams(`cd /d ${testDir}; echo hello`, 'session-1');
563563
workspaceService.setWorkspace({
564564
folders: [{ uri: { fsPath: testDir } }]
565565
} as any);
566566

567-
const result = await runInTerminalTool.rewriteCommandIfNeeded(options, options.parameters as IRunInTerminalInputParams, undefined, 'pwsh');
567+
const result = await runInTerminalTool.rewriteCommandIfNeeded(options, undefined, 'pwsh');
568568

569569
strictEqual(result, 'echo hello');
570570
});

0 commit comments

Comments
 (0)