@@ -27,6 +27,29 @@ public void EscapeAndConcatenateCommandAndArgArrayForProcessStart(string command
2727 result . ShouldBe ( expected ) ;
2828 }
2929
30+ [ Theory ]
31+ [ InlineData ( "pwsh" , null , "pwsh" ) ]
32+ [ InlineData ( "pws \" h\" " , null , "pws \" h\" " ) ]
33+ [ InlineData ( "p w s h" , null , "p w s h" ) ]
34+ [ InlineData ( "pwsh" , new string [ 0 ] , "pwsh" ) ]
35+ [ InlineData ( "pwsh" , new [ ] { "one" , "two" , "three" } , "pwsh one two three" ) ]
36+ [ InlineData ( "pwsh" , new [ ] { "line1\n line2" , "word1\t word2" } , "pwsh line1\n line2 word1\t word2" ) ]
37+ [ InlineData ( "pwsh" , new [ ] { "with spaces" } , "pwsh with spaces" ) ]
38+ [ InlineData ( "pwsh" , new [ ] { @"with\backslash" } , @"pwsh with\backslash" ) ]
39+ [ InlineData ( "pwsh" , new [ ] { @"""quotedwith\backslash""" } , @"pwsh ""quotedwith\backslash""" ) ]
40+ [ InlineData ( "pwsh" , new [ ] { @"C:\Users\" } , @"pwsh C:\Users\" ) ]
41+ [ InlineData ( "pwsh" , new [ ] { @"C:\Program Files\dotnet\" } , @"pwsh C:\Program Files\dotnet\" ) ]
42+ [ InlineData ( "pwsh" , new [ ] { @"backslash\""preceedingquote" } , @"pwsh backslash\""preceedingquote" ) ]
43+ [ InlineData ( "pwsh" , new [ ] { @""" hello """ } , @"pwsh "" hello """ ) ]
44+ public void ConcatenateCommandAndArgArrayForPwshProcessStart ( string command , string [ ] ? args , string expected )
45+ {
46+ // Given / When
47+ var result = ArgumentBuilder . ConcatenateCommandAndArgArrayForPwshProcessStart ( command , args ) ;
48+
49+ // Then
50+ result . ShouldBe ( expected ) ;
51+ }
52+
3053 [ Theory ]
3154 [ InlineData ( "cmd" , null , "cmd" ) ]
3255 [ InlineData ( "cm \" d\" " , null , "cm \" d\" " ) ]
0 commit comments