@@ -340,8 +340,6 @@ public void InsertLineAbove()
340340 {
341341 TestSetup ( KeyMode . Cmd ) ;
342342
343- var continutationPromptLength = PSConsoleReadLineOptions . DefaultContinuationPrompt . Length ;
344-
345343 // Test case - start with single line, cursor at end
346344 Test ( "56\n 1234" , Keys ( "1234" , _ . Ctrl_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( 0 , 0 ) ) , "56" ) ) ;
347345
@@ -356,13 +354,13 @@ public void InsertLineAbove()
356354
357355 // Test case - start with multi-line, cursor at end of second line (end of input)
358356 Test ( "1234\n 9ABC\n 5678" , Keys ( "1234" , _ . Shift_Enter , "5678" ,
359- _ . Ctrl_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
357+ _ . Ctrl_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
360358 "9ABC" ) ) ;
361359
362360 // Test case - start with multi-line, cursor at beginning of second line
363361 Test ( "1234\n 9ABC\n 5678" , Keys ( "1234" , _ . Shift_Enter , "5678" ,
364- _ . LeftArrow , _ . Home , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
365- _ . Ctrl_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
362+ _ . LeftArrow , _ . Home , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
363+ _ . Ctrl_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
366364 "9ABC" ) ) ;
367365
368366 // Test case - start with multi-line, cursor at end of first line
@@ -380,67 +378,65 @@ public void InsertLineAbove()
380378
381379 // Test case - insert multiple blank lines
382380 Test ( "1234\n 9ABC\n \n 5678" , Keys ( "1234" , _ . Shift_Enter , "5678" ,
383- _ . Ctrl_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
384- _ . Ctrl_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
381+ _ . Ctrl_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
382+ _ . Ctrl_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
385383 "9ABC" ) ) ;
386384
387385 // Test case - create leading blank line, cursor to stay on same line
388386 Test ( "\n \n 1234" , Keys ( "1234" ,
389387 _ . Ctrl_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( 0 , 0 ) ) ,
390- _ . DownArrow , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
391- _ . Ctrl_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ) ) ;
388+ _ . DownArrow , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
389+ _ . Ctrl_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ) ) ;
392390 }
393391
394392 [ SkippableFact ]
395393 public void InsertLineBelow ( )
396394 {
397395 TestSetup ( KeyMode . Cmd ) ;
398396
399- var continutationPromptLength = PSConsoleReadLineOptions . DefaultContinuationPrompt . Length ;
400-
401397 // Test case - start with single line, cursor at end
402398 Test ( "1234\n 56" , Keys ( "1234" ,
403- _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
399+ _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
404400 "56" ) ) ;
405401
406402 // Test case - start with single line, cursor in home position
407403 Test ( "1234\n 56" , Keys ( "1234" ,
408- _ . Home , _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
404+ _ . Home , _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
409405 "56" ) ) ;
410406
411407 // Test case - start with single line, cursor in middle
412408 Test ( "1234\n 56" , Keys ( "1234" ,
413- _ . LeftArrow , _ . LeftArrow , _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
409+ _ . LeftArrow , _ . LeftArrow , _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
414410 "56" ) ) ;
415411
416412 // Test case - start with multi-line, cursor at end of second line (end of input)
417413 Test ( "1234\n 5678\n 9ABC" , Keys ( "1234" , _ . Shift_Enter , "5678" ,
418- _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 2 ) ) ,
414+ _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 2 ) ) ,
419415 "9ABC" ) ) ;
420416
421417 // Test case - start with multi-line, cursor at beginning of second line
422418 Test ( "1234\n 5678\n 9ABC" , Keys ( "1234" , _ . Shift_Enter , "5678" ,
423- _ . LeftArrow , _ . Home , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
424- _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 2 ) ) ,
419+ _ . LeftArrow , _ . Home , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
420+ _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 2 ) ) ,
425421 "9ABC" ) ) ;
426422
427423 // Test case - start with multi-line, cursor at end of first line
428424 Test ( "1234\n 9ABC\n 5678" , Keys ( "1234" , _ . Shift_Enter , "5678" ,
429425 _ . UpArrow , _ . LeftArrow , _ . End , CheckThat ( ( ) => AssertCursorLeftTopIs ( 4 , 0 ) ) ,
430- _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
426+ _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
431427 "9ABC" ) ) ;
432428
433429 // Test case - start with multi-line, cursor at beginning of first line - temporarily having to press Home twice to
434430 // work around bug in home handler.
435431 Test ( "1234\n 9ABC\n 5678" , Keys ( "1234" , _ . Shift_Enter , "5678" ,
436432 _ . UpArrow , _ . LeftArrow , _ . Home , _ . Home , CheckThat ( ( ) => AssertCursorLeftTopIs ( 0 , 0 ) ) ,
437- _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
433+ _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
438434 "9ABC" ) ) ;
439435
440436 // Test case - insert multiple blank lines
441437 Test ( "1234\n 5678\n \n 9ABC" , Keys ( "1234" , _ . Shift_Enter , "5678" ,
442- _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 2 ) ) ,
443- _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 3 ) ) ,
438+ _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 2 ) ) ,
439+ _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 3 ) ) ,
444440 "9ABC" ) ) ;
445441 }
446442
0 commit comments