@@ -7,7 +7,7 @@ import { expect } from 'chai';
77import  *  as  fs  from  'fs-extra' ; 
88import  *  as  path  from  'path' ; 
99import  {  EXTENSION_ROOT_DIR  }  from  '../../../../client/common/constants' ; 
10- import  {  DebuggerLauncherScriptProvider ,  NoDebugLauncherScriptProvider ,  RemoteDebuggerLauncherScriptProvider  }  from  '../../../../client/debugger/debugAdapter/DebugClients/launcherProvider' ; 
10+ import  {  DebuggerLauncherScriptProvider ,  NoDebugLauncherScriptProvider ,  RemoteDebuggerExternalLauncherScriptProvider  }  from  '../../../../client/debugger/debugAdapter/DebugClients/launcherProvider' ; 
1111
1212const  expectedPath  =  path . join ( EXTENSION_ROOT_DIR ,  'pythonFiles' ,  'ptvsd_launcher.py' ) ; 
1313
@@ -21,12 +21,12 @@ suite('Debugger - Launcher Script Provider', () => {
2121 { 
2222 testName : 'When path to ptvsd launcher does not contains spaces' , 
2323 path : path . join ( 'path' ,  'to' ,  'ptvsd_launcher' ) , 
24-  expectedPath : 'path/to/ ptvsd_launcher' 
24+  expectedPath : path . join ( 'path'  ,   'to' ,   ' ptvsd_launcher') 
2525 } , 
2626 { 
2727 testName : 'When path to ptvsd launcher contains spaces' , 
2828 path : path . join ( 'path' ,  'to' ,  'ptvsd_launcher' ,  'with spaces' ) , 
29-  expectedPath : '" path/to/ ptvsd_launcher/ with spaces"' 
29+  expectedPath : path . join ( ' path' ,   'to' ,   ' ptvsd_launcher' ,   ' with spaces' ) 
3030 } 
3131 ] ; 
3232
@@ -52,15 +52,33 @@ suite('Debugger - Launcher Script Provider', () => {
5252 const  expectedArgs  =  [ testParams . expectedPath ,  '--custom' ,  '--nodebug' ,  '--client' ,  '--host' ,  'something' ,  '--port' ,  '1234' ] ; 
5353 expect ( args ) . to . be . deep . equal ( expectedArgs ) ; 
5454 } ) ; 
55-  test ( 'Test remote debug launcher args (and do not wait for debugger to attach)' ,  async  ( )  =>  { 
56-  const  args  =  new  RemoteDebuggerLauncherScriptProvider ( testParams . path ) . getLauncherArgs ( {  host : 'something' ,  port : 1234 ,  waitUntilDebuggerAttaches : false  } ) ; 
57-  const  expectedArgs  =  [ testParams . expectedPath ,  '--default' ,  '--host' ,  'something' ,  '--port' ,  '1234' ] ; 
58-  expect ( args ) . to . be . deep . equal ( expectedArgs ) ; 
59-  } ) ; 
60-  test ( 'Test remote debug launcher args (and wait for debugger to attach)' ,  async  ( )  =>  { 
61-  const  args  =  new  RemoteDebuggerLauncherScriptProvider ( testParams . path ) . getLauncherArgs ( {  host : 'something' ,  port : 1234 ,  waitUntilDebuggerAttaches : true  } ) ; 
62-  const  expectedArgs  =  [ testParams . expectedPath ,  '--default' ,  '--host' ,  'something' ,  '--port' ,  '1234' ,  '--wait' ] ; 
63-  expect ( args ) . to . be . deep . equal ( expectedArgs ) ; 
55+  } ) ; 
56+  } ) ; 
57+ 
58+  suite ( 'External Debug Launcher' ,  ( )  =>  { 
59+  [ 
60+  { 
61+  testName : 'When path to ptvsd launcher does not contains spaces' , 
62+  path : path . join ( 'path' ,  'to' ,  'ptvsd_launcher' ) , 
63+  expectedPath : 'path/to/ptvsd_launcher' 
64+  } , 
65+  { 
66+  testName : 'When path to ptvsd launcher contains spaces' , 
67+  path : path . join ( 'path' ,  'to' ,  'ptvsd_launcher' ,  'with spaces' ) , 
68+  expectedPath : '"path/to/ptvsd_launcher/with spaces"' 
69+  } 
70+  ] . forEach ( testParams  =>  { 
71+  suite ( testParams . testName ,  async  ( )  =>  { 
72+  test ( 'Test remote debug launcher args (and do not wait for debugger to attach)' ,  async  ( )  =>  { 
73+  const  args  =  new  RemoteDebuggerExternalLauncherScriptProvider ( testParams . path ) . getLauncherArgs ( {  host : 'something' ,  port : 1234 ,  waitUntilDebuggerAttaches : false  } ) ; 
74+  const  expectedArgs  =  [ testParams . expectedPath ,  '--default' ,  '--host' ,  'something' ,  '--port' ,  '1234' ] ; 
75+  expect ( args ) . to . be . deep . equal ( expectedArgs ) ; 
76+  } ) ; 
77+  test ( 'Test remote debug launcher args (and wait for debugger to attach)' ,  async  ( )  =>  { 
78+  const  args  =  new  RemoteDebuggerExternalLauncherScriptProvider ( testParams . path ) . getLauncherArgs ( {  host : 'something' ,  port : 1234 ,  waitUntilDebuggerAttaches : true  } ) ; 
79+  const  expectedArgs  =  [ testParams . expectedPath ,  '--default' ,  '--host' ,  'something' ,  '--port' ,  '1234' ,  '--wait' ] ; 
80+  expect ( args ) . to . be . deep . equal ( expectedArgs ) ; 
81+  } ) ; 
6482 } ) ; 
6583 } ) ; 
6684 } ) ; 
0 commit comments