Skip to content

Commit f236859

Browse files
committed
⚗️ Remove redundent test suite
Signed-off-by: Babak K. Shandiz <[email protected]>
1 parent c819318 commit f236859

File tree

1 file changed

+43
-44
lines changed

1 file changed

+43
-44
lines changed

src/vs/workbench/contrib/terminal/test/browser/xterm/shellIntegrationAddon.test.ts

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -65,52 +65,51 @@ suite('ShellIntegrationAddon', () => {
6565
mock.verify();
6666
});
6767

68-
suite('detect `OSC 7; scheme://cwd ST`', async () => {
69-
suite('should extract CWD from URL format', async () => {
70-
test('should accept well-formatted URLs', async () => {
71-
type TestCase = [title: string, input: string, expected: string];
72-
const cases: TestCase[] = [
73-
// Different hostname values:
74-
['empty hostname, pointing root', 'file:///', '/'],
75-
['empty hostname', 'file:///test-root/local', '/test-root/local'],
76-
['non-empty hostname', 'file://some-hostname/test-root/local', '/test-root/local'],
77-
// URL-encoded chars:
78-
['URL-encoded value (1)', 'file:///test-root/%6c%6f%63%61%6c', '/test-root/local'],
79-
['URL-encoded value (2)', 'file:///test-root/local%22', '/test-root/local"'],
80-
['URL-encoded value (3)', 'file:///test-root/local"', '/test-root/local"'],
81-
];
82-
for (const x of cases) {
83-
const [title, input, expected] = x;
84-
const mock = shellIntegrationAddon.getCwdDectionMock();
85-
mock.expects('updateCwd').once().withExactArgs(expected).named(title);
86-
await writeP(xterm, `\x1b]7;${input}\x07`);
87-
mock.verify();
88-
}
89-
});
68+
suite('detect `SetCwd` sequence: `OSC 7; scheme://cwd ST`', async () => {
9069

91-
test('should ignore ill-formatted URLs', async () => {
92-
type TestCase = [title: string, input: string];
93-
const cases: TestCase[] = [
94-
// Different hostname values:
95-
['no hostname, pointing root', 'file://'],
96-
// Non-`file` scheme values:
97-
['no scheme (1)', '/test-root'],
98-
['no scheme (2)', '//test-root'],
99-
['no scheme (3)', '///test-root'],
100-
['no scheme (4)', ':///test-root'],
101-
['http', 'http:///test-root'],
102-
['ftp', 'ftp:///test-root'],
103-
['ssh', 'ssh:///test-root'],
104-
];
70+
test('should accept well-formatted URLs', async () => {
71+
type TestCase = [title: string, input: string, expected: string];
72+
const cases: TestCase[] = [
73+
// Different hostname values:
74+
['empty hostname, pointing root', 'file:///', '/'],
75+
['empty hostname', 'file:///test-root/local', '/test-root/local'],
76+
['non-empty hostname', 'file://some-hostname/test-root/local', '/test-root/local'],
77+
// URL-encoded chars:
78+
['URL-encoded value (1)', 'file:///test-root/%6c%6f%63%61%6c', '/test-root/local'],
79+
['URL-encoded value (2)', 'file:///test-root/local%22', '/test-root/local"'],
80+
['URL-encoded value (3)', 'file:///test-root/local"', '/test-root/local"'],
81+
];
82+
for (const x of cases) {
83+
const [title, input, expected] = x;
84+
const mock = shellIntegrationAddon.getCwdDectionMock();
85+
mock.expects('updateCwd').once().withExactArgs(expected).named(title);
86+
await writeP(xterm, `\x1b]7;${input}\x07`);
87+
mock.verify();
88+
}
89+
});
90+
91+
test('should ignore ill-formatted URLs', async () => {
92+
type TestCase = [title: string, input: string];
93+
const cases: TestCase[] = [
94+
// Different hostname values:
95+
['no hostname, pointing root', 'file://'],
96+
// Non-`file` scheme values:
97+
['no scheme (1)', '/test-root'],
98+
['no scheme (2)', '//test-root'],
99+
['no scheme (3)', '///test-root'],
100+
['no scheme (4)', ':///test-root'],
101+
['http', 'http:///test-root'],
102+
['ftp', 'ftp:///test-root'],
103+
['ssh', 'ssh:///test-root'],
104+
];
105105

106-
for (const x of cases) {
107-
const [title, input] = x;
108-
const mock = shellIntegrationAddon.getCwdDectionMock();
109-
mock.expects('updateCwd').never().named(title);
110-
await writeP(xterm, `\x1b]7;${input}\x07`);
111-
mock.verify();
112-
}
113-
});
106+
for (const x of cases) {
107+
const [title, input] = x;
108+
const mock = shellIntegrationAddon.getCwdDectionMock();
109+
mock.expects('updateCwd').never().named(title);
110+
await writeP(xterm, `\x1b]7;${input}\x07`);
111+
mock.verify();
112+
}
114113
});
115114
});
116115

0 commit comments

Comments
 (0)