@@ -203,6 +203,65 @@ public void MultiLine()
203203 _ . Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( 0 , 2 ) ) ) ) ;
204204 }
205205
206+ [ SkippableFact ]
207+ public void MultiLine_ScreenCheck ( )
208+ {
209+ TestSetup ( KeyMode . Cmd ) ;
210+
211+ var defaultContinuationPrompt = PSConsoleReadLineOptions . DefaultContinuationPrompt ;
212+ var defaultContinuationPromptColors = Tuple . Create ( _console . ForegroundColor , _console . BackgroundColor ) ;
213+
214+ Test ( "@'\n \n hello\n \n world\n '@" ,
215+ Keys (
216+ "@'" , _ . Enter , _ . Enter ,
217+ " hello" , _ . Enter , _ . Enter ,
218+ " world" , _ . Enter , "'@" ,
219+ CheckThat ( ( ) => AssertScreenIs ( 6 ,
220+ TokenClassification . String , "@'" ,
221+ NextLine ,
222+ defaultContinuationPromptColors , defaultContinuationPrompt ,
223+ NextLine ,
224+ defaultContinuationPromptColors , defaultContinuationPrompt ,
225+ TokenClassification . String , " hello" ,
226+ NextLine ,
227+ defaultContinuationPromptColors , defaultContinuationPrompt ,
228+ NextLine ,
229+ defaultContinuationPromptColors , defaultContinuationPrompt ,
230+ TokenClassification . String , " world" ,
231+ NextLine ,
232+ defaultContinuationPromptColors , defaultContinuationPrompt ,
233+ TokenClassification . String , "'@" ) )
234+ ) ) ;
235+
236+ string emptyLine = new string ( ' ' , _console . BufferWidth ) ;
237+ // Set the continuation prompt to be an empty string.
238+ var setOption = new SetPSReadLineOption { ContinuationPrompt = string . Empty } ;
239+ PSConsoleReadLine . SetOptions ( setOption ) ;
240+
241+ try
242+ {
243+ Test ( "@'\n \n hello\n \n world\n '@" ,
244+ Keys (
245+ "@'" , _ . Enter , _ . Enter ,
246+ " hello" , _ . Enter , _ . Enter ,
247+ " world" , _ . Enter , "'@" ,
248+ CheckThat ( ( ) => AssertScreenIs ( 6 ,
249+ TokenClassification . String , "@'" , NextLine ,
250+ TokenClassification . None , emptyLine ,
251+ TokenClassification . String , " hello" , NextLine ,
252+ TokenClassification . None , emptyLine ,
253+ TokenClassification . String , " world" , NextLine ,
254+ TokenClassification . String , "'@" ) )
255+ ) ) ;
256+ }
257+ finally
258+ {
259+ // Restore to the default continuation prompt.
260+ setOption . ContinuationPrompt = defaultContinuationPrompt ;
261+ PSConsoleReadLine . SetOptions ( setOption ) ;
262+ }
263+ }
264+
206265 [ SkippableFact ]
207266 public void LongLine ( )
208267 {
0 commit comments