0
0
mirror of https://github.com/vim/vim.git synced 2025-09-28 04:24:06 -04:00

patch 9.0.1779: Need more state() tests

Problem:  Need more state() tests
Solution: Add a few more tests for operater pending mode and register
          yank command

closes: #12883

Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: author
This commit is contained in:
zeertzjq
2023-08-22 21:22:24 +02:00
committed by Christian Brabandt
parent a76f3221cd
commit 8dabccd295
2 changed files with 16 additions and 0 deletions

View File

@@ -2901,6 +2901,20 @@ func Test_state()
call term_sendkeys(buf, getstate)
call WaitForAssert({-> assert_match('state: mSc; mode: n', term_getline(buf, 6))}, 1000)
" A operator is pending
call term_sendkeys(buf, ":call RunTimer()\<CR>y")
call TermWait(buf, 25)
call term_sendkeys(buf, "y")
call term_sendkeys(buf, getstate)
call WaitForAssert({-> assert_match('state: oSc; mode: n', term_getline(buf, 6))}, 1000)
" A register was specified
call term_sendkeys(buf, ":call RunTimer()\<CR>\"r")
call TermWait(buf, 25)
call term_sendkeys(buf, "yy")
call term_sendkeys(buf, getstate)
call WaitForAssert({-> assert_match('state: oSc; mode: n', term_getline(buf, 6))}, 1000)
" Insert mode completion (bit slower on Mac)
call term_sendkeys(buf, ":call RunTimer()\<CR>Got\<C-N>")
call TermWait(buf, 25)