Skip to content

Commit f01a52c

Browse files
fix debugAdapterFactory tests
1 parent e2e4629 commit f01a52c

File tree

1 file changed

+78
-68
lines changed

1 file changed

+78
-68
lines changed

test/unit-tests/debugger/debugAdapterFactory.test.ts

Lines changed: 78 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,13 @@ suite("LLDBDebugConfigurationProvider Tests", () => {
7575
instance(mockToolchain),
7676
instance(mockOutputChannel)
7777
);
78-
const launchConfig = await configProvider.resolveDebugConfiguration(undefined, {
79-
name: "Test Launch Config",
80-
type: SWIFT_LAUNCH_CONFIG_TYPE,
81-
request: "launch",
82-
program: "${workspaceFolder}/.build/debug/executable",
83-
});
78+
const launchConfig =
79+
await configProvider.resolveDebugConfigurationWithSubstitutedVariables(undefined, {
80+
name: "Test Launch Config",
81+
type: SWIFT_LAUNCH_CONFIG_TYPE,
82+
request: "launch",
83+
program: "${workspaceFolder}/.build/debug/executable",
84+
});
8485
expect(launchConfig).to.containSubset({ type: LaunchConfigType.CODE_LLDB });
8586
});
8687

@@ -93,7 +94,7 @@ suite("LLDBDebugConfigurationProvider Tests", () => {
9394
instance(mockOutputChannel)
9495
);
9596
await expect(
96-
configProvider.resolveDebugConfiguration(undefined, {
97+
configProvider.resolveDebugConfigurationWithSubstitutedVariables(undefined, {
9798
name: "Test Launch Config",
9899
type: SWIFT_LAUNCH_CONFIG_TYPE,
99100
request: "launch",
@@ -115,7 +116,7 @@ suite("LLDBDebugConfigurationProvider Tests", () => {
115116
instance(mockOutputChannel)
116117
);
117118
await expect(
118-
configProvider.resolveDebugConfiguration(undefined, {
119+
configProvider.resolveDebugConfigurationWithSubstitutedVariables(undefined, {
119120
name: "Test Launch Config",
120121
type: SWIFT_LAUNCH_CONFIG_TYPE,
121122
request: "launch",
@@ -138,7 +139,7 @@ suite("LLDBDebugConfigurationProvider Tests", () => {
138139
instance(mockOutputChannel)
139140
);
140141
await expect(
141-
configProvider.resolveDebugConfiguration(undefined, {
142+
configProvider.resolveDebugConfigurationWithSubstitutedVariables(undefined, {
142143
name: "Test Launch Config",
143144
type: SWIFT_LAUNCH_CONFIG_TYPE,
144145
request: "launch",
@@ -172,12 +173,13 @@ suite("LLDBDebugConfigurationProvider Tests", () => {
172173
instance(mockToolchain),
173174
instance(mockOutputChannel)
174175
);
175-
const launchConfig = await configProvider.resolveDebugConfiguration(undefined, {
176-
name: "Test Launch Config",
177-
type: SWIFT_LAUNCH_CONFIG_TYPE,
178-
request: "launch",
179-
program: "${workspaceFolder}/.build/debug/executable",
180-
});
176+
const launchConfig =
177+
await configProvider.resolveDebugConfigurationWithSubstitutedVariables(undefined, {
178+
name: "Test Launch Config",
179+
type: SWIFT_LAUNCH_CONFIG_TYPE,
180+
request: "launch",
181+
program: "${workspaceFolder}/.build/debug/executable",
182+
});
181183
expect(launchConfig).to.containSubset({
182184
type: LaunchConfigType.LLDB_DAP,
183185
debugAdapterExecutable: "/path/to/lldb-dap",
@@ -192,7 +194,7 @@ suite("LLDBDebugConfigurationProvider Tests", () => {
192194
instance(mockOutputChannel)
193195
);
194196
await expect(
195-
configProvider.resolveDebugConfiguration(undefined, {
197+
configProvider.resolveDebugConfigurationWithSubstitutedVariables(undefined, {
196198
name: "Test Launch Config",
197199
type: SWIFT_LAUNCH_CONFIG_TYPE,
198200
request: "launch",
@@ -208,12 +210,13 @@ suite("LLDBDebugConfigurationProvider Tests", () => {
208210
instance(mockToolchain),
209211
instance(mockOutputChannel)
210212
);
211-
const launchConfig = await configProvider.resolveDebugConfiguration(undefined, {
212-
name: "Test Launch Config",
213-
type: SWIFT_LAUNCH_CONFIG_TYPE,
214-
request: "launch",
215-
program: "${workspaceFolder}/.build/debug/executable",
216-
});
213+
const launchConfig =
214+
await configProvider.resolveDebugConfigurationWithSubstitutedVariables(undefined, {
215+
name: "Test Launch Config",
216+
type: SWIFT_LAUNCH_CONFIG_TYPE,
217+
request: "launch",
218+
program: "${workspaceFolder}/.build/debug/executable",
219+
});
217220
expect(launchConfig).to.containSubset({
218221
program: "${workspaceFolder}/.build/debug/executable.exe",
219222
});
@@ -225,12 +228,13 @@ suite("LLDBDebugConfigurationProvider Tests", () => {
225228
instance(mockToolchain),
226229
instance(mockOutputChannel)
227230
);
228-
const launchConfig = await configProvider.resolveDebugConfiguration(undefined, {
229-
name: "Test Launch Config",
230-
type: SWIFT_LAUNCH_CONFIG_TYPE,
231-
request: "launch",
232-
program: "${workspaceFolder}/.build/debug/executable.exe",
233-
});
231+
const launchConfig =
232+
await configProvider.resolveDebugConfigurationWithSubstitutedVariables(undefined, {
233+
name: "Test Launch Config",
234+
type: SWIFT_LAUNCH_CONFIG_TYPE,
235+
request: "launch",
236+
program: "${workspaceFolder}/.build/debug/executable.exe",
237+
});
234238
expect(launchConfig).to.containSubset({
235239
program: "${workspaceFolder}/.build/debug/executable.exe",
236240
});
@@ -242,12 +246,13 @@ suite("LLDBDebugConfigurationProvider Tests", () => {
242246
instance(mockToolchain),
243247
instance(mockOutputChannel)
244248
);
245-
const launchConfig = await configProvider.resolveDebugConfiguration(undefined, {
246-
name: "Test Launch Config",
247-
type: SWIFT_LAUNCH_CONFIG_TYPE,
248-
request: "launch",
249-
program: "${workspaceFolder}/.build/debug/executable",
250-
});
249+
const launchConfig =
250+
await configProvider.resolveDebugConfigurationWithSubstitutedVariables(undefined, {
251+
name: "Test Launch Config",
252+
type: SWIFT_LAUNCH_CONFIG_TYPE,
253+
request: "launch",
254+
program: "${workspaceFolder}/.build/debug/executable",
255+
});
251256
expect(launchConfig).to.containSubset({
252257
program: "${workspaceFolder}/.build/debug/executable",
253258
});
@@ -259,12 +264,13 @@ suite("LLDBDebugConfigurationProvider Tests", () => {
259264
instance(mockToolchain),
260265
instance(mockOutputChannel)
261266
);
262-
const launchConfig = await configProvider.resolveDebugConfiguration(undefined, {
263-
name: "Test Launch Config",
264-
type: SWIFT_LAUNCH_CONFIG_TYPE,
265-
request: "launch",
266-
program: "${workspaceFolder}/.build/debug/executable",
267-
});
267+
const launchConfig =
268+
await configProvider.resolveDebugConfigurationWithSubstitutedVariables(undefined, {
269+
name: "Test Launch Config",
270+
type: SWIFT_LAUNCH_CONFIG_TYPE,
271+
request: "launch",
272+
program: "${workspaceFolder}/.build/debug/executable",
273+
});
268274
expect(launchConfig).to.containSubset({
269275
program: "${workspaceFolder}/.build/debug/executable",
270276
});
@@ -276,16 +282,17 @@ suite("LLDBDebugConfigurationProvider Tests", () => {
276282
instance(mockToolchain),
277283
instance(mockOutputChannel)
278284
);
279-
const launchConfig = await configProvider.resolveDebugConfiguration(undefined, {
280-
name: "Test Launch Config",
281-
type: SWIFT_LAUNCH_CONFIG_TYPE,
282-
request: "launch",
283-
program: "${workspaceFolder}/.build/debug/executable",
284-
env: {
285-
VAR1: "value1",
286-
VAR2: "value2",
287-
},
288-
});
285+
const launchConfig =
286+
await configProvider.resolveDebugConfigurationWithSubstitutedVariables(undefined, {
287+
name: "Test Launch Config",
288+
type: SWIFT_LAUNCH_CONFIG_TYPE,
289+
request: "launch",
290+
program: "${workspaceFolder}/.build/debug/executable",
291+
env: {
292+
VAR1: "value1",
293+
VAR2: "value2",
294+
},
295+
});
289296
expect(launchConfig)
290297
.to.have.property("env")
291298
.that.deep.equals(["VAR1=value1", "VAR2=value2"]);
@@ -297,12 +304,13 @@ suite("LLDBDebugConfigurationProvider Tests", () => {
297304
instance(mockToolchain),
298305
instance(mockOutputChannel)
299306
);
300-
const launchConfig = await configProvider.resolveDebugConfiguration(undefined, {
301-
name: "Test Launch Config",
302-
type: SWIFT_LAUNCH_CONFIG_TYPE,
303-
request: "launch",
304-
program: "${workspaceFolder}/.build/debug/executable",
305-
});
307+
const launchConfig =
308+
await configProvider.resolveDebugConfigurationWithSubstitutedVariables(undefined, {
309+
name: "Test Launch Config",
310+
type: SWIFT_LAUNCH_CONFIG_TYPE,
311+
request: "launch",
312+
program: "${workspaceFolder}/.build/debug/executable",
313+
});
306314
expect(launchConfig).to.not.have.property("env");
307315
});
308316

@@ -312,12 +320,13 @@ suite("LLDBDebugConfigurationProvider Tests", () => {
312320
instance(mockToolchain),
313321
instance(mockOutputChannel)
314322
);
315-
const launchConfig = await configProvider.resolveDebugConfiguration(undefined, {
316-
type: SWIFT_LAUNCH_CONFIG_TYPE,
317-
request: "launch",
318-
name: "Test Launch",
319-
env: {},
320-
});
323+
const launchConfig =
324+
await configProvider.resolveDebugConfigurationWithSubstitutedVariables(undefined, {
325+
type: SWIFT_LAUNCH_CONFIG_TYPE,
326+
request: "launch",
327+
name: "Test Launch",
328+
env: {},
329+
});
321330

322331
expect(launchConfig).to.have.property("env").that.deep.equals([]);
323332
});
@@ -333,12 +342,13 @@ suite("LLDBDebugConfigurationProvider Tests", () => {
333342
instance(mockToolchain),
334343
instance(mockOutputChannel)
335344
);
336-
const launchConfig = await configProvider.resolveDebugConfiguration(undefined, {
337-
type: SWIFT_LAUNCH_CONFIG_TYPE,
338-
request: "launch",
339-
name: "Test Launch",
340-
env,
341-
});
345+
const launchConfig =
346+
await configProvider.resolveDebugConfigurationWithSubstitutedVariables(undefined, {
347+
type: SWIFT_LAUNCH_CONFIG_TYPE,
348+
request: "launch",
349+
name: "Test Launch",
350+
env,
351+
});
342352

343353
// Verify that all 1000 environment variables are properly converted
344354
const expectedEnv = Array.from({ length: 1000 }, (_, i) => `VAR${i}=value${i}`);

0 commit comments

Comments
 (0)