@@ -202,13 +202,13 @@ public void PreprocessCommand_WithExistingDirectory_DoesNotFail()
202202 }
203203
204204 [ Theory ]
205- [ InlineData ( "!homedir C:\\ my\\ home\\ dir" , "!homedir C:\\ my \\ home\\ dir" ) ]
206- [ InlineData ( "!homedir \" C:\\ my\\ home\\ dir\" " , "!homedir \" C:\\ my \\ home\\ dir\" " ) ]
207- [ InlineData ( "!homedir /mnt/c/my/home/dir" , "!homedir C:\\ my \\ home\\ dir" ) ]
208- [ InlineData ( "!homedir /mnt/analysis/test-path" , "!homedir C:\\ analysis\\ test-path" ) ]
209- [ InlineData ( "!homedir /mnt/share/folder" , "!homedir C:\\ share\\ folder" ) ]
210- [ InlineData ( "!homedir \" /mnt/share/folder\" " , "!homedir \" C:\\ share\\ folder\" " ) ]
211- [ InlineData ( "!HOMEDIR C:\\ test" , "!HOMEDIR C:\\ test" ) ]
205+ [ InlineData ( "!homedir C:\\ my\\ home\\ dir" , "!homedir C:/my/ home/ dir" ) ]
206+ [ InlineData ( "!homedir \" C:\\ my\\ home\\ dir\" " , "!homedir \" C:/my/ home/ dir\" " ) ]
207+ [ InlineData ( "!homedir /mnt/c/my/home/dir" , "!homedir C:/my/ home/ dir" ) ]
208+ [ InlineData ( "!homedir /mnt/analysis/test-path" , "!homedir C:/ analysis/ test-path" ) ]
209+ [ InlineData ( "!homedir /mnt/share/folder" , "!homedir C:/ share/ folder" ) ]
210+ [ InlineData ( "!homedir \" /mnt/share/folder\" " , "!homedir \" C:/ share/ folder\" " ) ]
211+ [ InlineData ( "!HOMEDIR C:\\ test" , "!HOMEDIR C:/ test" ) ]
212212 public void PreprocessCommand_Homedir_ConvertsWslPaths ( string input , string expected )
213213 {
214214 // Arrange
@@ -235,6 +235,7 @@ public void PreprocessCommand_Homedir_CreatesDirectoryIfNotExists()
235235 // Arrange
236236 var tempDir = Path . Combine ( Path . GetTempPath ( ) , "test_homedir_" + Guid . NewGuid ( ) . ToString ( "N" ) [ ..8 ] ) ;
237237 var input = $ "!homedir { tempDir } ";
238+ var expectedPath = tempDir . Replace ( '\\ ' , '/' ) ;
238239
239240 try
240241 {
@@ -248,7 +249,7 @@ public void PreprocessCommand_Homedir_CreatesDirectoryIfNotExists()
248249 var result = m_CommandPreprocessor . PreprocessCommand ( input ) ;
249250
250251 // Assert
251- Assert . Equal ( $ "!homedir { tempDir } ", result ) ;
252+ Assert . Equal ( $ "!homedir { expectedPath } ", result ) ;
252253 Assert . True ( Directory . Exists ( tempDir ) , "Directory should be created automatically" ) ;
253254 }
254255 finally
@@ -267,6 +268,7 @@ public void PreprocessCommand_Homedir_WithExistingDirectory_DoesNotFail()
267268 // Arrange
268269 var tempDir = Path . Combine ( Path . GetTempPath ( ) , "test_homedir_existing_" + Guid . NewGuid ( ) . ToString ( "N" ) [ ..8 ] ) ;
269270 var input = $ "!homedir \" { tempDir } \" ";
271+ var expectedPath = tempDir . Replace ( '\\ ' , '/' ) ;
270272
271273 try
272274 {
@@ -277,7 +279,7 @@ public void PreprocessCommand_Homedir_WithExistingDirectory_DoesNotFail()
277279 var result = m_CommandPreprocessor . PreprocessCommand ( input ) ;
278280
279281 // Assert
280- Assert . Equal ( $ "!homedir \" { tempDir } \" ", result ) ;
282+ Assert . Equal ( $ "!homedir \" { expectedPath } \" ", result ) ;
281283 Assert . True ( Directory . Exists ( tempDir ) , "Directory should still exist" ) ;
282284 }
283285 finally
0 commit comments