@@ -305,9 +305,8 @@ public async Task CanStepPastSystemWindowsForms()
305
305
[ Fact ]
306
306
public async Task CanLaunchScriptWithCommentedLastLineAsync ( )
307
307
{
308
- string script = GenerateScriptFromLoggingStatements ( "a log statement" ) + "# a comment at the end" ;
309
- Assert . Contains ( Environment . NewLine + "# a comment" , script ) ;
310
- Assert . EndsWith ( "at the end" , script ) ;
308
+ string script = GenerateScriptFromLoggingStatements ( "$($MyInvocation.Line)" ) + "# a comment at the end" ;
309
+ Assert . EndsWith ( Environment . NewLine + "# a comment at the end" , script ) ;
311
310
312
311
// NOTE: This is horribly complicated, but the "script" parameter here is assigned to
313
312
// PsesLaunchRequestArguments.Script, which is then assigned to
@@ -317,8 +316,13 @@ public async Task CanLaunchScriptWithCommentedLastLineAsync()
317
316
318
317
ConfigurationDoneResponse configDoneResponse = await PsesDebugAdapterClient . RequestConfigurationDone ( new ConfigurationDoneArguments ( ) ) . ConfigureAwait ( true ) ;
319
318
Assert . NotNull ( configDoneResponse ) ;
319
+ // We can check that the script was invoked as expected, which is to dot-source a script
320
+ // block with the contents surrounded by newlines. While we can't check that the last
321
+ // line was a curly brace by itself, we did check that the contents ended with a
322
+ // comment, so if this output exists then the bug did not recur.
320
323
Assert . Collection ( await GetLog ( ) . ConfigureAwait ( true ) ,
321
- ( i ) => Assert . Equal ( "a log statement" , i ) ) ;
324
+ ( i ) => Assert . Equal ( ". {" , i ) ,
325
+ ( i ) => Assert . Equal ( "" , i ) ) ;
322
326
}
323
327
324
328
[ SkippableFact ]
0 commit comments