99using System . Linq ;
1010using System . Net . Http ;
1111using System . Text ;
12+ using System . Text . Encodings . Web ;
1213using System . Text . RegularExpressions ;
1314using System . Threading ;
1415using System . Threading . Tasks ;
@@ -93,7 +94,7 @@ public async void FileWatching_RespectsGracefulShutdownOptionWhenItsTrue()
9394 const int dummyNumProcesses = 5 ;
9495 Uri tempWatchDirectoryUri = CreateWatchDirectoryUri ( ) ;
9596 // Create initial module
96- string dummylongRunningTriggerPath = new Uri ( tempWatchDirectoryUri , "dummyTriggerFile" ) . AbsolutePath ; // fs.watch can't deal with backslashes in paths
97+ string dummylongRunningTriggerPath = new Uri ( tempWatchDirectoryUri , "dummyTriggerFile" ) . LocalPath ;
9798#if NET461
9899 File . WriteAllText ( dummylongRunningTriggerPath , string . Empty ) ; // fs.watch returns immediately if path to watch doesn't exist
99100#else
@@ -102,15 +103,15 @@ public async void FileWatching_RespectsGracefulShutdownOptionWhenItsTrue()
102103 string dummyInitialModule = $@ "module.exports = {{
103104 getPid: (callback) => callback(null, process.pid),
104105 longRunning: (callback) => {{
105- fs.watch('{ dummylongRunningTriggerPath } ',
106+ fs.watch('{ JavaScriptEncoder . Default . Encode ( dummylongRunningTriggerPath ) } ',
106107 null,
107108 () => {{
108109 callback(null, process.pid);
109110 }}
110111 );
111112 }}
112113}}" ;
113- string dummyModuleFilePath = new Uri ( tempWatchDirectoryUri , "dummyModule.js" ) . AbsolutePath ;
114+ string dummyModuleFilePath = new Uri ( tempWatchDirectoryUri , "dummyModule.js" ) . LocalPath ;
114115#if NET461
115116 File . WriteAllText ( dummyModuleFilePath , dummyInitialModule ) ;
116117#else
@@ -194,7 +195,7 @@ public async void FileWatching_RespectsGracefulShutdownOptionWhenItsFalse()
194195 getPid: (callback) => callback(null, process.pid),
195196 longRunning: (callback) => setInterval(() => { /* Do nothing */ }, 1000)
196197}" ;
197- string dummyModuleFilePath = new Uri ( CreateWatchDirectoryUri ( ) , "dummyModule.js" ) . AbsolutePath ;
198+ string dummyModuleFilePath = new Uri ( CreateWatchDirectoryUri ( ) , "dummyModule.js" ) . LocalPath ;
198199#if NET461
199200 File . WriteAllText ( dummyModuleFilePath , dummyInitialModule ) ;
200201#else
0 commit comments