1010using System . Net . Http ;
1111using System . Runtime . InteropServices ;
1212using System . Text ;
13+ using System . Text . Encodings . Web ;
1314using System . Text . RegularExpressions ;
1415using System . Threading ;
1516using System . Threading . Tasks ;
@@ -1106,7 +1107,7 @@ public async void FileWatching_RespectsGracefulShutdownOptionWhenItsTrue()
11061107 // Arrange
11071108 Uri tempWatchDirectoryUri = CreateWatchDirectoryUri ( ) ;
11081109 // Create initial module
1109- string dummylongRunningTriggerPath = new Uri ( tempWatchDirectoryUri , "dummyTriggerFile" ) . AbsolutePath ; // fs.watch can't deal with backslashes in paths
1110+ string dummylongRunningTriggerPath = new Uri ( tempWatchDirectoryUri , "dummyTriggerFile" ) . LocalPath ; // fs.watch can't deal with backslashes in paths
11101111#if NET461
11111112 File . WriteAllText ( dummylongRunningTriggerPath , string . Empty ) ; // fs.watch returns immediately if path to watch doesn't exist
11121113#else
@@ -1115,15 +1116,15 @@ public async void FileWatching_RespectsGracefulShutdownOptionWhenItsTrue()
11151116 string dummyInitialModule = $@ "module.exports = {{
11161117 getPid: (callback) => callback(null, process.pid),
11171118 longRunning: (callback) => {{
1118- fs.watch('{ dummylongRunningTriggerPath } ',
1119+ fs.watch('{ JavaScriptEncoder . Default . Encode ( dummylongRunningTriggerPath ) } ',
11191120 null,
11201121 () => {{
11211122 callback(null, process.pid);
11221123 }}
11231124 );
11241125 }}
11251126}}" ;
1126- string dummyModuleFilePath = new Uri ( tempWatchDirectoryUri , "dummyModule.js" ) . AbsolutePath ;
1127+ string dummyModuleFilePath = new Uri ( tempWatchDirectoryUri , "dummyModule.js" ) . LocalPath ;
11271128#if NET461
11281129 File . WriteAllText ( dummyModuleFilePath , dummyInitialModule ) ;
11291130#else
@@ -1175,7 +1176,7 @@ public async void FileWatching_RespectsGracefulShutdownOptionWhenItsFalse()
11751176 getPid: (callback) => callback(null, process.pid),
11761177 longRunning: (callback) => setInterval(() => { /* Do nothing */ }, 1000)
11771178}" ;
1178- string dummyModuleFilePath = new Uri ( CreateWatchDirectoryUri ( ) , "dummyModule.js" ) . AbsolutePath ;
1179+ string dummyModuleFilePath = new Uri ( CreateWatchDirectoryUri ( ) , "dummyModule.js" ) . LocalPath ;
11791180#if NET461
11801181 File . WriteAllText ( dummyModuleFilePath , dummyInitialModule ) ;
11811182#else
0 commit comments