Skip to content

Commit ef90459

Browse files
author
Akos Kitta
committed
fix: remove test assertion magic
slow tests do not run on Windows
1 parent e028d2d commit ef90459

File tree

1 file changed

+0
-29
lines changed

1 file changed

+0
-29
lines changed

src/test/suite/debug.slow-test.ts

-29
Original file line numberDiff line numberDiff line change
@@ -75,19 +75,6 @@ describe('debug (slow)', () => {
7575
),
7676
],
7777
};
78-
if (os.platform() === 'win32') {
79-
// The CLI builds the paths in a strange way and mixes the \\ separators with /
80-
// Expected: "c:\\Users\\kittaakos\\dev\\vscode-arduino-tools\\.tests\\data\\packages\\arduino\\tools\\openocd\\0.10.0-arduino7\\bin\\openocd"
81-
// Got: "C:\\Users\\kittaakos\\dev\\vscode-arduino-tools\\.tests\\data\\packages\\arduino\\tools\\openocd\\0.10.0-arduino7/bin/openocd"
82-
// This logic adjusts the expectations on Windows
83-
actual.serverpath = normalizePath(actual.serverpath);
84-
actual.svdFile = normalizePath(actual.svdFile);
85-
if (actual.configFiles) {
86-
actual.configFiles[1] = <string>normalizePath(actual.configFiles[1]);
87-
}
88-
actual.armToolchainPath = normalizePath(actual.armToolchainPath);
89-
actual.executable = <string>normalizePath(actual.executable, false); //
90-
}
9178
assert.deepStrictEqual(actual, expected);
9279
});
9380
});
@@ -163,20 +150,4 @@ describe('debug (slow)', () => {
163150
function fromBuildPath(...paths: string[]): string {
164151
return path.join(buildPath, ...paths);
165152
}
166-
167-
function normalizePath(
168-
p: string | undefined,
169-
driveLetterToLowerCase = true // This is a hack. Sometimes the CLI gives paths with capital case drive, sometimes it's lower-case.
170-
): string | undefined {
171-
if (!p || os.platform() !== 'win32') {
172-
return p;
173-
}
174-
let normalized = p.split('/').join('\\'); // cannot use path.resolve as the CLI sometimes gives the trailing separator on Windows, sometimes it does not
175-
if (driveLetterToLowerCase && /^[a-z]:\\/i.test(normalized)) {
176-
normalized =
177-
normalized.substring(0, 1).toLowerCase() +
178-
normalized.substring(1, normalized.length);
179-
}
180-
return normalized;
181-
}
182153
});

0 commit comments

Comments
 (0)