8000 tests · microsoft/vscode-python@bfc3e55 · GitHub
[go: up one dir, main page]

Skip to content

Commit bfc3e55

Browse files
committed
tests
1 parent 2d89982 commit bfc3e55

File tree

1 file changed

+84
-58
lines changed

1 file changed

+84
-58
lines changed

src/test/terminals/shellIntegration/pythonStartup.test.ts

Lines changed: 84 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -146,64 +146,90 @@ suite('Terminal - Shell Integration with PYTHONSTARTUP', () => {
146146

147147
registerTerminalLinkProviderStub.restore();
148148
});
149-
150-
test('Mac - Verify provideTerminalLinks returns links when context.line contains expectedNativeLink', () => {
151-
const provider = new CustomTerminalLinkProvider();
152-
const context: TerminalLinkContext = {
153-
line: 'Some random string with Cmd click to launch VS Code Native REPL',
154-
terminal: {} as Terminal,
155-
};
156-
const token: CancellationToken = {
157-
isCancellationRequested: false,
158-
onCancellationRequested: new EventEmitter<unknown>().event,
159-
};
160-
161-
const links = provider.provideTerminalLinks(context, token);
162-
163-
assert.isNotNull(links, 'Expected links to be not undefined');
164-
assert.isArray(links, 'Expected links to be an array');
165-
assert.isNotEmpty(links, 'Expected links to be not empty');
166-
167-
if (Array.isArray(links)) {
168-
assert.equal(links[0].command, 'python.startNativeREPL', 'Expected command to be python.startNativeREPL');
169-
assert.equal(
170-
links[0].startIndex,
171-
context.line.indexOf('Cmd click to launch VS Code Native REPL'),
172-
'start index should match',
173-
);
174-
assert.equal(links[0].length, 'Cmd click to launch VS Code Native REPL'.length, 'Match expected length');
175-
assert.equal(links[0].tooltip, Repl.launchNativeRepl, 'Expected tooltip to be Launch VS Code Native REPL');
176-
}
177-
});
178-
179-
test('Windows/Linux - Verify provideTerminalLinks returns links when context.line contains expectedNativeLink', () => {
180-
const provider = new CustomTerminalLinkProvider();
181-
const context: TerminalLinkContext = {
182-
line: 'Some random string with Ctrl click to launch VS Code Native REPL',
183-
terminal: {} as Terminal,
184-
};
185-
const token: CancellationToken = {
186-
isCancellationRequested: false,
187-
onCancellationRequested: new EventEmitter<unknown>().event,
188-
};
189-
190-
const links = provider.provideTerminalLinks(context, token);
191-
192-
assert.isNotNull(links, 'Expected links to be not undefined');
193-
assert.isArray(links, 'Expected links to be an array');
194-
assert.isNotEmpty(links, 'Expected links to be not empty');
195-
196-
if (Array.isArray(links)) {
197-
assert.equal(links[0].command, 'python.startNativeREPL', 'Expected command to be python.startNativeREPL');
198-
assert.equal(
199-
links[0].startIndex,
200-
context.line.indexOf('Ctrl click to launch VS Code Native REPL'),
201-
'start index should match',
202-
);
203-
assert.equal(links[0].length, 'Ctrl click to launch VS Code Native REPL'.length, 'Match expected Length');
204-
assert.equal(links[0].tooltip, Repl.launchNativeRepl, 'Expected tooltip to be Launch VS Code Native REPL');
205-
}
206-
});
149+
if (process.platform === 'darwin') {
150+< 10000 /span>
test('Mac - Verify provideTerminalLinks returns links when context.line contains expectedNativeLink', () => {
151+
const provider = new CustomTerminalLinkProvider();
152+
const context: TerminalLinkContext = {
153+
line: 'Some random string with Cmd click to launch VS Code Native REPL',
154+
terminal: {} as Terminal,
155+
};
156+
const token: CancellationToken = {
157+
isCancellationRequested: false,
158+
onCancellationRequested: new EventEmitter<unknown>().event,
159+
};
160+
161+
const links = provider.provideTerminalLinks(context, token);
162+
163+
assert.isNotNull(links, 'Expected links to be not undefined');
164+
assert.isArray(links, 'Expected links to be an array');
165+
assert.isNotEmpty(links, 'Expected links to be not empty');
166+
167+
if (Array.isArray(links)) {
168+
assert.equal(
169+
links[0].command,
170+
'python.startNativeREPL',
171+
'Expected command to be python.startNativeREPL',
172+
);
173+
assert.equal(
174+
links[0].startIndex,
175+
context.line.indexOf('Cmd click to launch VS Code Native REPL'),
176+
'start index should match',
177+
);
178+
assert.equal(
179+
links[0].length,
180+
'Cmd click to launch VS Code Native REPL'.length,
181+
'Match expected length',
182+
);
183+
assert.equal(
184+
links[0].tooltip,
185+
Repl.launchNativeRepl,
186+
'Expected tooltip to be Launch VS Code Native REPL',
187+
);
188+
}
189+
});
190+
}
191+
if (process.platform !== 'darwin') {
192+
test('Windows/Linux - Verify provideTerminalLinks returns links when context.line contains expectedNativeLink', () => {
193+
const provider = new CustomTerminalLinkProvider();
194+
const context: TerminalLinkContext = {
195+
line: 'Some random string with Ctrl click to launch VS Code Native REPL',
196+
terminal: {} as Terminal,
197+
};
198+
const token: CancellationToken = {
199+
isCancellationRequested: false,
200+
onCancellationRequested: new EventEmitter<unknown>().event,
201+
};
202+
203+
const links = provider.provideTerminalLinks(context, token);
204+
205+
assert.isNotNull(links, 'Expected links to be not undefined');
206+
assert.isArray(links, 'Expected links to be an array');
207+
assert.isNotEmpty(links, 'Expected links to be not empty');
208+
209+
if (Array.isArray(links)) {
210+
assert.equal(
211+
links[0].command,
212+
'python.startNativeREPL',
213+
'Expected command to be python.startNativeREPL',
214+
);
215+
assert.equal(
216+
links[0].startIndex,
217+
context.line.indexOf('Ctrl click to launch VS Code Native REPL'),
218+
'start index should match',
219+
);
220+
assert.equal(
221+
links[0].length,
222+
'Ctrl click to launch VS Code Native REPL'.length,
223+
'Match expected Length',
224+
);
225+
assert.equal(
226+
links[0].tooltip,
227+
Repl.launchNativeRepl,
228+
'Expected tooltip to be Launch VS Code Native REPL',
229+
);
230+
}
231+
});
232+
}
207233

208234
test('Verify provideTerminalLinks returns no links when context.line does not contain expectedNativeLink', () => {
209235
const provider = new CustomTerminalLinkProvider();

0 commit comments

Comments
 (0)
0