@@ -340,8 +340,6 @@ public void InsertLineAbove()
340
340
{
341
341
TestSetup ( KeyMode . Cmd ) ;
342
342
343
- var continutationPromptLength = PSConsoleReadLineOptions . DefaultContinuationPrompt . Length ;
344
-
345
343
// Test case - start with single line, cursor at end
346
344
Test ( "56\n 1234" , Keys ( "1234" , _ . Ctrl_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( 0 , 0 ) ) , "56" ) ) ;
347
345
@@ -356,13 +354,13 @@ public void InsertLineAbove()
356
354
357
355
// Test case - start with multi-line, cursor at end of second line (end of input)
358
356
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 ) ) ,
360
358
"9ABC" ) ) ;
361
359
362
360
// Test case - start with multi-line, cursor at beginning of second line
363
361
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 ) ) ,
366
364
"9ABC" ) ) ;
367
365
368
366
// Test case - start with multi-line, cursor at end of first line
@@ -380,67 +378,65 @@ public void InsertLineAbove()
380
378
381
379
// Test case - insert multiple blank lines
382
380
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 ) ) ,
385
383
"9ABC" ) ) ;
386
384
387
385
// Test case - create leading blank line, cursor to stay on same line
388
386
Test ( "\n \n 1234" , Keys ( "1234" ,
389
387
_ . 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 ) ) ) ) ;
392
390
}
393
391
394
392
[ SkippableFact ]
395
393
public void InsertLineBelow ( )
396
394
{
397
395
TestSetup ( KeyMode . Cmd ) ;
398
396
399
- var continutationPromptLength = PSConsoleReadLineOptions . DefaultContinuationPrompt . Length ;
400
-
401
397
// Test case - start with single line, cursor at end
402
398
Test ( "1234\n 56" , Keys ( "1234" ,
403
- _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
399
+ _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
404
400
"56" ) ) ;
405
401
406
402
// Test case - start with single line, cursor in home position
407
403
Test ( "1234\n 56" , Keys ( "1234" ,
408
- _ . Home , _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
404
+ _ . Home , _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
409
405
"56" ) ) ;
410
406
411
407
// Test case - start with single line, cursor in middle
412
408
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 ) ) ,
414
410
"56" ) ) ;
415
411
416
412
// Test case - start with multi-line, cursor at end of second line (end of input)
417
413
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 ) ) ,
419
415
"9ABC" ) ) ;
420
416
421
417
// Test case - start with multi-line, cursor at beginning of second line
422
418
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 ) ) ,
425
421
"9ABC" ) ) ;
426
422
427
423
// Test case - start with multi-line, cursor at end of first line
428
424
Test ( "1234\n 9ABC\n 5678" , Keys ( "1234" , _ . Shift_Enter , "5678" ,
429
425
_ . UpArrow , _ . LeftArrow , _ . End , CheckThat ( ( ) => AssertCursorLeftTopIs ( 4 , 0 ) ) ,
430
- _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
426
+ _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
431
427
"9ABC" ) ) ;
432
428
433
429
// Test case - start with multi-line, cursor at beginning of first line - temporarily having to press Home twice to
434
430
// work around bug in home handler.
435
431
Test ( "1234\n 9ABC\n 5678" , Keys ( "1234" , _ . Shift_Enter , "5678" ,
436
432
_ . UpArrow , _ . LeftArrow , _ . Home , _ . Home , CheckThat ( ( ) => AssertCursorLeftTopIs ( 0 , 0 ) ) ,
437
- _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( continutationPromptLength , 1 ) ) ,
433
+ _ . Ctrl_Shift_Enter , CheckThat ( ( ) => AssertCursorLeftTopIs ( ContinuationPromptLength , 1 ) ) ,
438
434
"9ABC" ) ) ;
439
435
440
436
// Test case - insert multiple blank lines
441
437
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 ) ) ,
444
440
"9ABC" ) ) ;
445
441
}
446
442
0 commit comments