@@ -2,6 +2,7 @@ import * as vscode from 'vscode';
22import * as sinon from 'sinon' ;
33import * as assert from 'assert' ;
44import * as path from 'path' ;
5+ import * as os from 'os' ;
56import * as fs from 'fs-extra' ;
67
78import { mockExtensionContext } from '../common/mockvscode' ;
@@ -228,9 +229,11 @@ suite('Session Communication', () => {
228229 throw new Error ( 'attach command should be a source(...) call' ) ;
229230 }
230231
231- const scriptPath = commandMatch [ 1 ] . slice ( 1 , - 1 ) ;
232+ const scriptPath = JSON . parse ( commandMatch [ 1 ] ) as string ;
232233 const scriptStat = await fs . stat ( scriptPath ) ;
233- assert . strictEqual ( scriptStat . mode & 0o777 , 0o600 , 'attach script should be owner-only' ) ;
234+ if ( process . platform !== 'win32' ) {
235+ assert . strictEqual ( scriptStat . mode & 0o777 , 0o600 , 'attach script should be owner-only' ) ;
236+ }
234237
235238 const pipePath = session . globalPipePath ;
236239 assert . ok ( pipePath , 'global pipe path should be set' ) ;
@@ -242,9 +245,11 @@ suite('Session Communication', () => {
242245
243246 const sessionFilePid = `perm-test-${ process . pid } ` ;
244247 await session . writeSessionFile ( sessionFilePid , pipePath ?? '' ) ;
245- const sessionFilePath = path . join ( process . env . HOME ?? '' , '.vscode-R' , 'sessions' , `${ sessionFilePid } .json` ) ;
248+ const sessionFilePath = path . join ( os . homedir ( ) , '.vscode-R' , 'sessions' , `${ sessionFilePid } .json` ) ;
246249 const sessionFileStat = await fs . stat ( sessionFilePath ) ;
247- assert . strictEqual ( sessionFileStat . mode & 0o777 , 0o600 , 'session handoff file should be owner-only' ) ;
250+ if ( process . platform !== 'win32' ) {
251+ assert . strictEqual ( sessionFileStat . mode & 0o777 , 0o600 , 'session handoff file should be owner-only' ) ;
252+ }
248253 await fs . remove ( sessionFilePath ) ;
249254
250255 await session . shutdownSessionWatcher ( ) ;
0 commit comments