From d4d3dfbe2874809cff409c74a504a193f773ebe6 Mon Sep 17 00:00:00 2001 From: Adam Ward Date: Tue, 10 Dec 2024 13:32:50 -0500 Subject: [PATCH] Add .exe to expected path for windows --- test/integration-tests/SwiftSnippet.test.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/integration-tests/SwiftSnippet.test.ts b/test/integration-tests/SwiftSnippet.test.ts index 504f037b..999ef448 100644 --- a/test/integration-tests/SwiftSnippet.test.ts +++ b/test/integration-tests/SwiftSnippet.test.ts @@ -25,6 +25,7 @@ import { import { Version } from "../../src/utilities/version"; import { activateExtensionForSuite, folderInRootWorkspace } from "./utilities/testutilities"; import { WorkspaceContext } from "../../src/WorkspaceContext"; +import { join } from "path"; suite("SwiftSnippet Test Suite", function () { this.timeout(120000); @@ -69,8 +70,12 @@ suite("SwiftSnippet Test Suite", function () { expect(exitCode).to.equal(0); const session = await sessionPromise; + let path = join(testAssetPath("defaultPackage"), ".build", "debug", "hello"); + if (process.platform === "win32") { + path = path + ".exe"; + } expect(session.configuration.program?.toLowerCase()).to.equal( - `${testAssetPath("defaultPackage")}/.build/debug/hello`.toLocaleLowerCase() // Windows may use d:\ or D:\ + path.toLocaleLowerCase() // Windows may use d:\ or D:\ ); expect(session.configuration).to.have.property("noDebug", true); }); @@ -89,8 +94,12 @@ suite("SwiftSnippet Test Suite", function () { expect(exitCode).to.equal(0); const session = await sessionPromise; + let path = join(testAssetPath("defaultPackage"), ".build", "debug", "hello"); + if (process.platform === "win32") { + path = path + ".exe"; + } expect(session.configuration.program?.toLowerCase()).to.equal( - `${testAssetPath("defaultPackage")}/.build/debug/hello`.toLocaleLowerCase() // Windows may use d:\ or D:\ + path.toLocaleLowerCase() // Windows may use d:\ or D:\ ); expect(session.configuration).to.not.have.property("noDebug"); });