11// Copyright (c) Microsoft Corporation. All rights reserved.
2- // Licensed under the MIT License.
2+ // Licensed under the// MIT License.
33
44'use strict' ;
55
@@ -8,18 +8,29 @@ import * as path from 'path';
88import { EXTENSION_ROOT_DIR } from '../../../extension/common/constants' ;
99import '../../../extension/common/promiseUtils' ;
1010import * as launchers from '../../../extension/debugger/adapter/remoteLaunchers' ;
11+ import { getOSType , OSType } from '../../../extension/common/platform' ;
12+
13+ function osExpectedPath ( windowsPath : string , unixPath : string ) : string {
14+ return getOSType ( ) === OSType . Windows ? windowsPath : unixPath ;
15+ }
1116
1217suite ( 'External debugpy Debugger Launcher' , ( ) => {
1318 [
1419 {
1520 testName : 'When path to debugpy does not contains spaces' ,
1621 path : path . join ( 'path' , 'to' , 'debugpy' ) ,
17- expectedPath : 'path/to/debugpy' ,
22+ expectedPath : osExpectedPath (
23+ 'path\\to\\debugpy' ,
24+ 'path/to/debugpy'
25+ ) ,
1826 } ,
1927 {
2028 testName : 'When path to debugpy contains spaces' ,
2129 path : path . join ( 'path' , 'to' , 'debugpy' , 'with spaces' ) ,
22- expectedPath : '"path/to/debugpy/with spaces"' ,
30+ expectedPath : osExpectedPath (
31+ '"path\\to\\debugpy\\with spaces"' ,
32+ '"path/to/debugpy/with spaces"'
33+ ) ,
2334 } ,
2435 ] . forEach ( ( testParams ) => {
2536 suite ( testParams . testName , async ( ) => {
0 commit comments