diff options
Diffstat (limited to 'src/testdir')
-rw-r--r-- | src/testdir/dumps/Test_terminal_01.dump | 20 | ||||
-rw-r--r-- | src/testdir/dumps/Test_terminal_02.dump | 20 | ||||
-rw-r--r-- | src/testdir/dumps/Test_terminal_03.dump | 20 | ||||
-rw-r--r-- | src/testdir/test_terminal.vim | 40 |
4 files changed, 100 insertions, 0 deletions
diff --git a/src/testdir/dumps/Test_terminal_01.dump b/src/testdir/dumps/Test_terminal_01.dump new file mode 100644 index 0000000000..22dd32356f --- /dev/null +++ b/src/testdir/dumps/Test_terminal_01.dump @@ -0,0 +1,20 @@ +|4+0&#ffffff0|2| @72 +|4|3| @72 +|4@1| @72 +|4|5| @72 +|4|6| @72 +|4|7| @72 +|4|8| @72 +>4|9| @72 +|~+0#4040ff13&| @73 +|!+2#ffffff16#00e0003|/|b|i|n|/|t|c|s|h| |[|T|e|r|m|i|n|a|l|]| @35|5|2|,|1| @10|B|o|t +| +0#0000000#ffffff0@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|[+1#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1 +| +0&&@74 diff --git a/src/testdir/dumps/Test_terminal_02.dump b/src/testdir/dumps/Test_terminal_02.dump new file mode 100644 index 0000000000..495d2d2f58 --- /dev/null +++ b/src/testdir/dumps/Test_terminal_02.dump @@ -0,0 +1,20 @@ +|4+0&#ffffff0|2| @72 +|4|3| @72 +|4@1| @72 +|4|5| @72 +|4|6| @72 +|4|7| @72 +>4|8| @72 +|4|9| @72 +|~+0#4040ff13&| @73 +|!+2#ffffff16#00e0003|/|b|i|n|/|t|c|s|h| |[|T|e|r|m|i|n|a|l|]| @35|5|1|,|1| @10|B|o|t +| +0#0000000#ffffff0@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|[+1#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1 +| +0&&@74 diff --git a/src/testdir/dumps/Test_terminal_03.dump b/src/testdir/dumps/Test_terminal_03.dump new file mode 100644 index 0000000000..a2883f657f --- /dev/null +++ b/src/testdir/dumps/Test_terminal_03.dump @@ -0,0 +1,20 @@ +|4+0&#ffffff0|3| @72 +|4@1| @72 +|4|5| @72 +|4|6| @72 +|4|7| @72 +|4|8| @72 +|4|9| @72 +|o|n|e| |m|o|r|e| |l|i|n|e| @61 +> @74 +|!+2#ffffff16#00e0003|/|b|i|n|/|t|c|s|h| |[|r|u|n@1|i|n|g|]| @36|4@1|,|1| @10|B|o|t +| +0#0000000#ffffff0@74 +|~+0#4040ff13&| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|~| @73 +|[+1#0000000&|N|o| |N|a|m|e|]| @47|0|,|0|-|1| @9|A|l@1 +| +0&&@74 diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 8eb43a0cc7..b24dbc9974 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -299,6 +299,44 @@ func Test_terminal_scrollback() call term_wait(buf) exe buf . 'bwipe' set termwinscroll& + call delete('Xtext') +endfunc + +func Test_terminal_postponed_scrollback() + if !has('unix') + " tail -f only works on Unix + return + endif + + call writefile(range(50), 'Xtext') + call writefile([ + \ 'terminal', + \ 'call feedkeys("tail -n 100 -f Xtext\<CR>", "xt")', + \ 'sleep 100m', + \ 'call feedkeys("\<C-W>N", "xt")', + \ ], 'XTest_postponed') + let buf = RunVimInTerminal('-S XTest_postponed', {}) + " Check that the Xtext lines are displayed and in Terminal-Normal mode + call VerifyScreenDump(buf, 'Test_terminal_01', {}) + + silent !echo 'one more line' >>Xtext + " Sceen will not change, move cursor to get a different dump + call term_sendkeys(buf, "k") + call VerifyScreenDump(buf, 'Test_terminal_02', {}) + + " Back to Terminal-Job mode, text will scroll and show the extra line. + call term_sendkeys(buf, "a") + call VerifyScreenDump(buf, 'Test_terminal_03', {}) + + call term_wait(buf) + call term_sendkeys(buf, "\<C-C>") + call term_wait(buf) + call term_sendkeys(buf, "exit\<CR>") + call term_wait(buf) + call term_sendkeys(buf, ":q\<CR>") + call StopVimInTerminal(buf) + call delete('XTest_postponed') + call delete('Xtext') endfunc func Test_terminal_size() @@ -1512,6 +1550,8 @@ func Test_terminal_termwinkey() let job = term_getjob(buf) call feedkeys("\<C-L>\<C-C>", 'tx') call WaitForAssert({-> assert_equal("dead", job_status(job))}) + + set termwinkey& endfunc func Test_terminal_out_err() |