File tree 1 file changed +14
-1
lines changed
1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -19,14 +19,27 @@ export default function runFromCodeLens(args: RunArgs): void {
19
19
elixirLsTerminal . sendText ( buildTestCommand ( args ) ) ;
20
20
}
21
21
22
+ function escapeSingleQuotes ( s : string ) : string {
23
+ return isWindows ( ) ? s : s . replace ( / ' / g, "'\\''" ) ;
24
+ }
25
+
26
+ function quote ( s : string ) : string {
27
+ const q = isWindows ( ) ? '"' : `'` ;
28
+ return [ q , s , q ] . join ( '' ) ;
29
+ }
30
+
31
+ function isWindows ( ) : boolean {
32
+ return process . platform . includes ( 'win32' ) ;
33
+ }
34
+
22
35
function buildTestCommand ( args : RunArgs ) : string {
23
36
const testFilter = buildTestInclude (
24
37
args . describe ,
25
38
args . testName ,
26
39
args . module
27
40
) ;
28
41
29
- return `mix test --exclude test --include " ${ testFilter } " ${ args . filePath } ` ;
42
+ return `mix test --exclude test --include ${ quote ( escapeSingleQuotes ( testFilter ) ) } ${ args . filePath } ` ;
30
43
}
31
44
32
45
function buildTestInclude (
You can’t perform that action at this time.
0 commit comments