Mercurial > vim
comparison src/testdir/test_signals.vim @ 20625:116c7bd5e980 v8.2.0866
patch 8.2.0866: not enough tests for buffer writing
Commit: https://github.com/vim/vim/commit/494e9069cb32620f7688a7cb128a3feff827639e
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun May 31 21:28:02 2020 +0200
patch 8.2.0866: not enough tests for buffer writing
Problem: Not enough tests for buffer writing.
Solution: Add more tests. Use CheckRunVimInTerminal in more places.
(Yegappan Lakshmanan, closes #6167)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 31 May 2020 21:30:03 +0200 |
parents | c88ebfcbab03 |
children | 20b6d5304e56 |
comparison
equal
deleted
inserted
replaced
20624:f782c48d548a | 20625:116c7bd5e980 |
---|---|
78 set updatetime& updatecount& | 78 set updatetime& updatecount& |
79 endfunc | 79 endfunc |
80 | 80 |
81 " Test signal INT. Handler sets got_int. It should be like typing CTRL-C. | 81 " Test signal INT. Handler sets got_int. It should be like typing CTRL-C. |
82 func Test_signal_INT() | 82 func Test_signal_INT() |
83 CheckRunVimInTerminal | |
83 if !HasSignal('INT') | 84 if !HasSignal('INT') |
84 throw 'Skipped: INT signal not supported' | 85 throw 'Skipped: INT signal not supported' |
85 endif | 86 endif |
86 | 87 |
87 " Skip the rest of the test when running with valgrind as signal INT is not | 88 " Skip the rest of the test when running with valgrind as signal INT is not |
89 let cmd = GetVimCommand() | 90 let cmd = GetVimCommand() |
90 if cmd =~ 'valgrind' | 91 if cmd =~ 'valgrind' |
91 throw 'Skipped: cannot test signal INT with valgrind' | 92 throw 'Skipped: cannot test signal INT with valgrind' |
92 endif | 93 endif |
93 | 94 |
94 if !CanRunVimInTerminal() | |
95 throw 'Skipped: cannot run vim in terminal' | |
96 endif | |
97 let buf = RunVimInTerminal('', {'rows': 6}) | 95 let buf = RunVimInTerminal('', {'rows': 6}) |
98 let pid_vim = term_getjob(buf)->job_info().process | 96 let pid_vim = term_getjob(buf)->job_info().process |
99 | 97 |
100 " Check that an endless loop in Vim is interrupted by signal INT. | 98 " Check that an endless loop in Vim is interrupted by signal INT. |
101 call term_sendkeys(buf, ":while 1 | endwhile\n") | 99 call term_sendkeys(buf, ":while 1 | endwhile\n") |
118 " result of the deadly signal handler. | 116 " result of the deadly signal handler. |
119 func Test_deadly_signal_TERM() | 117 func Test_deadly_signal_TERM() |
120 if !HasSignal('TERM') | 118 if !HasSignal('TERM') |
121 throw 'Skipped: TERM signal not supported' | 119 throw 'Skipped: TERM signal not supported' |
122 endif | 120 endif |
123 if !CanRunVimInTerminal() | 121 CheckRunVimInTerminal |
124 throw 'Skipped: cannot run vim in terminal' | |
125 endif | |
126 let cmd = GetVimCommand() | 122 let cmd = GetVimCommand() |
127 if cmd =~ 'valgrind' | 123 if cmd =~ 'valgrind' |
128 throw 'Skipped: cannot test signal TERM with valgrind' | 124 throw 'Skipped: cannot test signal TERM with valgrind' |
129 endif | 125 endif |
130 let lines =<< trim END | 126 let lines =<< trim END |